-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distance expression operator #6062
Comments
Something like |
This should be possible using Turfjs/turf-distance and Turfjs/turf-centroid. |
Something I didn’t consider is that features from vector tiles are… tiled. So a feature centroid would only be meaningful for points plus polylines/polygons that are small enough to fit in a single tile at the current zoom level. |
The upcoming /cc @zmiao |
A The expression operator has not yet been added to the style specification, so a JSON stylesheet that includes it might fail validation (not sure). /cc @chloekraw |
Any chance this is being worked on now? There are several instances and customer use cases where it would be very helpful. |
Can please someone tell if this feature will come this year for mapbox-gl? It looks like feature is full implemented since months. |
There’s a draft implementation in #10616. |
It would be nice to have an expression operator that evaluates to the physical distance between two geographic coordinates. Coupled with an operator that evaluates to the centroid of the current feature and even the ability to apply a gradient to a shape (#4095), it would enable interesting visualizations that draw the viewer’s attention to a particular feature. A more mundane use case would be displaying the distance of each city on the map as you hover over a particular city.
This request is inspired by the
distanceToLocation:fromLocation:(there, here)
function built into NSExpression on iOS and macOS, which returns the distance in meters from the coordinate there to the coordinate here./cc @anandthakker
The text was updated successfully, but these errors were encountered: