]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive/osm.mdwn
Merge remote-tracking branch 'intrigeri/fix_diffurl_vs._cgit'
[ikiwiki.git] / doc / ikiwiki / directive / osm.mdwn
1 The `osm` directive is supplied by the [[!iki plugins/osm desc=osm]] plugin.
2
3 This directive inserts an OpenStreetMap map onto a page.
4 It is typically combined with the [[waypoint]] directive
5 to add points to the map.
6
7 ## examples
8
9     \[[!osm]]
10     \[[!waypoint lat="45°30N" lon="73°40W" name="My city" tag="city"]]
11
12 The osm directive will display the actual map, while the waypoint
13 directive adds waypoints to the map.
14
15 The above can also be shortened as:
16
17     \[[!waypoint lat="45°30N" lon="73°40W" name="My city" tag="city" embed]]
18
19 The tag is also taken from the tags elsewhere in the page, so the
20 above is equivalent to:
21
22     \[[!waypoint lat="45°30N" lon="73°40W" name="My city" embed]]
23     \[[!tag city]]
24
25 The icon is also taken from the tag if attached to the tag page as
26 icon.png (default, modifiable)..
27
28 ## map display
29
30  * `map` - map to display, defaults to "map"
31  * `zoom` - the level to zoom to on the OSM map
32  * `loc` - lattitude and longitude of the map center
33  * `lat` - lattitude
34  * `lon` - longitude
35  * `editable` - add edit controls in a separate layer
36  * `right` - float the map right
37  * `left` - float the map left (default)
38  * `width` - width of the map
39  * `height` - height of the map
40
41 ## waypoints
42
43 Waypoints can be added to any page. By default the waypoint takes the
44 name of the page, which allows you to easily tag pages and make them
45 appear on the central map.
46
47 Waypoints, by default, show up as a image (the `icon` parameter) link
48 to the main map (or the `map` parameter provided). That markup can be
49 hidden with the `hidden` parameter.
50
51  * `name` - the name of this point, defaults to the page name (!) must
52    be unique, otherwise later incantation will overwrite previous
53    ones.
54  * `map` - the map to add the point to (defaults to "map")
55  * `desc` - description to embed in the map
56  * `loc` - lattitude and longitude
57  * `lat` - lattitude
58  * `lon` - longitude
59  * `tag` - the type of points, maps to an icon in the osm_types array
60  * `hidden` - do not display the link to the map (will not affect `embed`)
61  * `icon` - URL to the icon to show in the link to the map and within
62    the map
63  * `embed` - embed the map display alongside the point, in which case
64    the regular arguments to the map display can be used
65
66 ## Links
67
68 If two pages with waypoints have a link between them, that link will
69 magically show up on the map. Now how awesome is that?