Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

LeafletMarkerChart hangs when popup moves chart 2 times #26

Open
gordonwoodhull opened this issue Jan 17, 2017 · 2 comments
Open

LeafletMarkerChart hangs when popup moves chart 2 times #26

gordonwoodhull opened this issue Jan 17, 2017 · 2 comments

Comments

@gordonwoodhull
Copy link

gordonwoodhull commented Jan 17, 2017

From @thebarbarian on January 17, 2017 8:7

I am not sure if it's a bug or my terrible JS-coding, please remove this if i messed up.

When displaying a LeafletMarkerChart and clicking a marker on the edge of the map, the creation of the textballoon will move the map slighly until it fits inside the frame. If i do this two times, i'm unable to drag the map. It's stuck.
The console gave me the following error after the map is stuck and i click a marker:

_markerList.indexOf is not a function(…)

After changing line 583 of dc-leaflet.js :

(_markerList.indexOf(_chart.filter()) !== -1 &&

into this:

(_markerList.toString().indexOf(_chart.filter()) !== -1 &&

the problem is solved. Adding the toString()-method doesn't seem to affect any of the other graphs on my dashboard.

My apologies if this isn't a bug, but it seemed to make sense to let the developers know.

Copied from original issue: dc-js/dc.js#1263

@gordonwoodhull
Copy link
Author

Thanks @thebarbarian for the report!

I wouldn't be surprised if there is a bug here, but that solution is kind of odd because _markerList is an array, so it should be searched using Array.indexOf not String.indexOf.

I think it should still work if your keys are not of type string, but maybe there is some odd case here.

If you can create a fiddle demonstrating the problem, that would be helpful.

@thebarbarian
Copy link

Hi Gordon,
The keys are Strings indeed.
I'll make a fiddle soon, but it takes some time because I need to change some data (i work in healthcare.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants