OpenLayers.Control.Permalink - OpenLayers

# OpenLayers.Control.Permalink

The Permalink control is hyperlink that will return the user to the current map view. By default it is drawn in the lower right corner of the map. The href is updated as the map is zoomed, panned and whilst layers are switched.

#### Inherits from

- OpenLayers.Control

Summary

OpenLayers.Control.Permalink | The Permalink control is hyperlink that will return the user to the current map view.
Properties |
argParserClass | {Class} The ArgParser control class (not instance) to use with this control.
element | {DOMElement}
anchor | the character ‘#’ is used in place of the character ‘?’
base | {String}
displayProjection | {OpenLayers.Projection} Requires proj4js support.
Constructor |
OpenLayers.Control.Permalink |
Functions |
destroy |
setMap | Set the map property for the control.
draw | {DOMElement}
updateLink |
createParams | Creates the parameters that need to be encoded into the permalink url.

### Properties

### argParserClass

{Class} The ArgParser control class (not instance) to use with this control.

### element

{DOMElement}

### anchor

#### {Boolean} This option changes 3 things

the character ‘#’ is used in place of the character ‘?’, the window.href is updated if no element is provided. When this option is set to true it’s not recommend to provide a base without provide an element.

### base

{String}

### displayProjection

{OpenLayers.Projection} Requires proj4js support. Projection used when creating the coordinates in the link. This will reproject the map coordinates into display coordinates. If you are using this functionality, the permalink which is last added to the map will determine the coordinate type which is read from the URL, which means you should not add permalinks with different displayProjections to the same map.

### Constructor

### OpenLayers.Control.Permalink

#### Parameters

element | {DOMElement}
base | {String}
options | {Object} options to the control.

#### Or for anchor

options | {Object} options to the control.

### Functions

### destroy

> destroy: function()

### setMap

> setMap: function( | map | )

Set the map property for the control.

#### Parameters

map | {OpenLayers.Map}

### draw

> draw: function()

#### Returns

{DOMElement}

### updateLink

> updateLink: function()

### createParams

> createParams: function( | center,
> | zoom,
> | layers | )

Creates the parameters that need to be encoded into the permalink url.

#### Parameters

center | {OpenLayers.LonLat} center to encode in the permalink. Defaults to the current map center.
zoom | {Integer} zoom level to encode in the permalink. Defaults to the current map zoom level.
layers | {Array(OpenLayers.Layer)} layers to encode in the permalink. Defaults to the current map layers.

#### Returns

{Object} Hash of parameters that will be url-encoded into the permalink.

Methods for coordinate transforms between coordinate systems.

> destroy: function()

> setMap: function( | map | )

Set the map property for the control.

> draw: function()

{DOMElement}

> updateLink: function()

> createParams: function( | center,
> | zoom,
> | layers | )

Creates the parameters that need to be encoded into the permalink url.
Controls affect the display or behavior of the map.
Instances of OpenLayers.Map are interactive maps embedded in a web page.
This class represents a longitude and latitude pair
Close