Search code examples
python-3.xgoogle-chromeinternet-explorer-11openstreetmapbokeh

bokeh openStreetMap tile not visible in all browsers


With the python bokeh (version 0.12.13) module i'm creating a .html with a line plotted on top of an openStreetMap tile (CARTODBPOSITRON):

from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
from bokeh.tile_providers import CARTODBPOSITRON
from bokeh.io import save,output_file

#the data
xList=[0.0, 111319, 222638, 333958, 445277, 556597, 667916, 779236, 890555]
yList=[6446275, 5012341, 3763310, 2632018, 4163881, 5465442, 6800125, 6621293, 6446275]
source=ColumnDataSource({'x':xList,'y':yList})

x_range=(min(xList),max(xList))
y_range=(min(yList),max(yList))
plot = figure(title='printed line on map',tools= "pan,wheel_zoom",x_range=x_range,y_range=y_range,width=1200, height=400)#create a figure
plot.add_tile(CARTODBPOSITRON)#add the CARTODBPOSITRON background tile

#plot a dot an a line
plot.line(source=source,x='x',y='y',line_color ='red')#line

#save to html file
output_file("file.html")
save(plot)

The .html looks fine in my Chrome browser, but the map does not appear in my IE browser. When i shared the file with two friends, one of them also could not see the map in her Chrome browser. I've checked and un-checked the Chrome parameter "2D hardware acceleration", cleared cookies and so on but haven't found the solution there.

Good (in my chrome browser, Version 66.0.3359.117 (Official Build) (32-bit), Windows 7, my friend her IE11):enter image description here

Bad (my IE11 (Version 11.0.9600.19002CO) browser, my friend her Chrome (also version 66.0.3359.117) browser):enter image description here

EDIT: For me it works in Chrome but not in IE11, for my friend it is opposite.

This is a screenshot of the Network log from my IE11 (where it doesn't work): enter image description here

This is a screenshot of the Network log from my friend's Chrome (where it doesn't work): enter image description here


Solution

  • I think you use not up-to-date Bokeh version, there is update https://github.com/bokeh/bokeh/pull/7264 which requests CARTO tiles properly and securely using HTTPS, not http as your screenshots suggest. There is autoforward to HTTPS, but it seems it does not work with all browsers. Just update your Bokeh - does it fix it?