/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD * license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the * full text of the license. */ /** * @requires OpenLayers/Control.js * @requires OpenLayers/Control/ArgParser.js */ /** * Class: OpenLayers.Control.Permalink * * Inherits from: * - */ OpenLayers.Control.Permalink = OpenLayers.Class(OpenLayers.Control, { /** * Property: element * {DOMElement} */ element: null, /** * APIProperty: base * {String} */ base: '', /** * APIProperty: displayProjection * {} 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. */ displayProjection: null, /** * Constructor: OpenLayers.Control.Permalink * * Parameters: * element - {DOMElement} * base - {String} * options - {Object} options to the control. */ initialize: function(element, base, options) { OpenLayers.Control.prototype.initialize.apply(this, [options]); this.element = OpenLayers.Util.getElement(element); this.base = base || document.location.href; }, /** * APIMethod: destroy */ destroy: function() { if (this.element.parentNode == this.div) { this.div.removeChild(this.element); } this.element = null; this.map.events.unregister('moveend', this, this.updateLink); OpenLayers.Control.prototype.destroy.apply(this, arguments); }, /** * Method: setMap * Set the map property for the control. * * Parameters: * map - {} */ setMap: function(map) { OpenLayers.Control.prototype.setMap.apply(this, arguments); //make sure we have an arg parser attached for(var i=0, len=this.map.controls.length; i