Skip to content

Conversation

@chriszrc
Copy link
Contributor

@chriszrc chriszrc commented Apr 4, 2018

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.

chriszrc added 2 commits April 4, 2018 16:07
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
@tomchadwin
Copy link
Collaborator

My gut feeling is that there should be a latlng.

@chriszrc
Copy link
Contributor Author

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-

@tomchadwin
Copy link
Collaborator

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.

@tomchadwin
Copy link
Collaborator

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 CircleMarker.getLatLng() to use that new method.

Is that right?

Copy link
Member

@perliedman perliedman left a 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!

@chriszrc
Copy link
Contributor Author

chriszrc commented Jan 2, 2019

@perliedman ok, I'll make those changes-

@bagage
Copy link

bagage commented Jan 27, 2019

Hello @chriszrc, any news on this? Thanks!

@chriszrc
Copy link
Contributor Author

@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-

@perliedman
Copy link
Member

@chriszrc nice! It still looks like the dist/ files are part of the PR, though - they all show up under "Files changed". Also, looks like some unrelated changes to package-lock.json snuck in there, just get rid of that changes as well, and I think we are good to go!

@chriszrc
Copy link
Contributor Author

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-

@perliedman perliedman merged commit e9b1319 into Leaflet:master Feb 26, 2019
@perliedman
Copy link
Member

Nice! Thanks for all the fixes, great!

@bagage
Copy link

bagage commented Feb 26, 2019

Any chance to publish a new version on npm with this fix? Thanks!

@m311ow
Copy link

m311ow commented Mar 13, 2019

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 :

  • .../node_modules/leaflet.vectorgrid/node_modules/runas: Command failed.
  • runas.target.mk:103: recipe for target 'Release/obj.target/runas/src/main.o' failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants