Widget:OpenStreetMap: Difference between revisions

From Nottinghack Wiki
Jump to navigation Jump to search
Marcus (talk | contribs)
Map example is now working.
Marcus (talk | contribs)
Line 22: Line 22:
: Adds a visual marker to the center of the map (default false).
: Adds a visual marker to the center of the map (default false).
;poifile
;poifile
: Specifies a file containing points of interest (POI) that should be overlaid on the map.  See the file format description in [http://dev.openlayers.org/releases/OpenLayers-2.6/doc/apidocs/files/OpenLayers/Layer/Text-js.html].
: Specifies a file containing points of interest (POI) that should be overlaid on the map.  See the file format description in [http://dev.openlayers.org/releases/OpenLayers-2.6/doc/apidocs/files/OpenLayers/Layer/Text-js.html]. Instead of uploading a file, you can add the points of interest to a wiki page and link to the raw page text, for example:
:  <code><nowiki>{{#widget:OpenStreetMap|...|poifile={{fullurl:Wiki page title|action=raw&templates=expand&ctype=text/plain}} }}</nowiki></code>
;poititle
;poititle
: The title of the POI layer (default 'Points of interest').
: The title of the POI layer (default 'Points of interest').

Revision as of 22:46, 11 March 2011

This widget allows you to embed OpenStreetMap in a wiki page.

Using this widget

You can insert a map with the following wiki code:

{{#widget:OpenStreetMap|lat=52.94762|lon=-1.1467897|zoom=16}}

Parameters

width
Width of the embedded map (default 400px).
height
Height of the embedded map (default 400px).
lat
The x-coordinate for the centre of the view.
lon
The y-coordinate for the centre of the view.
units
The type of map units used for the coordinates (defaults to 'degrees').
zoom
The zoom level (default 15).
showmarker
Adds a visual marker to the center of the map (default false).
poifile
Specifies a file containing points of interest (POI) that should be overlaid on the map. See the file format description in [1]. Instead of uploading a file, you can add the points of interest to a wiki page and link to the raw page text, for example:
{{#widget:OpenStreetMap|...|poifile={{fullurl:Wiki page title|action=raw&templates=expand&ctype=text/plain}} }}
poititle
The title of the POI layer (default 'Points of interest').

Example

© OpenStreetMap