Installing

Copy the osm.pm script in your Plugin directory, see http://ikiwiki.info/plugins/install/ for more information.

You will need the XML::Writer perl module to write KML files, which is the default mode of operation. GeoJSON files can also be generated if the JSON perl module is installed.

Configuring

Here are the configuration options you can put in your setup file:

# the default zoon when you click on the map link
osm_default_zoom: 15
# the icon showed on links
osm_default_icon: img/osm.png
# the alt tag of links, defaults to empty
osm_alt: 
# tag to icon mapping
osm_tag_icons:
  test: img/test.png
  trailer: img/trailer.png
# the output format for waypoints, can be KML, GeoJSON or CSV (one or many, comma-separated)
osm_format: KML

How to use

[[!osm ]]
[[!waypoint  lat="45°30N" lon="73°40W" name="My city" tag="city"]]

The osm directive will display the actual map, while the waypoint directive adds waypoints to the map. Those two can be put in separate pages.

The above can also be shortened as:

[[!waypoint  lat="45°30N" lon="73°40W" name="My city" tag="city" embed]]

The tag is also taken from the tags elsewhere in the page, so the above is equivalent to:

[[!waypoint  lat="45°30N" lon="73°40W" name="My city" embed]]

The icon is also taken from the tag if attached to the tag page as icon.png (default, modifiable)..

Map display

Waypoints

Waypoints can be added to any page. By default the waypoint takes the name of the page, which allows you to easily tag pages and make them appear on the central map.

Waypoints, by default, show up as a image (the icon parameter) link to the main map (or the map parameter provided). That markup can be hidden with the hidden parameter.

If two pages with waypoints have a link between them, that link will magically show up on the map. Now how awesome is that?

Todo

Created . Edited .