ALKMaps.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

Summary
ALKMaps.Control.PermalinkThe 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}
anchorthe character ‘#’ is used in place of the character ‘?’
base{String}
displayProjection{ALKMaps.Projection} Requires proj4js support.
Constructor
ALKMaps.Control.Permalink
Functions
destroy
setMapSet the map property for the control.
draw{DOMElement}
updateLink
createParamsCreates 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

{ALKMaps.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

ALKMaps.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{ALKMaps.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{ALKMaps.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(ALKMaps.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 ALKMaps.Map are interactive maps embedded in a web page.
This class represents a longitude and latitude pair
Close