-
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
Enable property functions for icon-rotate #2738
Conversation
Yes, I will look into this now. |
Just built a fun demo using http://restbus.info/ (thanks @peterqliu @ericfischer!) This demo really highlights the need for better interpolation 😄 http://bl.ocks.org/lucaswoj/raw/ce18d1fb581a229624fb84c5549eb899/ |
Pushed a new commit and (updated the demo) to use linear interpolation for rotated icons |
That looks great! |
2929d57
to
eab9deb
Compare
801ad95
to
9832cde
Compare
@lucaswoj is there a way for me to individually rotate icons in the FeatureCollection like in: http://bl.ocks.org/lucaswoj/ce18d1fb581a229624fb84c5549eb899 That is, instead of the entire set of icons. I am using: v0.20.1 I have tried copy pasting the relevant code from that blocks url and the result does not reflect what resides in the url provided. |
|
@swratten My apologies. The problem is that property functions for |
No problem, thanks for that the master build works perfectly cheers! |
* Pass entire style layer to functions within quads.js * Enable property functions for icon-rotate * Use linear interpolation for rotated icons Update test-suite * Update package.json
Do property functions work for the map.addLayer({
layout: {
'text-anchor': {
property: 'textAnchor',
stops: [
['top-left', 'top-left'],
['top-right', 'top-right']
]
}
}
}); Where the feature object has a map.addLayer({
layout: {
'text-anchor': '{textAnchor}'
}
}); |
@dvonlehman Please see https://www.mapbox.com/mapbox-gl-style-spec/, which now lists the current status of data-driven styling support. |
I'm on version 0.22, still no support for "icon-rotate" from properties |
@ilyatrunov |
@danpat ok, can you please update the version here: thank you |
Sorry, my bad, it works from 0.21 and onwards. @ilyatrunov can you paste a sample of your style? It sounds like you might have the syntax wrong. |
@danpat my data set has a "heading" property in "properties". and it's numeric. I've updated to v0.24, but still - same error |
@ilyatrunov The interpolated string syntax is only for |
@jfirebaugh thank you! it's all good now. can this be added to the documentation, for the people who will need this? thanks again! |
I used intervals of 30 deg, like this: On Wed, Sep 28, 2016 at 3:55 PM, Simona [email protected] wrote:
|
@ilyatrunov The stops are interpolated so you should only need to include |
@jfirebaugh Hi, would you please help me in finding a solution for my problem? I am trying to bind the icon-rotate property to one of the properties called "heading" in my feature. It is not working and I am not sure how to proceed further. Please see the following: I would greatly appreciate if you could please point me to a right direction. Thank you so much in advance. |
@rlanda123 the |
@lbud Thank you soooooo much for your help. I used the identity function as you suggested like below and it works now! I have no words to express my thanks to you. Thanks million for your quick response.
|
I will follow your suggestion and post in StackOverflow next time. Sorry for this time, I did not know. Thanks a lot again.
From: Lauren Budorick [mailto:[email protected]]
Sent: Tuesday, February 06, 2018 12:49 PM
To: mapbox/mapbox-gl-js
Cc: Landa, Ravee; Mention
Subject: Re: [mapbox/mapbox-gl-js] Enable property functions for icon-rotate (#2738)
@rlanda123<https://github.com/rlanda123> the {token syntax} is only for text-field and icon-image, as noted above<#2738 (comment)>; see "identity functions" in the documentation<https://www.mapbox.com/mapbox-gl-js/style-spec/#function-type> for your use case. In the future please direct "how do I" questions to StackOverflow.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2738 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAIP1Fg-8zMfWNPMjwp5Gb3K6i9wWbt5ks5tSLqggaJpZM4I1tVv>.
|
ref mapbox/mapbox-gl-test-suite#110
cc @jfirebaugh @mourner @mollymerp @lbud
fixes #2736