I’m trying to implement the PolyDraw tool on a plot that inlcudes Holoviews elements and a Geoviews tile source.
Starting with the example in the User Guide:
It works!
But as soon as I import Geoviews it does not work.
The code to reproduce is here.
import holoviews as hv
#import geoviews as gv
from holoviews import opts, streams
hv.extension('bokeh')
#gv.extension('bokeh')
print(hv.__version__)
#print(gv.__version__)
path = hv.Path([[(1, 5), (9, 5)]])
poly = hv.Polygons([[(2, 2), (5, 8), (8, 2)]])
path_stream = streams.PolyDraw(source=path, drag=True, show_vertices=True)
poly_stream = streams.PolyDraw(source=poly, drag=True, num_objects=4,
show_vertices=True, styles={
'fill_color': ['red', 'green', 'blue']
})
(path * poly).opts(
opts.Path(color='red', height=400, line_width=5, width=400),
opts.Polygons(fill_alpha=0.3, active_tools=['poly_draw']))
Ultimately I want to implement geoviews.tile_sources
to get a geographic map and then have holoviews.streams.PolyDraw
for users to draw polygons on the map. Have I done something wrong or have I discovered a bug?