diff options
Diffstat (limited to 'web/js/map-bing-ol.js')
-rw-r--r-- | web/js/map-bing-ol.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index bbaf22940..b0e5dfc6a 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -14,15 +14,18 @@ fixmystreet.maps.config = function() { (function() { $(function(){ - $('#map_layer_toggle').toggle(function(){ - $(this).text('Roads'); - fixmystreet.map.setBaseLayer(fixmystreet.map.layers[1]); - }, function(){ - $(this).text('Aerial'); - fixmystreet.map.setBaseLayer(fixmystreet.map.layers[0]); + $('#map_layer_toggle').click(function(e) { + e.preventDefault(); + var $this = $(this); + if ($this.text() == translation_strings.map_aerial) { + $this.text(translation_strings.map_roads); + fixmystreet.map.setBaseLayer(fixmystreet.map.layers[1]); + } else { + $this.text(translation_strings.map_aerial); + fixmystreet.map.setBaseLayer(fixmystreet.map.layers[0]); + } }); }); - })(); OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { |