在地理视图图块上叠加点

问题描述

我正在尝试制作一个面板仪表板,其中包含来自 geoviews 的平铺地图和覆盖在顶部的一些数据。还有一些小部件可用于过滤数据子集,然后在地图上更新。

问题是,偶尔只有一个数据点需要覆盖在地图上。当回调函数使用 * 运算符将单个点叠加到图块上时,渲染图为空白并一直向下缩放。如果我用鼠标滚轮缩小 30 秒,有时我可以让磁贴再次显示(使用单个数据点)。

这里是回调函数定义:

def map_points(data):        
    if not data.empty:        
        map_points = gv.Dataset(data,kdims=['foo1','foo2','foo3'])
        points = map_points.to(gv.Points,['Longitude','Latitude'],['foo1','foo2'])
        return points
    return gts.OSM.opts(width=1000,height=750)

def map_points_callback(target,event):
    target.object = set_tile_source(basemap_selector.value) * map_points(event.new).opts(opts.Points(width=1000,height=750,tools=['hover']))

带有单个数据点的空白地图:

Blank map with the single data point

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)