Skip to content

Commit

Permalink
patches uncaught TypeError in component editing
Browse files Browse the repository at this point in the history
  • Loading branch information
johnclary committed Jan 23, 2024
1 parent 7b202d1 commit 7725d5e
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,16 @@ export default function TheMap({
)
return;

const sourceFeatureId = SOURCES[clickedFeatureSource]._featureIdProp;
const databaseTableId = SOURCES[clickedFeatureSource].databaseTableId;
const source = SOURCES[clickedFeatureSource];
if (!source) {
// this can happen if the mapped is zoomed out such that AGOL/CTN feature layers are not visibile
// but the underyling draft edit component has captured a click
// we can't handle this click right now, so just return
// todo: manage layer interactivity based on zoom level + if the feature is drawn?
return;
}
const sourceFeatureId = source._featureIdProp;
const databaseTableId = source.databaseTableId;
const featureUniqueId = clickedFeature.properties[sourceFeatureId];

const featureFromAgolGeojson = findFeatureInAgolGeojsonFeatures(
Expand Down

0 comments on commit 7725d5e

Please sign in to comment.