]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Enable some more eslint rules from iD rules
[rails.git] / app / assets / javascripts / index.js
index e8e566f53a2ca698ae09000cb73d54118282fd8d..2678ba2824e3ad7edd05560a1a6bdd80324251d8 100644 (file)
 $(document).ready(function () {
   var loaderTimeout;
 
+  var map = new L.OSM.Map("map", {
+    zoomControl: false,
+    layerControl: false,
+    contextmenu: true
+  });
+
   OSM.loadSidebarContent = function(path, callback) {
     map.setSidebarOverlaid(false);
 
@@ -78,12 +84,6 @@ $(document).ready(function () {
 
   var params = OSM.mapParams();
 
-  var map = new L.OSM.Map("map", {
-    zoomControl: false,
-    layerControl: false,
-    contextmenu: true
-  });
-
   map.attributionControl.setPrefix('');
 
   map.updateLayers(params.layers);
@@ -334,7 +334,7 @@ $(document).ready(function () {
     };
 
     function addObject(type, id, center) {
-      map.addObject({type: type, id: parseInt(id)}, function(bounds) {
+      map.addObject({type: type, id: parseInt(id, 10)}, function(bounds) {
         if (!window.location.hash && bounds.isValid() &&
             (center || !map.getBounds().contains(bounds))) {
           OSM.router.withoutMoveListener(function () {