Hi,
I was able to do more investigation, and I am afraid this is not something that will currently work. I had hoped to get you started with this quick example:
from bokeh.io import output_file, show
from bokeh.models import GMapPlot, Range1d, CustomJS, Button, VBox, GMapOptions
map_options = GMapOptions(lat=30.2861, lng=-97.7394, map_type="roadmap", zoom=13)
plot = GMapPlot(x_range=Range1d(), y_range=Range1d(), map_options=map_options)
button = Button()
button.callback = CustomJS(args=dict(plot=plot), code="""
plot.map_options['styles'] = ### JSON map style string goes here
""")
output_file("foo.html")
show(VBox(children=[button, plot]))
Unfortunately, it did not work, and after a little digging, I can see that the google map, and its options are only initialized once. Changing the map options does not have any effect later. I do think that changing map options later should be supported (and possibly even a show/hide functionality too). But it will rely on future work. I'd encourage you to submit a GH feature request, and reference this mailing list thread in the issue.
Sorry, I don't have better immediate news for you,
Bryan
···
On Jun 17, 2016, at 9:05 PM, Bryan Van de Ven <bryan@bokeh.org> wrote:
I was going to suggest a CustomJS callback to set GMapPlot.map_options in a way that makes everything invisible. That would probably be fairly straightforward. We can't just "turn off" the gmap completely as we rely on gmap to drive pan/zoom events.
Bryan
On Jun 17, 2016, at 9:03 PM, Sarah Bird - Continuum <sbird@continuum.io> wrote:
Thanks for your thoughts Arjuna. Feel free to open a feature request on bokeh's github.
But off the top of my head it seems unlikely that this would be something for bokeh core. This should be doable with either CustomJS a CustomModel or the bokeh server - or any combination of them
I'm not sure whether saving google's tile backgrounds would violate their API. But regardless this should be easy to implement as a CustomModel also.
Best,
Bird
On 6/17/16 6:35 AM, arjuna.scagnetto@gmail.com wrote:
I think it could be usefull to implement a tool to hide/unhide the google map background in a bokeh GMap object. Maybe some JS could do the job.
And maybe a way to save to PNG the background too, not only the glyphs.
extracted from stackoverflow question
python - Bokeh Gmap hide/unhide background - Stack Overflow
thanks
Arjuna
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/76f647ad-825b-4de5-b903-2ef8ba1f6b1a%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
--
Sarah Bird
Developer, Bokeh
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/71dc90db-78d1-2a51-47bf-9bf33c46f54e%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.