EXIF to KML with Geotag for OpenStreetMap in WordPress

EXIF to KML with Geotag for OpenStreetMap in WordPress

There are several ways to display your geotagged photos in a map. One way is to export the EXIF information of your JPG photos automatically with Geotag. The abbreviation KML ist not shown in the tool, but you get it if you choose Google Earth => Ausgewählte Bilder exportieren.

I modified the generated KML-file for two reasons:

  • changed the icon from Google-icon to an icon of Map Icons Collection (for legal reasons)
  • changed the placemark for the popup as the size was not correct

Change the marker

from:

<href>http://maps.google.com/mapfiles/kml/pal4/icon46.png</href>

to:

<href>http://MyDomain/wp-content/plugins/osm/icons/mic_photo_icon.png</href>

With “replace all” I modified the description (added a div and changed the location of the JPG files):

from:

<description>&lt;a href=&quot;/home/mika/MyPrograms/jpeg2kml/Fotos/20130404_150830_HDR.jpg&quot;&gt;&lt;img src=&quot;/home/mika/MyPrograms/jpeg2kml/Fotos/20130404_150830_HDR.jpg&quot; width=&quot;150&quot;/&gt;&lt;/a&gt;</description>

to (added a div for the size):

 <description>&lt;div style=&quot;width:150px;height:140px&quot;&gt;
&lt;a href=&quot;http://MyDomain/wp-content/uploads/osm_map/20130404_150830_HDR.jpg&quot;&gt;&lt;img src=&quot;http://MyDomain/wp-content/uploads/osm_map/20130404_150830_HDR.jpg&quot;&gt;&lt;/a&gt;&lt;/div&gt;</description>

The KML file can be displayed with the WP OSM Plugin like this:

[osm_map_v3 map_center="autolat,autolon" zoom="autozoom" width="100%" height="450" control="mouseposition,scaleline" file_list="../../../../wp-content/uploads/osm_map/Test_It.kml"]


Click on the camera / on the pic in the popup.

Leave a Reply

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

*