Add an option for using Image Coordinates x/y
ryanhausen opened this issue · 1 comments
Howdy,
I am interested in using supercluster in a project that uses x/y coordinates instead of lat/lng. I looked through the code and got it working by changing the code responsible for converting lat/lng to the [0,1] range. Specifically, the functions i had to edit were
Lines 69 to 81 in 60d13df
Lines 388 to 390 in 60d13df
Lines 391 to 395 in 60d13df
Lines 398 to 400 in 60d13df
Lines 401 to 404 in 60d13df
Would you be interested in incorporating this kind of functionality if I submit a PR?
My initial thoughts would be to move the [lat,lng][x,y] functions into the class so they can be overridden by the user, but the first code snippet would likely be more complex and take a flag passed to the constructor or the function call.
I don't do a lot of programming in javascript so I am not sure if any of this would be an anti pattern of some sort.
Thanks for making this!
I no longer need this functionality, so I am going to close this.