SINTEF-9012 / PruneCluster

Fast and realtime marker clustering for Leaflet
MIT License
552 stars 131 forks source link

Possible to use X/Y point coordinates instead of LatLng? #187

Closed GosuSan closed 4 years ago

GosuSan commented 4 years ago

Hey there, I'm currently building a map with leaflet that is not representing a place on earth, but a video-game map. I had to create my own CRS based on leaflets CRS.Simple, which doesn't use projection but simply X/Y coordinates to display markers. Is there a way to use PruneCluster with this coordinate system instead of LatLng? Whenever I try to create markers I get no errors but the markers don't appear and have a pos attribute with an LatLng(NaN, NaN) object. I tried to figure out what I'm missing, but my JS skills are minimal. Since the (generated?) JS code is not documented, I have no clue what most of it does, wich makes it hard to find a solution.

Is that even possible as of now? If no, where would I start in the code if I wanted to try to add that feature?

Thanks in advance.

GosuSan commented 4 years ago

I think I figured it out ... after several days of trying and finally opening this issue I now realized that I still had the coordinates in a list, like for the vanilla markers. It seems PruneCluster doesn't even really care about the CRS, I just didn't read the examples careful enough. After passing the coordinates directly, like I'm supposed to, everything seems to work fine. Sorry for the inconvenience, closed.