dc-js / dc.leaflet.js

DC charts using Leaflet maps
Apache License 2.0
52 stars 24 forks source link

How to show popup of marker automatically? #29

Closed DienNM closed 7 years ago

DienNM commented 7 years ago

Hi,

I would like to show popup at markers after the map loaded without click action. Can I do it with dcjs?

Thanks, Dien

gordonwoodhull commented 7 years ago

Hi @DienNM, I attempted to research this for you but didn't find it - I'm not a big Leaflet expert yet.

You should be able to do it using a combination of the chart's postRender event and some leaflet methods (but I couldn't figure out the right leaflet methods).

E.g.

markerChart.on('postRender', function(chart) {
  chart.map().somethingOrAnother(); // invoke methods on the underlying Leaflet object
});

The issue tracker is for reporting bugs and making enhancement requests, not for general support questions. I'd suggest asking on Stack Overflow with the leaflet and dc.leaflet.js tags. Or if you search SO, it's likely that someone has already asked this about Leaflet, and it shouldn't be much different for dc.leaflet.js.

I'm closing this, but please feel free to comment if you think something needs to be added to dc.leaflet.js to support this. Thanks!