-
Notifications
You must be signed in to change notification settings - Fork 203
remove 'getLatLng' property from PointSymbolizer - references #148 #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Leaflet#148 Point Symbolizer instances inherit from marker or circlemarker, but they lack latlng information, and on mouseover or click, leaflet will error on these features if it find the getLatLng method, since that indicates it should be treated as a real marker instance, but even though the method is there, the value isnt, so leaflet produces an error. Maybe these instance should have a latlng, I don't know, this was just an easy fix so that I could continue to use vectorgrid protobuf support with points and have mouseover and click events work
|
My gut feeling is that there should be a latlng. |
|
I fully agree, but I read through all the source code, and for the life of me, could not figure out how to add that. As I said, I definitely don't know if this is the right answer, but also wasn't getting any traction in the issues section, so I tried to put forth some good faith effort here- |
|
Absolutely - I have the same position with a different issue/PR. I just meant that this is probably fine for your fork, but that we need LatLng fixed here. Not trying to belittle your work one bit. |
|
Dredging this back up again because of requests in #148 that this be merged, here's an attempt at understanding this better:
If this summary is correct, we need the conversion method, and we need to reimplement Is that right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi and really sorry for taking forever to review this. As you might have guessed, no one is really maintaining Leaflet Vector Grid at the moment, and unfortunately at least for me I probably will not do it in any foreseeable future either. If you feel up to it, or know someone who would, feel free to notify me or some other maintainer and lets see what we can do.
Anyway, I think this looks like an ok fix, so I am fine with merging this except for some intrusive changes in this PR, unrelated to the actual fix. If you can find the time to adress that, I will merge it!
|
@perliedman ok, I'll make those changes- |
|
Hello @chriszrc, any news on this? Thanks! |
|
@perliedman Ok, I think I backed out the changes to dist and whitespace, let me know if there's anything else I can do to get this change merged- |
|
@chriszrc nice! It still looks like the |
|
Ok, I'm looking at this page now: https://github.com/Leaflet/Leaflet.VectorGrid/pull/157/files And it seems like maybe I got everything this time- |
|
Nice! Thanks for all the fixes, great! |
|
Any chance to publish a new version on npm with this fix? Thanks! |
|
Hi, i came across the mentioned bug recently, and tried to fixed it by replacing leaflet.vectorgrid in package.json with @chriszrc fork, then i tried to run yarn install inside node_modules/leaflet.vectorgrid since i noticed that dist folder is missing, however i was unable to make it work because of errors in runas build (runas is one of dependencies)....Does anyone have similiar experience or can at least point me in right direction plz ? Im on linux btw some lines from error message that could be of some use :
|
The error is visible on the official vectorgrid demo pages:
http://leaflet.github.io/Leaflet.VectorGrid/demo-points-icons.html
Just open the console and mouse over any of the markers. The error precludes any mouseover or click events on point features.
My Diagnosis:
Point Symbolizer instances inherit from marker or circlemarker, but they lack latlng information, and on mouseover or click, leaflet will error on these features if it finds the getLatLng method, since that indicates it should be treated as a real marker instance, but even though the method is there, the value isn't, so leaflet produces an error.
Maybe these instance should have a latlng, I don't know, this was just an easy fix so that I could continue to use vectorgrid protobuf support with points and have mouseover and click events work.