I'm using this code to make a interactive map on python:
# Define the callback: update_plot
def update_plot(attr, old, new):
# Create a dropdown Select widget for the y data: y_select
N = str(select.value)
map_options = GMapOptions(lat=sites_list_c.loc[sites_list_c['Site Name'] == N,'Latitude Decimal'], lng=sites_list_c.loc[sites_list_c['Site Name'] == N,'Lontitude Decimal'], map_type="roadmap", zoom=4)
plot = gmap(my_key, map_options, title="Test")
source = ColumnDataSource(
data=dict( lat=sites_list_c['Latitude Decimal'].tolist(),
lon=sites_list_c['Longitude Decimal'].tolist()
)
)
plot.circle(x="lon", y="lat", size=15, fill_color='blue', fill_alpha=0.8, source=source)
# Attach the update_plot callback to the 'value' property of y_select
select.on_change('value', update_plot)
# Create layout and add to current document
layout = row(widgetbox(select), plot)
curdoc().add_root(layout)
show(layout)
But, I'm getting this warning:
WARNING:bokeh.embed.util:
You are generating standalone HTML/JS output, but trying to use real Python
callbacks (i.e. with on_change or on_event). This combination cannot work.
Only JavaScript callbacks may be used with standalone output. For more
information on JavaScript callbacks with Bokeh, see:
http://docs.bokeh.org/en/latest/docs/user_guide/interaction/callbacks.html
Alternatively, to use real Python callbacks, a Bokeh server application may
be used. For more information on building and running Bokeh applications, see:
http://docs.bokeh.org/en/latest/docs/user_guide/server.html