-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
ENH: provide mapbox viewport coordinates in relayout data #4399
Comments
It could, but it would be a first. At the moment, we only include key-values of the attributes that changed during an interaction. I think I would prefer emitting |
|
For now though But perhaps we could add something that is clearly NOT an attribute? Like: |
Yes, this is the kind of thing I was thinking |
I'd be ok with adding something like |
Works for me! I'll open a PR shortly... |
I would like the mapbox subplot relayout data to include the
lon
/lat
of the viewport corners. This would make it possible to use a mapbox subplot to display an image layer that is dynamically generated for the current viewport.The relayout data currently includes
mapbox.center
,mapbox.zoom
,mapbox.bearing
, andmapbox.pitch
. I would like to propose that we include amapbox.coordinates
property that contains an array of the lon/lat coordinates of the four corners of the viewport.This would match the
coordinates
property that is expected inimage
layers. See https://docs.mapbox.com/mapbox-gl-js/example/image-on-a-map/.These points can be generated from the mapbox API by following the example in
mapbox/mapbox-gl-js#2375 (comment).
Question:
Could
coordinates
be something that is added only torelayout
data, or would it need to be a new figure property as well? The reason it's not clear to me that it should be a property is that it would be read-only. I don't think we could really support settingcoordinates
as a way to set where to place the viewport (at least in the case of non-zerobearing
andpitch
).The text was updated successfully, but these errors were encountered: