diff options
author | Marius Halden <marius.h@lden.org> | 2015-11-16 11:15:10 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2015-11-16 11:15:10 +0100 |
commit | 1339a64632c441e4d7858bd5946738c9840c624d (patch) | |
tree | 0b1393ca9af05d1af690fbf6c569c195f4136e4c /web/js/map-google-ol.js | |
parent | 17cc40a8a2387669984ae4a36bb0d30d889d1a07 (diff) | |
parent | 4fb5331abd2fa4c89ebeb89bc92a245fadd0aa19 (diff) |
Merge branch 'fiksgatami-dev' into fiksgatami-prod
Oppgrader prod til 1.7
Diffstat (limited to 'web/js/map-google-ol.js')
-rw-r--r-- | web/js/map-google-ol.js | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/web/js/map-google-ol.js b/web/js/map-google-ol.js index a0e58cdc2..5a1aa3c57 100644 --- a/web/js/map-google-ol.js +++ b/web/js/map-google-ol.js @@ -1,11 +1,18 @@ $(function(){ - $('#map_layer_toggle').toggle(function(){ - $(this).text(translation_strings.map_satellite); - fixmystreet.map.setBaseLayer(fixmystreet.map.layers[1]); - }, function(){ - $(this).text(translation_strings.map_map); - fixmystreet.map.setBaseLayer(fixmystreet.map.layers[0]); + $('#map_layer_toggle').on('click', function(e){ + e.preventDefault(); + var $t = $(this), text = $t.text(); + if (text == translation_strings.map_map) { + $t.text(translation_strings.map_satellite); + fixmystreet.map.setBaseLayer(fixmystreet.map.layers[0]); + } else { + $t.text(translation_strings.map_map); + fixmystreet.map.setBaseLayer(fixmystreet.map.layers[1]); + } }); + if (typeof fixmystreet_google_default !== 'undefined' && fixmystreet_google_default == 'satellite') { + $('#map_layer_toggle').click(); + } }); function set_map_config(perm) { @@ -25,9 +32,10 @@ function set_map_config(perm) { fixmystreet.map_options = { zoomDuration: 10 }; + fixmystreet.layer_options = [ - { type: google.maps.MapTypeId.HYBRID }, - {} + {}, + { type: google.maps.MapTypeId.HYBRID } ]; } |