]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/user.js
Refactoring 4 life
[rails.git] / app / assets / javascripts / user.js
index 4e1c7d0c3ff19132eced6d9458787b6b788ad220..4e646771247c93dad7c67cbe4cd49fd76c85ae0d 100644 (file)
@@ -1,7 +1,14 @@
 $(document).ready(function () {
-  var map = createMap("map", {
-    zoomControl: true,
-    panZoomControl: false
+  var map = L.map("map", {
+    attributionControl: false,
+    zoomControl: false
+  }).addLayer(new L.OSM.Mapnik());
+
+  L.control.zoom({position: 'topright'})
+    .addTo(map);
+
+  $("#map").on("resized", function () {
+    map.invalidateSize();
   });
 
   if (OSM.home) {
@@ -33,7 +40,7 @@ $(document).ready(function () {
       var user = $(this).data('user');
       if (user.lon && user.lat) {
         L.marker([user.lat, user.lon], {icon: getUserIcon(user.icon)}).addTo(map)
-          .bindPopup(user.description, {offset: L.point(-1, -20)});
+          .bindPopup(user.description);
       }
     });
   }