Bokeh Gmap hide/unhide background

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

thanks

Arjuna

Thanks for your
thoughts Arjuna. Feel free to open a feature request on bokeh’s github.

B ut off the top of my
head it seems unlikely
that this would be something for bokeh core. This s hould
be do able 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 th eir
API. But regardless this
should be easy to imple ment
as a CustomM odel
also.

Best,

Bird

···

On 6/17/16 6:35 AM,
wrote:

[email protected]

    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

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 [email protected].

  To post to this group, send email to [email protected].

  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?utm_medium=email&utm_source=footer)      .

For more options, visit .


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

http://stackoverflow.com/questions/37877825/bokeh-gmap-hide-unhide-background/37882336#37882336
https://groups.google.com/a/continuum.io/d/msgid/bokeh/76f647ad-825b-4de5-b903-2ef8ba1f6b1a%40continuum.io
https://groups.google.com/a/continuum.io/d/optout

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 <[email protected]> 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, [email protected] 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 [email protected].
To post to this group, send email to [email protected].
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 [email protected].
To post to this group, send email to [email protected].
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\.

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 <[email protected]> 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 <[email protected]> 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, [email protected] 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 [email protected].
To post to this group, send email to [email protected].
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 [email protected].
To post to this group, send email to [email protected].
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\.