summaryrefslogtreecommitdiff
path: root/ikiwiki/directive/osm.mdwn
blob: e800334ae58a8054f1374583e9ca148b23efcba5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
[[!if test="enabled(osm)"
  then="In diesem Wiki ist die Direktive: osm **aktiviert**."
 else="In diesem Wiki ist die Direktive: osm **nicht aktiv**; falls dies gewünscht wird, den Admin benachrichtigen."]]

---
The `osm` directive is supplied by the [[!iki plugins/osm desc=osm]] plugin.

This directive inserts an OpenStreetMap map onto a page.
It is typically combined with the [[waypoint]] directive
to add points to the map.

## examples

    \[[!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.

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]]
    \[[!tag city]]

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

## map display

 * `map` - map to display, defaults to "map"
 * `zoom` - the level to zoom to on the OSM map
 * `loc` - lattitude and longitude of the map center
 * `lat` - lattitude
 * `lon` - longitude
 * `editable` - add edit controls in a separate layer
 * `right` - float the map right
 * `left` - float the map left (default)
 * `width` - width of the map
 * `height` - height of the map

## 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.

 * `name` - the name of this point, defaults to the page name (!) must
   be unique, otherwise later incantation will overwrite previous
   ones.
 * `map` - the map to add the point to (defaults to "map")
 * `desc` - description to embed in the map
 * `loc` - lattitude and longitude
 * `lat` - lattitude
 * `lon` - longitude
 * `tag` - the type of points, maps to an icon in the osm_types array
 * `hidden` - do not display the link to the map (will not affect `embed`)
 * `icon` - URL to the icon to show in the link to the map and within
   the map
 * `embed` - embed the map display alongside the point, in which case
   the regular arguments to the map display can be used

## Links

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