Widget:OpenStreetMap: Difference between revisions

From Nottinghack Wiki
Jump to navigation Jump to search
Marcus (talk | contribs)
mNo edit summary
Marcus (talk | contribs)
mNo edit summary
Line 44: Line 44:
       map.getProjectionObject();
       map.getProjectionObject();


   <!--{if $showmarker}-->
   <!--{if $showmarker eq 'true'}-->
   var markers = new OpenLayers.Layer.Markers("Markers");
   var markers = new OpenLayers.Layer.Markers("Markers");
   map.addLayer(markers);
   map.addLayer(markers);
Line 50: Line 50:
   <!--{/if}-->
   <!--{/if}-->


   <!--{if $poifile}-->
   <!--{if (isset($poifile))}-->
   var pois = new OpenLayers.Layer.Text(
   var pois = new OpenLayers.Layer.Text(
       '<!--{$poititle|escape:'quotes'|default:'Points of interest'}-->',
       '<!--{$poititle|escape:'quotes'|default:'Points of interest'}-->',

Revision as of 21:28, 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=13.41|lon=52.52|zoom=15}}

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].
poititle
The title of the POI layer (default 'Points of interest').

Example