I’m looking for a working example of GeoJSPlot. Setting geojs=False in the code below creates a functional GMapPlot. If geojs=True, however, no error is returned, but the html page won’t display either. Any idea what the problem is, or where I can find a working example?
Sidenote: any idea why ResetTool() reverts to lat, lon = (0,0)?
···
from future import print_function
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Circle
from bokeh.models import (
GMapPlot, GeoJSPlot, Range1d, ColumnDataSource, LinearAxis,
PanTool, WheelZoomTool, BoxSelectTool, ResetTool,
BoxSelectionOverlay, GMapOptions, GeoJSOptions, GeoJSPlot,
NumeralTickFormatter, PrintfTickFormatter)
from bokeh.resources import INLINEgeojs = True
gmap_options = GMapOptions(lat=30.2861, lng=-97.7394, map_type=“roadmap”, zoom=13)
geojs_map_options = GeoJSOptions(lat=30.2861, lng=-97.7394, zoom=13)x_range = Range1d()
y_range = Range1d()if geojs:
plot = GeoJSPlot(
x_range=x_range, y_range=y_range,
map_options=geojs_map_options,
title = “Austin”)
else:
plot = GMapPlot(
x_range=x_range, y_range=y_range,
map_options=gmap_options,
title = “Austin”)source = ColumnDataSource(
data=dict(
lat=[30.2861, 30.2855, 30.2869],
lon=[-97.7394, -97.7390, -97.7405],
fill=[‘orange’, ‘blue’, ‘green’]
)
)circle = Circle(x=“lon”, y=“lat”, size=15, fill_color=“fill”, line_color=“black”)
plot.add_glyph(source, circle)plot.add_tools(PanTool(), WheelZoomTool(), ResetTool())
xaxis = LinearAxis(axis_label=“lat”, major_tick_in=0, formatter=NumeralTickFormatter(format=“0.000”))
plot.add_layout(xaxis, ‘below’)yaxis = LinearAxis(axis_label=“lon”, major_tick_in=0, formatter=PrintfTickFormatter(format=“%.3f”))
plot.add_layout(yaxis, ‘left’)doc = Document()
doc.add(plot)if name == “main”:
filename = “maps.html”
with open(filename, “w”) as f:
f.write(file_html(doc, INLINE, “Maps Example”))
print(“Wrote %s” % filename)
view(filename)
``