From: Marco Antonio Frias ButrĂ³n Date: Sun, 16 Oct 2016 20:26:19 +0000 (-0400) Subject: Patch classes on the locate control X-Git-Tag: live~3723 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/1f9857e76c2abb8d1e3c9046480a9878004451f7 Patch classes on the locate control This patches the map on the user page in the same way as the main map. Closes #1328 --- 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 {