]> git.openstreetmap.org Git - rails.git/commitdiff
Discard empty ways from query result geometries
authormmd-osm <mmd.osm@gmail.com>
Thu, 10 Aug 2017 18:49:50 +0000 (19:49 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 10 Aug 2017 18:49:50 +0000 (19:49 +0100)
Fixes #1608

app/assets/javascripts/index/query.js

index 018aedf98a01df4c5bc3a4996611b9596edbd386..7ac613d71ec1737e2d80088ad5f3c0e29d177868 100644 (file)
@@ -146,7 +146,7 @@ OSM.Query = function(map) {
 
     if (feature.type === "node" && feature.lat && feature.lon) {
       geometry = L.circleMarker([feature.lat, feature.lon], featureStyle);
-    } else if (feature.type === "way" && feature.geometry) {
+    } else if (feature.type === "way" && feature.geometry && feature.geometry.length > 0) {
       geometry = L.polyline(feature.geometry.filter(function (point) {
         return point !== null;
       }).map(function (point) {