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 018aedf..7ac613d 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) {