Add PermaLink control. Add test for permalink control. This control will automatically center and zoom the map to lat/lon/zoom args, and allows you to set an <a> element whose href is modified when the map moves. controls.html implements an example.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@846 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-07-01 02:14:03 +00:00
parent 72e44d6638
commit 9f0a77aa92
5 changed files with 108 additions and 1 deletions

View File

@@ -34,14 +34,16 @@
map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.MouseToolbar());
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.Permalink($('permalink')));
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToMaxExtent();
if (!map.getCenter()) map.zoomToMaxExtent();
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<a href="" id="permalink">Permalink</a><br />
<div id="map"></div>
</body>
</html>