Custom maps Placemarks

8 views
Skip to first unread message

Juha

unread,
Apr 13, 2024, 4:33:54 PMApr 13
to Custom Maps users
Hello, How I can use placemarks?
If I put this to kml file, then app crash.
<Placemark>
  <name>Test</name>
  <Point>
    <coordinates>20.1,64.0</coordinates>
  </Point>
</Placemark>


Marko Teittinen

unread,
Apr 16, 2024, 1:47:34 AMApr 16
to Juha, Custom Maps users
Placemark support in Custom Maps is not complete. To use placemarks, you need to always specify the icon style.

Icon style should be defined something like this:
<Style id="custom"><IconStyle> 
  <Icon>
    <href>http://www.example.com/image.png</href>
  </Icon>
  <scale>0.5</scale>
  <hotSpot x="0.5 y="0.5" xunits="fraction" yunits="fraction"/>
</IconStyle></Style>

And it should be possible to use it like this:
<Placemark>
  <styleUrl>#custom</styleUrl>
  <name>Test</name>
  <Point>
    <coordinates>20.1,64.0</coordinates>
  </Point>
</Placemark>
 
For the icons stored in the web only "http" protocol is supported, but additionally the <href> tag can contain a path for a file stored inside the kmz file. For example, if the kmz file contains the kml file at the top level, and the icon image "dot.png" (can be png, jpg, or gif) is stored subdirectory "icons" in the kml file, the <href> tag should contain string "icons/dot.png" (without quotes of course). If the icon is stored in the same directory as the kml file, the image file name should be used without any path.

BTW, I didn't actually try this, I just quickly scanned the source code, and tried to remember how these things work. It has been literally years since I last worked on the placemark support code. I hope this helps.

Marko Teittinen


--
You received this message because you are subscribed to the Google Groups "Custom Maps users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to custom-maps-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/custom-maps-users/c336c15b-1e84-4a0e-87e2-00ce2ee7ad26n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages