Add additional check for malformed GeoJSON data

This commit is contained in:
Quincy Morgan
2020-07-07 13:17:47 -04:00
parent b3267e3a2a
commit dff6ee01dc

View File

@@ -500,10 +500,13 @@ export function svgData(projection, context, dispatch) {
var map = context.map();
var viewport = map.trimmedExtent().polygon();
var coords = features.reduce(function(coords, feature) {
var c = feature.geometry.coordinates;
var geom = feature.geometry;
if (!geom) return coords;
var c = geom.coordinates;
/* eslint-disable no-fallthrough */
switch (feature.geometry.type) {
switch (geom.type) {
case 'Point':
c = [c];
case 'MultiPoint':