X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9a9b045372a6f48420a9a6dacfde52c34ab7abce..8db05481193bfb105c76cda40ea0617b5f10545e:/app/assets/javascripts/user.js 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 {