-
-
Notifications
You must be signed in to change notification settings - Fork 717
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
Unimplemented distance
expression
#2077
Comments
It might be that this is not fully supported as you said about the draft PR, I'm not sure. |
Distance is the only expression that is only implemented in MapLibre GL Native and not in MapLibre GL JS, see the supported SDKs table in https://maplibre.org/maplibre-gl-js-docs/style-spec/expressions/#distance |
Thanks @wipfli for pointing this, I'm so stupid ! Ok so I think this features's state is inherited from mapbox-gl before the fork. I dugg into the draft PR a little bit; and apparently the feature is developed, but the bundle size bump involved is considered too high to allow a merge as-is. The feature has been marked as "postponed" in that sense. "Bundle size bump too big" + "already implemented" sounds like a perfect fit for a plugin, in my mind. Doesn't it ? |
distance
expression
Yes, plugin is the right solution for bundle size issues. |
Hey @HarelM ,
I'm afraid I'm not familiar enough with the codebase, the cartography world and don't have enough time to give it a shot. Though I surely can help and start by documenting and researching a little bit. Probably related :
|
Answer moved to #1295 (comment) |
I've done an initial implementation of distance, full polygon support is still missing, but it's getting there... |
This will probably get released in the next version within a few days. |
Context
I'm trying to color my symbols based on their distance from a point on a map (a marker of my own).
I landed on the documented
distance
expression and naively tried to replace myicon-color
with it.maplibre-gl-js version: 2.4.0
browser: Chrome 108.0.5359.124
Steps to Trigger Behavior
Link to Demonstration
PoC, working symbol with static color : https://jsfiddle.net/cpn1dkv8/
Not working symbol with distance based-color https://jsfiddle.net/cpn1dkv8/1/
Expected Behavior
Since it's documented, I'd expect it to work like so.
Actual Behavior
It's generating an error :
Addendum
For what it's worth, the original mapbox-gl implementation seems to be blocked in a draft PR here (and the feature is also documented in mapbox docs too).
The text was updated successfully, but these errors were encountered: