gmaps icon indicating copy to clipboard operation
gmaps copied to clipboard

how to set center/zoom-level for already instantiated gmaps.Figure object?

Open tianfudhe opened this issue 8 years ago • 1 comments

how to set center/zoom-level later, when gmaps.Figure is already created? It seems, your document provides only the way to set these properties on instantiation of gmaps.

would it be great to expose all commonly-used interfaces that google-map-api has?

tianfudhe avatar Jul 11 '17 02:07 tianfudhe

Thanks very much for submitting this!

Being able to set the zoom and centre after the map is instantiated is definitely on the roadmap. There's complexity around being able to both get and set those values, though.

For instance, any solution should make the following work:

fig = gmaps.figure()
# move the map manually
print(fig.center) # => should print the current centre
fig.center = (5.0, -10.0) # => should update the map centre

Anyone wanting to tackle this should look into how other widget libraries (e.g. ipywidgets) deals with this two-way binding.

would it be great to expose all commonly-used interfaces that google-map-api has?

Yes, obviously. The main limitation is developer-time.

PRs welcome, obviously!

pbugnion avatar Jul 11 '17 05:07 pbugnion