Add support to Permalink control to automatically create Permalink inside map div if no element is given. This isn't pretty, but it's a good way to quickly/easily add a permalink to your map.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@847 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-07-01 02:41:21 +00:00
parent 9f0a77aa92
commit 15a47c6513
3 changed files with 26 additions and 3 deletions

View File

@@ -36,6 +36,14 @@
$('edit_permalink').href = './edit.html?lat=0&lon=1.75781&zoom=2';
t.eq($('permalink').href, $('edit_permalink').href, "Panning sets permalink with base");
}
function test_03_Control_Permalink_noElement (t) {
t.plan( 2 );
control = new OpenLayers.Control.Permalink( );
t.ok( control instanceof OpenLayers.Control.Permalink, "new OpenLayers.Control returns object" );
map = new OpenLayers.Map($('map'));
map.addControl(control);
t.eq(map.controls[2].div.firstChild.nodeName, "A", "Permalink control creates div with 'a' inside." );
}
// -->
</script>
</head>