Skip to content

Commit

Permalink
check for emtpy geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyblasta authored Mar 11, 2024
1 parent a09f339 commit cf22f33
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/controls/draganddrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,16 @@ const DragAndDrop = function DragAndDrop(options = {}) {
const types = new Set();
const getStyleFunction = viewer.getStylewindow().getStyleFunction;
event.features.forEach((feature) => {
const geometryType = feature.getGeometry().getType();
if (featureStyles && featureStyles[geometryType]) {
if (!types.has(geometryType)) {
styles.push(...featureStyles[geometryType]);
types.add(geometryType);
if (feature.getGeometry() !== null) {
const geometryType = feature.getGeometry().getType();
if (featureStyles && featureStyles[geometryType]) {
if (!types.has(geometryType)) {
styles.push(...featureStyles[geometryType]);
types.add(geometryType);
}
} else {
getStyleFunction(feature);
}
} else {
getStyleFunction(feature);
}
});
if (styles.length && (!['kml', 'kmz'].includes(fileExtension.toLowerCase()))) {
Expand Down

0 comments on commit cf22f33

Please sign in to comment.