leaflet-plugins icon indicating copy to clipboard operation
leaflet-plugins copied to clipboard

KML - problem with custom marker position

Open maaaca opened this issue 6 years ago • 2 comments

Hi, I have KML file with declared custom icons with

	<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

maaaca avatar Feb 27 '19 10:02 maaaca

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.

UnsterblichMedic avatar Mar 01 '19 20:03 UnsterblichMedic

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

maaaca avatar Mar 03 '19 20:03 maaaca