Dealing with icons in KML files for WP OpenStreetMap Plugin OSM

If you want to display individual information in your map then KML files are a good choice. There are several KML generators and it’s easy to integrate it into your WordPress Site.

Note, you must not display any icons which are protected by copyright! There icons integrated in WP OSM plugin and you should use them in your KML file with style-tag like this:

  <Style id="style1">
    <IconStyle>
      <Icon>
        <href>http://www.MyDomain.com/wp-content/plugins/osm/icons/mic_white_number_01.png</href>
      </Icon>
      <hotSpot x="16" y="0" xunits="pixels" yunits="pixels" />
    </IconStyle>   </Style>

Using this icon you simple refer to the style at the placemark-tag with styleUrl:

  <Placemark>
    <name>Primosten</name>
    <Snippet>About Primosten&amp;nbsp;Mooring in Primosten&amp;nbsp;Primosten Gallery</Snippet>
    <description><![CDATA[<a href="http://de.wikipedia.org/wiki/Primo%C5%A1ten" target="_blank">About Primosten</a>&nbsp;<div><a href="http://www.sailingchoices.com/mooring-Primosten/" target="_blank">Mooring in Primosten</a>&nbsp;</div><div><a href="http://www.sailingchoices.com/Primosten-photos/" target="_blank">Primosten Gallery</a></div>]]></description>
    <styleUrl>#style1</styleUrl>
    <Point>
      <coordinates>15.9219,43.5885,0.00</coordinates>
    </Point>
  </Placemark>

Sample looks like this:

[*osm_map_v3 map_center="43.544567,15.831299" zoom="9" width="100%" height="550" file_list="../../../../wp-content/uploads/osm_map/test route 2015.kml"]

If you miss any icons just post it to get them with the next OSM plugin version.

PS: KML-sample was taken from http://www.sailingchoices.com

 

Posted in Allgemein
Tags: , , ,
One comment on “Dealing with icons in KML files for WP OpenStreetMap Plugin OSM
  1. ovidiu says:

    I have created a map on google maps under “my maps”, and selected default syles, nothing custom then exported the kml file.
    Using this plugin to display the kml file works but its missing the icons.

    What are my options except editing the kml file and manually changing all icon styles?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Location