* Layer-KaMap, Grid, and Map were all having commented out tests run by Test.AnotherWay. * Layer.html was adding an additional , after a list in an object creation, which IE doesn't allow. * When setting the href="" of an <a> element, IE does not then return the concatanation of the location+href via the DOM. * EventPane has mouse handling tests which work in IE, but not in FF. git-svn-id: http://svn.openlayers.org/branches/openlayers/2.0@1333 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
60 lines
2.6 KiB
HTML
60 lines
2.6 KiB
HTML
<html>
|
|
<head>
|
|
<script src="../lib/OpenLayers.js"></script>
|
|
<script type="text/javascript"><!--
|
|
var map;
|
|
function test_01_Control_Permalink_constructor (t) {
|
|
t.plan( 1 );
|
|
|
|
control = new OpenLayers.Control.Permalink();
|
|
t.ok( control instanceof OpenLayers.Control.Permalink, "new OpenLayers.Control returns object" );
|
|
}
|
|
function test_02_Control_Permalink_updateLinks (t) {
|
|
t.plan( 2 );
|
|
|
|
control = new OpenLayers.Control.Permalink($('permalink'));
|
|
t.ok( control instanceof OpenLayers.Control.Permalink, "new OpenLayers.Control returns object" );
|
|
map = new OpenLayers.Map($('map'));
|
|
layer = new OpenLayers.Layer.WMS('Test Layer', "http://octo.metacarta.com/cgi-bin/mapserv", {map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'});
|
|
map.addLayer(layer);
|
|
if (!map.getCenter()) map.zoomToMaxExtent();
|
|
map.addControl(control);
|
|
map.pan(5, 0);
|
|
if (/MSIE/.test(navigator.userAgent)) {
|
|
t.eq($('permalink').href, "?lat=0&lon=1.75781&zoom=2", "Panning sets permalink");
|
|
} else {
|
|
t.eq($('permalink').href, location+"?lat=0&lon=1.75781&zoom=2", "Panning sets permalink");
|
|
}
|
|
}
|
|
function test_03_Control_Permalink_updateLinksBase (t) {
|
|
t.plan( 2 );
|
|
|
|
control = new OpenLayers.Control.Permalink($('permalink'), "./edit.html" );
|
|
t.ok( control instanceof OpenLayers.Control.Permalink, "new OpenLayers.Control returns object" );
|
|
map = new OpenLayers.Map($('map'));
|
|
layer = new OpenLayers.Layer.WMS('Test Layer', "http://octo.metacarta.com/cgi-bin/mapserv", {map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'});
|
|
map.addLayer(layer);
|
|
if (!map.getCenter()) map.zoomToMaxExtent();
|
|
map.addControl(control);
|
|
map.pan(5, 0);
|
|
$('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>
|
|
<body>
|
|
<a id="permalink" href="">Permalink</a> <br />
|
|
<a id="edit_permalink" href="">Edit</a> <br />
|
|
<div id="map" style="width: 1024px; height: 512px;"/>
|
|
</body>
|
|
</html>
|