过滤器全部();不使用传单地图

filterAll(); not working with leaflet map

我尝试在点击标记后使用以下方法重置传单地图(恢复到其原始视图):

<h5>Location <a class="reset" href="javascript:mapLocation.filterAll(); dc.redrawAll();">reset</a></h5>

其中 mapLocation 是我的传单地图变量。我同时使用 dc.leaflet.js 到 link 地图和数据 table。我正在从传单地图中驱动 datatable 内容。因此,当重置地图时,所有项目都应再次显示在 table 中。

起始视图:

点击气泡 #4 后的地图:

然后点击重置不会return它回到原来的视图。

这里是 reset 的类似用法,但有同样的问题: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,这是最好的方法吗?

我最终使用了:

<h5>Location <a class="reset" href="javascript:location.reload();">reset</a></h5>

重新加载整个页面。

或者这也有效,将 var mapLocation 与 window.mapLocation

交换
 window.mapLocation = dc.leafletMarkerChart("#location", groupname)