Skip to content
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

Provide a way to specify function outputs in real-world units #2525

Open
invisibleroads opened this issue May 4, 2016 · 5 comments
Open

Comments

@invisibleroads
Copy link

invisibleroads commented May 4, 2016

Thanks for making Mapbox GL. We are considering migrating from Mapbox JS to Mapbox GL.

Is there a way to specify point/circle radius in meters? Mapbox JS differentiated between Circle radius in meters (marker size varies by zoom but stays constant with respect to map) and CircleMarker radius in pixels (marker size does not vary by zoom but stays constant with respect to display).

@lucaswoj
Copy link
Contributor

lucaswoj commented May 4, 2016

Hi @invisibleroads!

There is not presently a turnkey way to specify circle radius in meters. With some precomputation, it should be possible to use functions to specify circle radius in meters, however this is left as an exercise to the reader.

I could imagine us creating a new style function units property along the lines of

{
  property: 'radius',
  stops: [[0, 0], [10000, 10000]], 
  units: 'meters'
}

@lucaswoj lucaswoj changed the title Is there a way to specify point/circle radius in meters? Provide a way to specify function outputs in real-world units May 4, 2016
@invisibleroads
Copy link
Author

Thanks for the response, @lucaswoj.

I want to emphasize that it is a little more involved, since in the original Mapbox JS, a circle with a radius specified in meters would change size depending on the level of zoom.

@princeofnaxos
Copy link

+1

@jplante
Copy link

jplante commented Jul 5, 2017

Required by us too

@mblomdahl
Copy link

@invisibleroads @jplante @princeofnaxos We had the same issue.. So I created a library to solve it (inspired by the Google Maps circle). Feel free contributing PRs if it's missing something. Should be sort-of production stable with this release; mblomdahl/mapbox-gl-circle#48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Data-driven styling
"Features" Backlog
Development

No branches or pull requests

5 participants