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).
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'
}
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.
+1
Required by us too
@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
Most helpful comment
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
unitsproperty along the lines of