]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/history.js
Fix highlight of changesets with no bounding box
[rails.git] / app / assets / javascripts / index / history.js
index 80fb68444f6469ee4e41e03d2f09654a337dfe12..fe64c295999792d91f19b5cf28ae4a6b54a987ca 100644 (file)
@@ -40,12 +40,14 @@ OSM.History = function (map) {
   };
 
   function highlightChangeset(id) {
-    group.getLayer(id).setStyle({ fillOpacity: 0.3, color: "#FF6600", weight: 3 });
+    var layer = group.getLayer(id);
+    if ( layer ) layer.setStyle({ fillOpacity: 0.3, color: "#FF6600", weight: 3 });
     $("#changeset_" + id).addClass("selected");
   }
 
   function unHighlightChangeset(id) {
-    group.getLayer(id).setStyle({ fillOpacity: 0, color: "#FF9500", weight: 2 });
+    var layer = group.getLayer(id);
+    if ( layer ) layer.setStyle({ fillOpacity: 0, color: "#FF9500", weight: 2 });
     $("#changeset_" + id).removeClass("selected");
   }