You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider https://jsfiddle.net/w9bs8jot/. A GeoJSON Line feature is cut into multiple tiles and makes it impossible to query the entire line feature. A customer recently flagged this issue because they wanted users to be able to click on a line feature and get its start and/or end points.
Design Alternatives
There's a potential workaround.
const selectedFeatures = map.queryRenderedFeatures(point);
selectedFeatures.forEach(feature => {
const source = map.getSource(feature.source);
// filter for the feature's original coordinates in the source
console.log('source data: ', source._data.features[0].geometry.coordinates);
})
Design
We could add the original geometry to the features in a GeoJSON vector tile, although this may not be performant enough with large GeoJSON features.
Alternatively, queryRenderedFeatures needs a way to retrieve the original geometry for the feature.
The text was updated successfully, but these errors were encountered:
Motivation
Consider https://jsfiddle.net/w9bs8jot/. A GeoJSON Line feature is cut into multiple tiles and makes it impossible to query the entire line feature. A customer recently flagged this issue because they wanted users to be able to click on a line feature and get its start and/or end points.
Design Alternatives
There's a potential workaround.
Design
We could add the original geometry to the features in a GeoJSON vector tile, although this may not be performant enough with large GeoJSON features.
Alternatively, queryRenderedFeatures needs a way to retrieve the original geometry for the feature.
The text was updated successfully, but these errors were encountered: