]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/user.js
Remove explicit context menu width
[rails.git] / app / assets / javascripts / user.js
index e8ad3324d0ccc2b01e5a4e3b388b39f0d47f6603..7e7e7c8032a6cbab6d9018d7d0ee888eb0dd0df2 100644 (file)
@@ -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 {