AnchorPermalink Example

http://openlayers.org/dev/examples/anchor-permalink.js

HTML

<script src="http://fbug.googlecode.com/svn/lite/branches/flexBox/content/firebug-lite-dev.js"></script>
<script src="http://openlayers.org/dev/OpenLayers.js"></script>
<link rel="stylesheet" href="http://openlayers.org/dev/examples/style.css">
<link rel="stylesheet" href="http://openlayers.org/dev/theme/default/style.css">
  <h1 id="title">AnchorPermalink Example</h1>

  <div id="tags">
    anchor, permalink
  </div>

  <p id="shortdesc">Place a permalink in the anchor of the url.</p>

  <div id="map" class="smallmap"></div>

  <div id="docs">
    <p>See the <a href="http://openlayers.org/dev/examples/anchor-permalink.js" target=
    "_blank">anchor-permalink.js source</a> to see how this is done.</p>
  </div><br />

  <p><a href="http://openlayers.org/dev/examples/anchor-permalink.html">Original
  OpenLayers Example</a>.</p>

JavaScript

(function($) {

    function init() {
        var map = new OpenLayers.Map({
            div: 'map',
            projection: new OpenLayers.Projection('EPSG:900913'),
            displayProjection: new OpenLayers.Projection('EPSG:4326'),
            layers: [
                new OpenLayers.Layer.OSM()
                ]
        });
        if (!map.getCenter()) {
            map.zoomToMaxExtent();
        }

        map.addControl(new OpenLayers.Control.Permalink({
            anchor: true
        }));
    }

    init();
})(jQuery);