]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.map.js
Add JSHint to travis configuration
[rails.git] / app / assets / javascripts / leaflet.map.js
index 2201afe68a83baa73cd891fa43162980e7aa327c..f433cd3713181fdeaa6cd6f9bee5727b860b8d34 100644 (file)
@@ -64,7 +64,7 @@ L.OSM.Map = L.Map.extend({
       if (layerParam.indexOf(this.baseLayers[i].options.code) >= 0) {
         this.addLayer(this.baseLayers[i]);
         layersAdded = layersAdded + this.baseLayers[i].options.code;
       if (layerParam.indexOf(this.baseLayers[i].options.code) >= 0) {
         this.addLayer(this.baseLayers[i]);
         layersAdded = layersAdded + this.baseLayers[i].options.code;
-      } else if (i == 0 && layersAdded == "") {
+      } else if (i === 0 && layersAdded === "") {
         this.addLayer(this.baseLayers[i]);
       } else {
         this.removeLayer(this.baseLayers[i]);
         this.addLayer(this.baseLayers[i]);
       } else {
         this.removeLayer(this.baseLayers[i]);
@@ -210,7 +210,7 @@ L.OSM.Map = L.Map.extend({
             return true;
           } else if (object.type === "relation") {
             for (var i = 0; i < relations.length; i++)
             return true;
           } else if (object.type === "relation") {
             for (var i = 0; i < relations.length; i++)
-              if (relations[i].members.indexOf(node) != -1)
+              if (relations[i].members.indexOf(node) !== -1)
                 return true;
           } else {
             return false;
                 return true;
           } else {
             return false;
@@ -236,7 +236,7 @@ L.OSM.Map = L.Map.extend({
       center: this.getCenter().wrap(),
       zoom: this.getZoom(),
       layers: this.getLayersCode()
       center: this.getCenter().wrap(),
       zoom: this.getZoom(),
       layers: this.getLayersCode()
-    }
+    };
   },
 
   setState: function(state, options) {
   },
 
   setState: function(state, options) {
@@ -275,7 +275,7 @@ L.extend(L.Icon.Default.prototype, {
   }
 });
 
   }
 });
 
-function getUserIcon(url) {
+OSM.getUserIcon = function (url) {
   return L.icon({
     iconUrl: url || OSM.MARKER_RED,
     iconSize: [25, 41],
   return L.icon({
     iconUrl: url || OSM.MARKER_RED,
     iconSize: [25, 41],
@@ -284,4 +284,4 @@ function getUserIcon(url) {
     shadowUrl: OSM.MARKER_SHADOW,
     shadowSize: [41, 41]
   });
     shadowUrl: OSM.MARKER_SHADOW,
     shadowSize: [41, 41]
   });
-}
+};