Hello.
I have a dynamic map like this containing points from Pandas dataframe (with tooltips for point information), which comes from code like below
url = 'http://a.basemaps.cartocdn.com/rastertiles/voyager/{Z}/{X}/{Y}.png'
attribution = "Tiles by Carto, under CC BY 3.0. Data by OSM, under ODbL"
China = x_range,y_range = ((7827151.696402039,14636773.672271816), (7377090.428741338,2093763.0722344585))
p = figure(tools='pan, wheel_zoom', x_range=x_range, y_range=y_range,
x_axis_type="mercator", y_axis_type="mercator")
p.add_tile(WMTSTileSource(url=url, attribution=attribution))
hover =HoverTool()
hover.tooltips = [
('', '@{Period Label}'),
('Start Date', '@Inception'),
('Capital', '@{Capital Label}'),
('Capital Coordinates', '@{Capital Coordinates}'),
]
p.tools.append(hover)
@Longitude and @Latitude for hover.tooltips
p.circle(x='Capital Mercator X', y='Capital Mercator Y', fill_color='red', size=10, source=df)
show(p)
I have another dynamic map containing a georeferrenced raster image (tif) on top of a Open Street Map basemap (with tooltips for coordinates), which comes from a simplified code like below (unfortunately new users can not post two images at a time…so I omit the image here):
hv_tiles_osm = hv.element.tiles.OSM()
dataarray_mercator = rxr.open_rasterio('abc.tif').rio.reproject('EPSG:3857')
dataarray_mercator
hv_dataset_mercator = hv.Dataset(dataarray_mercator[0], vdims=value_dimension, kdims=key_dimensions)
hv_image_mercator = hv.Image(hv_dataset_mercator)
hv_image_custom_hover = hv.Image(hv_dataset_mercator).opts(tools=[custom_hover])
hv.extension('bokeh', logo=False)
hv_dyn_scaled = hd.regrid(hv_image_custom_hover).opts(clim=(min_val, max_val))
hv_combined_scaled = hv_tiles_osm * hv_dyn_scaled
hv_combined_scaled
Provided, I only need point coordinates (and tooltips info) from the first map and plot them on top of the second dynamic map (i.e. raster image and basemap). How can I overlay the two dynamic maps? It would be ideal if I can easily change which basemap to be used, but it is only nice-to-have. Thanks!