繁体   English   中英

来自插件的dcjs.leaflet在Choropleth的弹出窗口不起作用

[英]dcjs.leaflet from addons The popup in Choropleth doesn't work

在dc.leaflet版本0.2.3中,对于Choropleth Chart,弹出窗口不起作用或者没有渲染。 我错了还是发生在其他人身上? 我很乐意解决这个问题,但我需要一些帮助。

  .renderPopup(true)
  .popup(function(d,feature) {
    return feature.properties.name+" : "+d.value;
  });

无论如何,任何帮助将非常感激

https://github.com/dc-js/dc.leaflet.js/issues/22

提前致谢

插件中的弹出窗口对我来说也不起作用。 但是,您可以将相同的逻辑应用于标准dc_leaflet.markerChart函数并实现弹出窗口。

以下是一个有效的示例用法:

  var marker = dc_leaflet.markerChart("#demo1 .map", groupname) //map formatting
      .dimension(restaurantNames)
      .group(restaurantsGroup)
      .width(700) //was 600
      .height(500)
      .center([43.733372, -79.354782]) //was 42.69,25.42
      .zoom(11) //was 7s
      .cluster(true) //was true
      .valueAccessor(function(kv) {
            return kv.value.count;
      })
      .locationAccessor(function(kv) {
            return [kv.value.latitude,kv.value.longitude]   ;
      })
      .popup(function(kv,marker) {
            return kv.value.name + " - " + kv.value.stars + " * - "  + 
            kv.value.price_range + "$";
      });

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM