Extension:Maps/OpenLayers

OpenLayers examples
Since Maps is not enabled on this wiki, no examples can be shown here. You can find a list of OpenLayers examples here.

Layers
Parameter:

Notice: The values for this parameter and how they are handles have changes in 0.5.4. For older releases, see this version of this page.

Available values

 * - All available Bing Maps (formerly known as Virtual Earth) map types
 * - Bing streets
 * - Bing satellite
 * - Bing hybrid


 * - All available Yahoo! Maps map types
 * - Yahoo! streets
 * - Yahoo! satellite
 * - Yahoo! hybrid


 * - All available OpenStreetMap map types
 * - OSM arender
 * - OSM Mapnik
 * - OSM Cycle Map


 * - OpenLayers WMS
 * - NASA Global Mosaic

How it works
This parameter sets the available base layers of your OpenLayers map. You can add as many base layers as you want, by separating them with comma's. When you add a layer twice, only the first occurrence will be added. The,  ,   and   short cuts allow you to add all their associated layers without having to type them individually. You can configure the default layers (the ones that will be added when no value is provided) in the settings file. The first layer will be loaded at start-up.

Extra dependencies
Adding certain layers will make the OpenLayers map dependent on other mapping API's. Those are listed below:
 * All Google layers - require the Google Maps API. You must have a valid Google Maps API key entered for these layers to work!
 * All Yahoo! layers - require the Yahoo! Maps API. You must have a valid Yahoo! Maps API key entered for these layers to work!

Examples
This is a simple example with 3 layers.

layers=google-hybrid,nasa,bing-hybrid

This example demonstrates the usage of the bundle short-cuts.

layers=google-hybrid,nasa,yahoo,google

This will result in the following order of layers:

Google hybrid, NASA Global Mosaic, Yahoo! streets, Yahoo! satellite, Yahoo! hybrid, Google streets, Google satellite maps, Google physical maps

Google Maps layers
To be able to use Google Maps layers, you need to add the following lines to your LocalSettings file, after the inclusion of Maps, and any API keys.

This will make these values available:


 * - All available Google Maps map types
 * - Google streets
 * - Google satellite
 * - Google hybrid
 * - Google physical

Defining your own layers
Since Maps 0.5.4, you can define your own layers. This is done by adding extra values to $egMapsOLAvailableLayers, $egMapsOLLayerGroups and $egMapsOLLayerDependencies in your LocalSettings file.

Controls
Parameter:

Available values: See the OpenLayers docs (the items in the menu on the left).

This parameter sets the controls that will be added to your OpenLayers map. You can add as many of the controls you want, by separating them with comma's. You can also configure the default controls (the ones that will be added when no value is provided) in the settings file.

See the OpenLayers docs for a list of available controls and their descriptions. Note that the value of the controls parameter is case insensitive, so it doesn't matter if you use capitals or only lower case letters.

Since 0.4, Maps supports the 'autopanzoom' control. When you specify this control, Maps will automatically determine if panzoom, panzoombar, or no control should be used, depending on the maps height.

Example of how to use this parameter: controls=autopanzoom,scaleline,overviewmap,keyboarddefaults

OpenLayers layers
The default layers for OpenLayers. This value will only be used when the user does not provide one. See the layers parameter for the available values.

Default:

OpenLayers controls
The default controls for OpenLayers. This value will only be used when the user does not provide one. See the controls parameter for the available values.

Default:

Default map zoom
The default zoom of an OpenLayers map. This value will only be used when the user does not provide one.

Default:

Map name prefix
The OpenLayers map name prefix. It can not be identical to the one of another mapping service. Unless you know what you are doing, it's discouraged to modify this value.

Default:

OpenLayers usage examples
If you are using Maps and have a great example of OpenLayers functionality, feel free to link to it below.


 * BN's demo wiki