diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-07-14 09:24:02 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-07-14 12:44:07 +0100 |
commit | eed6158981240afce10824e82fa86f14b38f3167 (patch) | |
tree | 277aba725204ba234db5893e79af427fa2a5e063 /web/js | |
parent | c3313f7206e832a7e78890b21372cdf72bdf70ad (diff) |
Remove use of jQuery toggle().
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/map-bing-ol.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index a329c4235..b0e5dfc6a 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -14,8 +14,16 @@ fixmystreet.maps.config = function() { (function() { $(function(){ - $(this).text(translation_strings.map_roads); - $(this).text(translation_strings.map_aerial); + $('#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]); + } }); }); })(); |