I created the dashboard with a map in it using GMapPlot. It loads okay first time but when I update sliders or other widgets it doesn’t load the map properly.
I am basically following stock_app_simple.py example and replaced the scatter plot with GmapPlot.
I am using lastest Bokeh.
I could use basemap but GMapPlot seems very handy and it shows all the street names and I want to show the path on the map for example.
Can you provide a minimal runnable example that demonstrates the issue? Absolutely nothing goes further towards helping diagnose problems quickly than a minimal runnable example.
I created the dashboard with a map in it using GMapPlot. It loads okay first time but when I update sliders or other widgets it doesn't load the map properly.
I am basically following stock_app_simple.py example and replaced the scatter plot with GmapPlot.
I am using lastest Bokeh.
I could use basemap but GMapPlot seems very handy and it shows all the street names and I want to show the path on the map for example.
One note first: In your example you didn’t specify any event handler associated to the widgets you’ve defined. This fires the entire app (Plots and Widgets) recreation everytime. Honestly I’m a bit surprised simpleapp implements this behaviour by default and I’m -1 about this. I’ll probably open an issue to consider improving this on the efforts that are in act to improve bokeh-server.
I’ve downloaded your script and was able to reproduce the issue. Honestly I’m not sure why this is happening… But just for the sake of more clarity on identifying the app flow I’ve just defined an extra function to layout the simple app and defined an event handler to handle the specific slider updates. With that I’m just updating the map plot without recreating everything else. This seems to solve the issue for me locally. Can you check if the attached script works for you too?
Also, as an advice I suggest to break the code and the components creation into smaller functions as I’ve seen that the simpleapp workflow can easily fall into quite long functions (with considerable long boilerplate code) that end up being hard to easily work with when debugging/modifying.
Thank you so much for your quick response and great solution. It works very well on my end. I knew there was a missing function for the slider update but I didn’t know how to add it or implement as I am new to Bokeh and didn’t know where to look at for detailed information for such things. Hope there are more complete examples and more detailed information for advanced users who want to create fairly complex dashboard.
The method you have suggested works better and it is more robust as it renders the map correctly most of time but not always and it gets worse (meaning map doesn’t render properly) when I try to ingest csv data within the create_map function and plot the scatter points on top of the map.
The map should be a background info as I am not changing map location and it could be static but points I am plotting on top of the map should be dynamic.
Is there way for me to load the map more robustly? I would like to cache the map info and use it over and over for plotting some location marks dynamically.
Again I want to thank you for your help in advance.