OpenLayers/Layer demo's

From Mapping on MediaWiki
Jump to: navigation, search

This page contains examples of the usage of the Maps MediaWiki extension with OpenLayers. To be more precise, it shows how to use custom defined layers.

Notice: Feel free to add your own examples, but keep in mind this is a documentation page and not a sandbox.

OpenStreetMap layers

{{
#display_map: New York City
| service=openlayers
| layers=osm
}}
Loading map...
The following error has been detected in your syntax:
* Parameter coordinates must be one or more valid locations.

Custom OpenLayers layer demo's

Google Maps

Definition

# Google Maps layers for OpenLayers
$egMapsOLAvailableLayers['google-normal'] = array('OpenLayers.Layer.Google( "Google Streets", {"sphericalMercator":true} )', 'google');
$egMapsOLAvailableLayers['google-satellite'] = array('OpenLayers.Layer.Google( "Google Satellite", {type: G_SATELLITE_MAP , "sphericalMercator":true} )', 'google');
$egMapsOLAvailableLayers['google-hybrid'] = array('OpenLayers.Layer.Google( "Google Hybrid", {type: G_HYBRID_MAP , "sphericalMercator":true} )', 'google');
$egMapsOLAvailableLayers['google-physical'] = array('OpenLayers.Layer.Google( "Google Physical", {type: G_PHYSICAL_MAP , "sphericalMercator":true} )', 'google');
$egMapsOLLayerGroups['google'] = array('google-normal', 'google-satellite', 'google-hybrid', 'google-physical');
$egMapsOLLayerDependencies['google'] = "<script src='http://maps.google.com/maps?file=api&v=2&key=$egGoogleMapsKey&hl={}' type='$wgJsMimeType'></script><script type='$wgJsMimeType' src='$egMapsScriptPath/GoogleMaps/GoogleMapFunctions.min.js?$egMapsStyleVersion'></script><script type='$wgJsMimeType'>window.unload = GUnload;</script>";

Example 1

{{
#display_map: New York City
| service=openlayers
| layers=google
}}
Loading map...
The following errors have been detected in your syntax:
* Parameter coordinates must be one or more valid locations.
* Parameter layers must be one or more valid layers.


Example 2

{{
#display_point: New York City
| service=openlayers
| layers=google-physical, google-satellite
}}
Loading map...
The following errors have been detected in your syntax:
* Parameter coordinates must be one or more valid locations.
* Parameter layers must be one or more valid layers.

Public Transport OSM layer (German)

Definition

# Public transport OSM layer for OpenLayers
$egMapsOLAvailableLayers['german-layer'] = array('OpenLayers.Layer.OSM("Öpnv Deutschland", "http://tile.xn--pnvkarte-m4a.de/tilegen/${z}/${x}/${y}.png", {numZoomLevels: 19,buffer:0})');

Example

{{
#display_map: Berlin
| service=openlayers
| layers=german-layer
}}
Loading map...
The following errors have been detected in your syntax:
* Parameter coordinates must be one or more valid locations.
* Parameter layers must be one or more valid layers.

OpenLayers control demo's

PanZoomBar

Loading map...
The following error has been detected in your syntax:
* Parameter coordinates must be one or more valid locations.

MouseToolbar

Loading map...
The following error has been detected in your syntax:
* Parameter coordinates must be one or more valid locations.

LayerSwitcher

Loading map...
The following error has been detected in your syntax:
* Parameter coordinates must be one or more valid locations.

Permalink

Loading map...
The following error has been detected in your syntax:
* Parameter coordinates must be one or more valid locations.

MousePosition

Loading map...
The following error has been detected in your syntax:
* Parameter coordinates must be one or more valid locations.

OverviewMap

Loading map...
The following error has been detected in your syntax:
* Parameter coordinates must be one or more valid locations.

KeyboardDefaults

Loading map...
The following error has been detected in your syntax:
* Parameter coordinates must be one or more valid locations.

[non exists]

Loading map...
The following error has been detected in your syntax:
* Parameter coordinates must be one or more valid locations.

[empty]

Loading map...
The following errors have been detected in your syntax:
* Parameter coordinates must be one or more valid locations.
* One or more values for parameter controls are invalid. It only accepts these values: argparser, attribution, button, dragfeature, dragpan, drawfeature, editingtoolbar, getfeature, keyboarddefaults, layerswitcher, measure, modifyfeature and mousedefaults (and 24 omitted values).


OpenLayers