在单击一个标记后,我正在尝试重置小叶贴图(恢复到其原始视图),方法是:
<h5>Location <a class="reset" href="javascript:mapLocation.filterAll(); dc.redrawAll();">reset</a></h5>其中mapLocation是我的叶子映射变量。我正在使用dc.leaflet.js将地图和数据表链接在一起。我将从leaflet映射中驱动datatable内容。因此,当地图被重置时,所有的项目都应该再次显示在表中。
起始视图:

单击气泡#4后的贴图:

然后,单击reset不会将其返回到其原始视图。
下面是reset with的类似用法,有相同的问题:http://bl.ocks.org/Mbrownshoes/679a255540eb11d16704c44d88314075
这是我的code
刚刚修改了我的代码:
<h5>Location <a class="reset" href="javascript:mapLocation.filterAll(); redrawAll();">reset</a></h5>要这样做:
<h5>Location <a class="reset" href="javascript:location.reload();">reset</a></h5>这确实会刷新页面,这样会重置dc.filter,这是最好的方法吗?
发布于 2017-03-11 07:12:30
我最终使用了:
<h5>Location <a class="reset" href="javascript:location.reload();">reset</a></h5>若要重新加载整个页面,请使用。
或者,这也行得通,用window.mapLocation替换了var mapLocation
window.mapLocation = dc.leafletMarkerChart("#location", groupname)https://stackoverflow.com/questions/42307094
复制相似问题