From 1f9857e76c2abb8d1e3c9046480a9878004451f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marco=20Antonio=20Frias=20Butr=C3=B3n?= Date: Sun, 16 Oct 2016 16:26:19 -0400 Subject: [PATCH] Patch classes on the locate control This patches the map on the user page in the same way as the main map. Closes #1328 --- app/assets/javascripts/user.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js index e8ad3324d..7e7e7c803 100644 --- a/app/assets/javascripts/user.js +++ b/app/assets/javascripts/user.js @@ -12,14 +12,25 @@ $(document).ready(function () { L.OSM.zoom({position: position}) .addTo(map); - L.control.locate({ + var locate = L.control.locate({ position: position, + icon: 'icon geolocate', + iconLoading: 'icon geolocate', strings: { title: I18n.t('javascripts.map.locate.title'), popup: I18n.t('javascripts.map.locate.popup') } }).addTo(map); + var locateContainer = locate.getContainer(); + + $(locateContainer) + .removeClass('leaflet-control-locate leaflet-bar') + .addClass('control-locate') + .children("a") + .removeClass('leaflet-bar-part leaflet-bar-part-single') + .addClass('control-button'); + if (OSM.home) { map.setView([OSM.home.lat, OSM.home.lon], 12); } else { -- 2.43.2