dc-js / dc.leaflet.js

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

Second render does not reinitialize Leaflet #15

Open gordonwoodhull opened 8 years ago

gordonwoodhull commented 8 years ago

Originally the code attempted to apply Leaflet twice to the div, resulting in the error

map container is already initialized

14 fixes the error - are there circumstances where we do need to completely reinitialize Leaflet? In dc.js this is usually a punt where there is code that can't gracefully transform/transition from one kind of data to another.

aubbi commented 5 years ago

Hello, has this being fixed??

gordonwoodhull commented 5 years ago

Hi @aubbi.

Sorry, I think right now you would have to delete the contents of the div and initialize a new dc.leaflet instance into it.

That's pretty much how render would be properly implemented so I don't think you'll notice any performance loss.

aubbi commented 5 years ago

Hey @gordonwoodhull , I keep getting this error, "map container is already initialized", found this link but after updating my dc.leaflet.js I get another error saying "dc.leafletMarkerChart is not a function" I tried many version of leaflet.markercluster.js. however it works fine without trying to update the map with new data.