-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Enable property functions for *-translate properties #2731
Comments
We should be able to implement this by adding a |
This applies to the symbol properties as well:
|
The only downsides that I can think of for doing it this way is the hackiness of including special-case checking for
Would this need to be an attribute, rather than a uniform, to allow for property functions? |
I'm looking into implementing this (specifically circle-translate) but I was wondering how to support per feature translation?
Any pointers maybe of where to look if I'd like to implement this per feature? Thanks! |
This isn't working? UPDATE: Looks like it is not yet merged. Geojson being:
I was trying to use this as a means of doing cheap spiderfying/exploding/clustering by pre-identifying circles to be offset. In my case I am using a circle to create a dynamic colored icon since markers do not support dynamic coloring. But I can see where someone working with circle graph data would have overlaps. |
@ericjames I am pursuing a similar solution and I am kind of confused why property expressions work for *-offset properties e.g. on symbol type layers, but not for circle-translate. While this doesn't work
this works perfectly fine
Only thing I can think of right now is adding a separate layer for each feature in a loop like this:
but that's messy to handle. If this is just a matter of merging, maybe this could be implemented fast? |
@jfirebaugh @lucaswoj @ericrwolfe any news on this? We would love to be able to use these properties with the data-driven styling API. Makes the API a lot more complete. A less than ideal workaround we often need to use is to create separate layers with the corresponding settings, which impacts performance and makes the code less readable. |
I'm simply modifying the actual coordinates of the values of markers I want spiderfied. |
@asheemmamoowala does this mean that there is an alternative solution that doesn't rely upon duplication and main-thread js processing of all the features we need to offset? |
I'm wondering if there have been other solutions since. I ran into this thread looking for ways to evenly distribute circles that share the same coordinate without manually adjusting the coordinates. This is what I've got so far but it's not ideal because it doesn't take into consideration zoom or the pixel size of circles:
|
Supporting *-translate properties isn't as straightforward as supporting other paint properties because translation is incorporated into the transform matrix.
Potential Designs
Properties
circle-translate
circle-translate-anchor
line-translate
line-translate-anchor
fill-translate
fill-translate-anchor
The text was updated successfully, but these errors were encountered: