Table Of Contents

Previous topic

GeoAdmin.MailWindow

Next topic

GeoAdmin.MapPanel

This Page

GeoAdmin.Map

Extends
class GeoAdmin.Map(div, options)
param div:String The element where the map will be rendered (or the id for that element).
param config:Object options (optional).
Valid properties for the options argument:
  • scale - Number : scaledenom of the map, e.g. 500000
  • doZoomToMaxExtent - Boolean: zoom to the maximal extent of the map
return:OpenLayers.Map

Create an Openlayers.Map containing the GeoAdmin layer and configuration

Example Use

Sample code to create a map (see also demo):

var map = new GeoAdmin.Map("mapdiv", {doZoomToMaxExtent: true});

Config Options

Configuration properties in addition to those listed for OpenLayers.Map.

vectorStyleMap

OpenLayers.StyleMap custom style map for the vector layer.

Public Methods

Public methods in addition to those listed for OpenLayers.Map.

Map.addLayerByName()
Parameters:
  • layernameString Layer name id. The layer list can be found there
  • optionsObject Layer options (optional)

Add a layer overlay to the map.

Map.applyState()
Parameters:stateObject The state to apply.

Apply the state provided as argument

Map.attribution()
Returns:String - List with data owner of layers displayed in the map.

Return the layers attribution

Map.defaultVectorStyleMap()
Returns:Object OpenLayers.StyleMap the default style map for map.vector layer
Map.destroy()

Destroy the map

Map.getLayerByLayerName()
Parameters:layernameString Layer name id. The layer list can be found here
Returns:OpenLayers.Layer

Get a layer of the map by its name

Map.getState()
Returns:Object The state.

Returns the current state of the map

Map.switchComplementaryLayer()
Parameters:
  • layernameString Layer name id of the base layers. The complete layer list can be found over there
  • optionsObject - Layer option (optional)
Returns:

OpenLayers:Layer

Switch the complementary layer.