Skip to content
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

Incorrect marker position #281

Open
UnsterblichMedic opened this issue Feb 21, 2019 · 5 comments
Open

Incorrect marker position #281

UnsterblichMedic opened this issue Feb 21, 2019 · 5 comments
Labels

Comments

@UnsterblichMedic
Copy link

Loads KML file. The polygon lines are all in the correct positions. The Placemarks all load but are just slightly off from the coordinates. In Google Earth they are exactly right. On Leaflet though, all of them are off by the same amount (up and to the left slightly). I am running Leaflet 1.4.0. Is this the reason why? Do I need to downgrade my Leaflet to 1.0.x or lower?

@brunob
Copy link
Collaborator

brunob commented Feb 22, 2019

In order to help you, you should provide provide : a link to an online demo + the problematic kml file ?

@UnsterblichMedic
Copy link
Author

Ok. Sorry I am new to this. I am working on it. A lot of code I am trying to figure out how to add it to JSFiddle without adding ALL of it.

@UnsterblichMedic
Copy link
Author

Here is the kml file. Upon inspection, it seems the push pins have a margin-top: 3px; margin-left: -20px on initial load. Upon reload, they get margin-top: -61px; margin-left: -20px and stays at that. The other symbols don't seem to have this.

REACH 1 Google Earth.zip

@UnsterblichMedic
Copy link
Author

I apologize. I have my files mixed up. The problem is with changes I made to the KML.js. I was using changes from #197 . It is rescaling the icons by "this.style.width = Math.ceil(i.width * scale) + 'px';" and it is messing it up. Sorry, still learning all of this.

@UnsterblichMedic
Copy link
Author

Ok, still having the issue with the original KML.js file. After I refresh a couple times the placemarks go to the correct location. Again, it seems to have to do with the margin-left and margin-top. Those are what change after I refresh a couple times. Goes from -10px and 32px (incorrect) to -10px and -32px (correct). I don't know how to add the KML file to jsfiddle, but if you can, this code should work.

https://jsfiddle.net/UnsterblichMedic/f572mc1w/18/

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

No branches or pull requests

2 participants