humangeo / leaflet-dvf

Leaflet Data Visualization Framework
MIT License
689 stars 153 forks source link

[dvf markers as Leaflet.markercluster's cluster] : Uncaught Error: Invalid LatLng object: (NaN, NaN) #114

Closed ghost closed 6 years ago

ghost commented 7 years ago

I'm trying to use the new markers (especially "PieChartMarker") provided with DFV as the "markerClusterGroup", and I'm getting this error:

leaflet.js:5 Uncaught Error: Invalid LatLng object: (NaN, NaN)
    at o.LatLng (leaflet.js:5)
    at e._recalculateBounds (leaflet.markercluster.js:6)

Is there something I can do to make it work ? Thanks for your help!

sfairgrieve commented 7 years ago

@lyDevops can you provide a little more info. as to your current setup? It could definitely be something with PieChartMarker, but it's hard to say offhand without a little more info.

tmeedend commented 7 years ago

Hi, I am a colleague of @lyDevops .

This problem happens when we add a PieChartMarker to a « L.markerClusterGroup ». This group is from the leaflet MarkerCluster plugin : https://github.com/Leaflet/Leaflet.markercluster

If we add our PieChartMarker to a classic L.featureGroup, this problem doesn't occur.

We are using leaflet-1.0.3, markercluster-1.0.3 and leaflet-dvf-0.3.1.

Thank you again.

tmeedend commented 6 years ago

Hello,

We can close this issue, the problem was that we were doing some divisions with zero.

Sorry for the inconvenience.

sfairgrieve commented 6 years ago

@tmeedend Great! Thanks for the heads up.