aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-google.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-01-14 12:53:34 +0000
committerMatthew Somerville <matthew@mysociety.org>2011-01-14 12:53:34 +0000
commit6dae847b330b0958442fc89c323a9b3e9a5be240 (patch)
treee948682978bdba3372984f42c2b8a95b0c1b5159 /web/js/map-google.js
parentaf94672c0cef154b1e0068aa1c9dd0dd58c32fb4 (diff)
parent7f834105f3ec090b7e8827460fee4847a65a03c7 (diff)
Merge branch 'master' into reportemptyhomes
Diffstat (limited to 'web/js/map-google.js')
-rw-r--r--web/js/map-google.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/web/js/map-google.js b/web/js/map-google.js
new file mode 100644
index 000000000..77e54ab7c
--- /dev/null
+++ b/web/js/map-google.js
@@ -0,0 +1,22 @@
+YAHOO.util.Event.onContentReady('map', function() {
+ var centre = new google.maps.LatLng( fixmystreet.lat, fixmystreet.lon );
+ var map = new google.maps.Map(document.getElementById("map"), {
+ mapTypeId: google.maps.MapTypeId.ROADMAP,
+ center: centre,
+ zoom: 16,
+ disableDefaultUI: true,
+ navigationControl: true,
+ navigationControlOptions: {
+ style: google.maps.NavigationControlStyle.SMALL
+ },
+ mapTypeControl: true,
+ mapTypeControlOptions: {
+ style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
+ }
+ });
+
+ google.maps.event.addListener(map, "zoom_changed", function() {
+ if (map.getZoom() < 13) map.setZoom(13);
+ if (map.getZoom() > 17) map.setZoom(17);
+ });
+});