]> git.openstreetmap.org Git - rails.git/commitdiff
Replace deprecated hover listener by mouseenter/leave
authorAnton Khorev <tony29@yandex.ru>
Wed, 9 Apr 2025 15:36:23 +0000 (18:36 +0300)
committerAnton Khorev <tony29@yandex.ru>
Wed, 9 Apr 2025 18:49:33 +0000 (21:49 +0300)
app/assets/javascripts/index/directions-route-output.js

index 1f1ff4df643448561daa74945d85dfd7679188a8..800181034a8a227c4a8accc6ac0bde46f564f4dc 100644 (file)
@@ -95,13 +95,15 @@ OSM.DirectionsRouteOutput = function (map) {
           .openOn(map);
       });
 
-      row.hover(function () {
-        highlight
-          .setLatLngs(lineseg)
-          .addTo(map);
-      }, function () {
-        map.removeLayer(highlight);
-      });
+      row
+        .on("mouseenter", function () {
+          highlight
+            .setLatLngs(lineseg)
+            .addTo(map);
+        })
+        .on("mouseleave", function () {
+          map.removeLayer(highlight);
+        });
     }
 
     const blob = new Blob([JSON.stringify(polyline.toGeoJSON())], { type: "application/json" });