Wp-osm-plugin

From OpenStreetMap Wiki
Jump to: navigation, search

The wordpress OSM plugin inserts maps (OpenStreetMap and Google Maps) and adds geo meta tags to posts / pages of WordPress blogs. You can add several maps within one post / page.

Contents

Status

Wordpress Versions Supported

at least:

tested on:

Install / Upgrade / Uninstall

Install

Upgrade

Automatically upgrade

will delete all your personal files in the osm-folder (gpx, txt, icons, ...)
Only use this if you did not copy any files of your own the osm folder!

Manually upgrade

Uninstall

Features

Screenshots

Osm-screenshot1.png
WordPress OpenStreetMap Plugin

Osm-screenshot2.png
WordPress OpenStreetMap Plugin - mark all tagged posts in the map

Osm-screenshot3.png
WordPress OpenStreetMap Plugin - GPX-Track and overview map

Adding a map to your posts / pages

Simply place the shortcode [osm_map] within your thext, where the map should be displayed:
[osm_map Lat="36.5665" Long="126.9779"]
This will generate a map of Korea with standard zoom level and standard size.

Add a map with personal markers

Place the shortcode [osm_map] within your thext, where the map should be displayed and add the information about the textfile like:
[osm_map Lat="26.8828" Long="100.2255" marker_file="http://www.MyDomain.at/wp-content/uploads/MyMarkers.txt"]

Upload the textfile with "Media"=>"Add new" at your blog-Admin section and copy the Url (not in the OSM-plugin folder since all data within OSM-folder will be deleted at "automatically upgrade" of the OSM-plugin).

lat	lon	title	description	icon	iconSize	iconOffset
37.566535	126.9779692	Seoul Start	capital of Korea.	http://www.MyDomain.at/wp-content/uploads/MyIcon.png	20,20	0,-20
35.1795543	129.0756416	Busan End	Harbour.	http://www.MyDomain.at/wp-content/uploads/MyIcon.png	20,20	0,-20

Upload MyIcon.png with "Media"=>"Add new" and copy the Url.

Note: few free hosting service don't allow files with a .txt extension to be read (000webhost.com at least), as a workaround you can call the file with a .dat extension instead.

Add a map with personal routes and tracks

Place the shortcode [osm_map] within your thext, where the map should be displayed and add the information about the track like:
[osm_map Lat="26.8828" Long="100.2255" gpx_file="http://www.MyDomain.at/wp-content/uploads/sample.gpx"]

If you want to add multiple tracks within one map just use the gpx_file_list tag:

[osm_map Lat="26.8828" Long="100.2255" gpx_file_list="http://www.MyDomain.at/wp-content/uploads/sample01.gpx,http://www.MyDomain.at/wp-content/uploads/sample02.gpx,http://www.MyDomain.at/wp-content/uploads/sample03.gpx" gpx_colour_list="green,red,blue"]

The track-file should be stored in the upload folder! These formats are supported:

If you do not have any GPS device, you can use a genereated / converted gpx-file or simply create it by your own:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<gpx version="1.0" creator="Turbo GPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<trk>
  <name>My Tour in Boulgaria</name>
  <number>1</number>
<trkseg>    
  <trkpt lat="42.6985" lon="23.3212">
   <name>Sofia</name>
   <time>2009-05-16T00:00:00Z</time>
   <cmt> Start of the Track </cmt>
  </trkpt>
  <trkpt lat="42.2793" lon="23.1179">
   <name>Dupnitsa</name>
   <time>2009-05-16T03:00:00Z</time>
   <cmt> Start of the Track </cmt>
  </trkpt>
</trkseg>
</trk>
</gpx>

Add geo meta tags to Wordpress posts and pages

You can add geo meta tags to your posts by using the wordpress custom field when you edit your posts / pages. You can choose any name in your post, but it has to be unique to all posts of your blog. Set this name in the Osm seetings are. The format to add the geo data to the custom field is:
42.6985,23.3212
for Sofia. So like Lat,Long

Add a map showing all places there is a post on your blog with geo data

Place the shortcode [osm_map] within your text, where the map should be displayed and add the information about the textfile like:
[osm_map Lat="36.5665" Long="126.9779" import="osm"]

Arguments fot the [osm_map] Shortcode

general map info

adding a track / route

sample: Adding gps logger data to map

adding a single marker

sample: add a single marker to the map

adding a list of markers

sample: add a list of marker by txt-file

import data

"osm" will insert just a marker, "osm_l" inserts a marker with a link to the post.
sample: add tagged posts of the blog
sample: add geocaches

loading an external map

You have to set: type=”Ext” and use these arguments:

sample:[osm_map long="-0.163" lat="51.483" control="scaleline,scale" zoom="14" width="500" height="450" extmap_type="OSM" extmap_name="UK_Map" extmap_address="http://b.ooc.openstreetmap.org/os1/${z}/${x}/${y}.jpg" extmap_init="numZoomLevels: 17, transitionEffect: 'resize', sphericalMercator: true" type="ext"]

adding controls an overviewmap in your map

WordPress issues

Themes

Atahualpa 3.4.4

you have to change the settings like this:

Atahulpa Theme Options => Style IMAGES => Images in Posts:
padding: 0px;
border: solid 0px #dddddd;

Plugins

Plugin Sites

Info & Tutorials on wordpress OSM plugin

Download

http://wordpress.org/extend/plugins/osm/

Author Blog

http://www.HanBlog.net

Sites using the OSM-WordPress-Plugin

Simple Map

Map with Markerfile

Map with geotagged posts

Map with GPX Track

Map with GPX / KML Track and Markerfile

External Map

Map with Geocaches

Theme using Template Tag

Personal tools
Namespaces
Variants
Actions
site
Toolbox