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

KML - problem with custom marker position #282

Open
maaaca opened this issue Feb 27, 2019 · 2 comments
Open

KML - problem with custom marker position #282

maaaca opened this issue Feb 27, 2019 · 2 comments

Comments

@maaaca
Copy link

maaaca commented Feb 27, 2019

Hi, I have KML file with declared custom icons with <style> inside the file, like this:

	<Style id="IconCrossroad">
      <IconStyle>
      	<scale>1.5</scale> 
        <Icon>
        	<href>../leaflet/images/icon-crossroad.png</href>
        </Icon>
        <hotSpot x="0.5" y="1" xunits="fraction" yunits="fraction"/> 
      </IconStyle>
   </Style>

Icons are loaded into map succesfully, but the marker position is bad. I can't set the offset of icons - hotSpot does not work.

image

@UnsterblichMedic
Copy link

I have been having similar issue #281 . When you inspect the html in a browser, I noticed my margin-left and margin-top were off, then change after I refreshed which placed them correctly. Maybe different than your issue but it sure looks similar.

@maaaca
Copy link
Author

maaaca commented Mar 3, 2019

OK, currently I set offset in pixels:

  <Style id="IconCrossroad">
      <IconStyle>
      	<scale>1</scale> 
        <Icon>
        	<href>../leaflet/images/icon-crossroad.png</href>
        </Icon>
        <hotSpot x="17" y="-44" xunits="pixels" yunits="pixels"/> 
      </IconStyle>
   </Style>

After first page load looks everything fine:

image

But after page refresh (or second page visit) are some icon group are moved again y-pixels offset:

image

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

No branches or pull requests

2 participants