]> git.openstreetmap.org Git - rails.git/commitdiff
Don't highlight selected items in the data layer
authorTom Hughes <tom@compton.nu>
Tue, 22 Feb 2022 18:54:40 +0000 (18:54 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 22 Feb 2022 18:54:40 +0000 (18:54 +0000)
Routing to the feature page is going to cause them to be overlaid
in orange anyway so there's no need for the blue highlight.

app/assets/javascripts/index/browse.js

index 779a21d6986819423be701353b7ff9959797d2bf..3f888c1cdca5d7a214159ff5bb4cc40b665b7cfb 100644 (file)
@@ -1,6 +1,5 @@
 OSM.initializeBrowse = function (map) {
   var browseBounds;
 OSM.initializeBrowse = function (map) {
   var browseBounds;
-  var selectedLayer;
   var dataLayer = map.dataLayer;
 
   dataLayer.setStyle({
   var dataLayer = map.dataLayer;
 
   dataLayer.setStyle({
@@ -92,7 +91,6 @@ OSM.initializeBrowse = function (map) {
       url: url,
       success: function (xml) {
         dataLayer.clearLayers();
       url: url,
       success: function (xml) {
         dataLayer.clearLayers();
-        selectedLayer = null;
 
         var features = dataLayer.buildFeatures(xml);
 
 
         var features = dataLayer.buildFeatures(xml);
 
@@ -118,18 +116,6 @@ OSM.initializeBrowse = function (map) {
   }
 
   function onSelect(layer) {
   }
 
   function onSelect(layer) {
-    // Unselect previously selected feature
-    if (selectedLayer) {
-      selectedLayer.setStyle(selectedLayer.originalStyle);
-    }
-
-    // Redraw in selected style
-    layer.originalStyle = { color: layer.options.color, weight: layer.options.weight };
-    layer.setStyle({ color: "#0000ff", weight: 8 });
-
     OSM.router.route("/" + layer.feature.type + "/" + layer.feature.id);
     OSM.router.route("/" + layer.feature.type + "/" + layer.feature.id);
-
-    // Stash the currently drawn feature
-    selectedLayer = layer;
   }
 };
   }
 };