Google Maps: coordinates are displayed without map

Does anybody has any idea what should I do to get a bokeh Google Maps plot with underlying maps displayed? Now only my coordinates are displayed (I can scroll and hover tooltips are also displayed). I use a Google API key with activated Google Maps JavaScript API, but on the Dashboard in Google Cloud Platform, I can’t see any queries related to this API (and no other queries at the time when I generated my plot or use its result). At first run the browser (Firefox and Chrome) said that there is a problem described in the javascript console. And here I saw that I have to activate the above API. I did it and now I don’t get any error message, but no maps are displayed… :frowning:

For my code I used the official example. I use bokeh v0.12.3

Thank you!

It's unclear from your description: did you set the value of the.api_key property on the GMapPlot to be the key that you activated?

Thanks,

Bryan

···

On Oct 26, 2016, at 10:20 AM, [email protected] wrote:

Does anybody has any idea what should I do to get a bokeh Google Maps plot with underlying maps displayed? Now only my coordinates are displayed (I can scroll and hover tooltips are also displayed). I use a Google API key with activated Google Maps JavaScript API, but on the Dashboard in Google Cloud Platform, I can't see any queries related to this API (and no other queries at the time when I generated my plot or use its result). At first run the browser (Firefox and Chrome) said that there is a problem described in the javascript console. And here I saw that I have to activate the above API. I did it and now I don't get any error message, but no maps are displayed... :frowning:

For my code I used the official example. I use bokeh v0.12.3

Thank you!

--
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/aeb6930e-5af0-4a6c-b9d5-5dcee965089c%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Thank you for your reply.

I studied the official example and based on it I wrote my own code. Of course I replaced API_KEY = "XXXXXXXXXXX" with my own API key. And the background of my plot is grey. My Google API key can be used perfectly eg. at Google Maps Distance Matrix API.

Here is my code (without data):

import bokeh.io as bio
import bokeh.models as bmdl

API_KEY = ‘xxxx’

map_options = bmdl.GMapOptions(lat=df.loc[0, ‘lat’], lng=df.loc[0, ‘lon’], map_type=‘roadmap’, zoom=12)

plot = bmdl.GMapPlot(x_range=bmdl.DataRange1d(), y_range=bmdl.DataRange1d(), map_options=map_options,
api_key=API_KEY, plot_width=1200, plot_height=600)

plot.title.text = ‘Title of my diagram’
plot.title.align = ‘center’
plot.title.text_font_size = ‘16pt’

source = bmdl.ColumnDataSource(data={‘lat’:df[‘lat’], ‘lon’:df[‘lon’], ‘datetime’:df[‘str_datetime’]})

circle = bmdl.Circle(x=‘lon’, y=‘lat’, size=10, fill_color=‘green’, fill_alpha=0.7, line_color=None)

plot.add_glyph(source, circle)

plot.add_tools(bmdl.PanTool(), bmdl.WheelZoomTool(), bmdl.BoxSelectTool(), bmdl.HoverTool(tooltips=[(‘Date’, ‘@datetime’)]))

bio.show(plot)

``

  1. október 26., szerda 17:27:53 UTC+2 időpontban Bryan Van de ven a következőt írta:
···

It’s unclear from your description: did you set the value of the.api_key property on the GMapPlot to be the key that you activated?

Thanks,

Bryan

On Oct 26, 2016, at 10:20 AM, [email protected] wrote:

Does anybody has any idea what should I do to get a bokeh Google Maps plot with underlying maps displayed? Now only my coordinates are displayed (I can scroll and hover tooltips are also displayed). I use a Google API key with activated Google Maps JavaScript API, but on the Dashboard in Google Cloud Platform, I can’t see any queries related to this API (and no other queries at the time when I generated my plot or use its result). At first run the browser (Firefox and Chrome) said that there is a problem described in the javascript console. And here I saw that I have to activate the above API. I did it and now I don’t get any error message, but no maps are displayed… :frowning:

For my code I used the official example. I use bokeh v0.12.3

Thank you!


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/aeb6930e-5af0-4a6c-b9d5-5dcee965089c%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hmm, I found the solution. If anybody can find the difference between the not working and (the below) working versions, then he/she could explain the behavior…

import bokeh.io as bio
import bokeh.models as bmdl

API_KEY = ‘xxxx’

map_options = bmdl.GMapOptions(lat=df.loc[0, ‘lat’], lng=df.loc[0, ‘lon’], map_type=‘roadmap’, zoom=13)

plot = bmdl.GMapPlot(x_range=bmdl.DataRange1d(), y_range=bmdl.DataRange1d(), map_options=map_options,
api_key=API_KEY, plot_width=1200, plot_height=600)

plot.title.text = ‘Title of my diagram’
plot.title.align = ‘center’
plot.title.text_font_size = ‘16pt’

source = bmdl.ColumnDataSource(data={‘lat’:df[‘lat’], ‘lon’:df[‘lon’], ‘datetime’:df[‘str_datetime’]})

circle = bmdl.Circle(x=‘lon’, y=‘lat’, size=10, fill_color=‘green’, fill_alpha=0.7, line_color=None)

plot.add_glyph(source, circle)

plot.add_tools(bmdl.PanTool(), bmdl.WheelZoomTool(), bmdl.BoxSelectTool(), bmdl.HoverTool(tooltips=[(‘Date’, ‘@datetime’)]))

bio.show(plot)

``

  1. október 26., szerda 17:20:41 UTC+2 időpontban [email protected] a következőt írta:
···

Does anybody has any idea what should I do to get a bokeh Google Maps plot with underlying maps displayed? Now only my coordinates are displayed (I can scroll and hover tooltips are also displayed). I use a Google API key with activated Google Maps JavaScript API, but on the Dashboard in Google Cloud Platform, I can’t see any queries related to this API (and no other queries at the time when I generated my plot or use its result). At first run the browser (Firefox and Chrome) said that there is a problem described in the javascript console. And here I saw that I have to activate the above API. I did it and now I don’t get any error message, but no maps are displayed… :frowning:

For my code I used the official example. I use bokeh v0.12.3

Thank you!

It's hard to compare files across posts, can you provide a diff or summarize what you changed to get it working?

Thanks,

Bryan

···

On Oct 27, 2016, at 10:21 AM, [email protected] wrote:

Hmm, I found the solution. If anybody can find the difference between the not working and (the below) working versions, then he/she could explain the behavior...

import bokeh.io as bio
import bokeh.models as bmdl

API_KEY = 'xxxx'

map_options = bmdl.GMapOptions(lat=df.loc[0, 'lat'], lng=df.loc[0, 'lon'], map_type='roadmap', zoom=13)

plot = bmdl.GMapPlot(x_range=bmdl.DataRange1d(), y_range=bmdl.DataRange1d(), map_options=map_options,
    api_key=API_KEY, plot_width=1200, plot_height=600)

plot.title.text = 'Title of my diagram'
plot.title.align = 'center'
plot.title.text_font_size = '16pt'

source = bmdl.ColumnDataSource(data={'lat':df['lat'], 'lon':df['lon'], 'datetime':df['str_datetime']})

circle = bmdl.Circle(x='lon', y='lat', size=10, fill_color='green', fill_alpha=0.7, line_color=None)

plot.add_glyph(source, circle)

plot.add_tools(bmdl.PanTool(), bmdl.WheelZoomTool(), bmdl.BoxSelectTool(), bmdl.HoverTool(tooltips=[('Date', '@datetime')]))

bio.show(plot)

2016. október 26., szerda 17:20:41 UTC+2 időpontban rag...@gmail.com a következőt írta:
Does anybody has any idea what should I do to get a bokeh Google Maps plot with underlying maps displayed? Now only my coordinates are displayed (I can scroll and hover tooltips are also displayed). I use a Google API key with activated Google Maps JavaScript API, but on the Dashboard in Google Cloud Platform, I can't see any queries related to this API (and no other queries at the time when I generated my plot or use its result). At first run the browser (Firefox and Chrome) said that there is a problem described in the javascript console. And here I saw that I have to activate the above API. I did it and now I don't get any error message, but no maps are displayed... :frowning:

For my code I used the official example. I use bokeh v0.12.3

Thank you!

--
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/47088766-c373-4678-a4cf-c66d41e1097b%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Yes, and thank you for the interest. The only difference is in the zoom property of GMapOptions. My code does not work if zoom=12, but it works with …11, 13…
Very strange…

  1. október 26., szerda 17:20:41 UTC+2 időpontban [email protected] a következőt írta:
···

Does anybody has any idea what should I do to get a bokeh Google Maps plot with underlying maps displayed? Now only my coordinates are displayed (I can scroll and hover tooltips are also displayed). I use a Google API key with activated Google Maps JavaScript API, but on the Dashboard in Google Cloud Platform, I can’t see any queries related to this API (and no other queries at the time when I generated my plot or use its result). At first run the browser (Firefox and Chrome) said that there is a problem described in the javascript console. And here I saw that I have to activate the above API. I did it and now I don’t get any error message, but no maps are displayed… :frowning:

For my code I used the official example. I use bokeh v0.12.3

Thank you!

And (of course) the same behavior occurs with the official example.

  1. október 26., szerda 17:20:41 UTC+2 időpontban [email protected] a következőt írta:
···

Does anybody has any idea what should I do to get a bokeh Google Maps plot with underlying maps displayed? Now only my coordinates are displayed (I can scroll and hover tooltips are also displayed). I use a Google API key with activated Google Maps JavaScript API, but on the Dashboard in Google Cloud Platform, I can’t see any queries related to this API (and no other queries at the time when I generated my plot or use its result). At first run the browser (Firefox and Chrome) said that there is a problem described in the javascript console. And here I saw that I have to activate the above API. I did it and now I don’t get any error message, but no maps are displayed… :frowning:

For my code I used the official example. I use bokeh v0.12.3

Thank you!

I'm currently working on docs automation. Getting a real key into that example (without having it visible on the page) is on my TODO list. It's just a big list...

I'm not sure about the "not working with zoom=12" case, we pass that zoom level on directly to the Google Maps API, I'm not sure what could be done differently.

Thanks,

Bryan

···

On Oct 27, 2016, at 11:11 AM, [email protected] wrote:

And (of course) the same behavior occurs with the official example.

2016. október 26., szerda 17:20:41 UTC+2 időpontban rag...@gmail.com a következőt írta:
Does anybody has any idea what should I do to get a bokeh Google Maps plot with underlying maps displayed? Now only my coordinates are displayed (I can scroll and hover tooltips are also displayed). I use a Google API key with activated Google Maps JavaScript API, but on the Dashboard in Google Cloud Platform, I can't see any queries related to this API (and no other queries at the time when I generated my plot or use its result). At first run the browser (Firefox and Chrome) said that there is a problem described in the javascript console. And here I saw that I have to activate the above API. I did it and now I don't get any error message, but no maps are displayed... :frowning:

For my code I used the official example. I use bokeh v0.12.3

Thank you!

--
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/c4f32178-818e-4c2a-b61b-91e5c801d2a6%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.