iframe included in a page from matching every other browser to matching IE. Rather than try and guess what's going to happen with this in the future, at the moment, just duplicate the data, in hopes of a more sane solution coming along in the future for all our data loading needs. git-svn-id: http://svn.openlayers.org/trunk/openlayers@6712 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
66 lines
2.1 KiB
HTML
66 lines
2.1 KiB
HTML
<html>
|
|
<head>
|
|
<script src="../../lib/OpenLayers.js"></script>
|
|
<script type="text/javascript">
|
|
|
|
var name = "GML Layer";
|
|
|
|
// The actual path these files are read from differs:
|
|
// some browsers treat relative paths from within an iframe
|
|
// as relative to the parent, some treat them as relative to the child
|
|
// At this time:
|
|
// * IE6 + IE7
|
|
// * Firefox 2.0.0.13+
|
|
// read them from relative to the iframe contents, rather than parent,
|
|
// so these files are in *two* places: one in the "Layer/" subdirectory,
|
|
// and one in the root. This majorly sucks, but it's a way to keep it
|
|
// working without hardcoding a version number into the tests.
|
|
var gml = "./owls.xml";
|
|
var gml2 = "./mice.xml";
|
|
|
|
var isMSIE = (navigator.userAgent.indexOf("MSIE") > -1);
|
|
|
|
function test_01_Layer_GML_constructor(t) {
|
|
t.plan(3);
|
|
|
|
var layer = new OpenLayers.Layer.GML(name);
|
|
t.ok(layer instanceof OpenLayers.Layer.GML, "new OpenLayers.Layer.GML returns correct object" );
|
|
t.eq(layer.name, name, "layer name is correctly set");
|
|
t.ok(layer.renderer.CLASS_NAME, "layer has a renderer");
|
|
|
|
}
|
|
function test_Layer_GML_events(t) {
|
|
t.plan(3);
|
|
|
|
var layer = new OpenLayers.Layer.GML(name, gml, {isBaseLayer: true});
|
|
layer.events.register("loadstart", layer, function() {
|
|
t.ok(true, "loadstart called.")
|
|
});
|
|
layer.events.register("loadend", layer, function() {
|
|
t.ok(true, "loadend called.")
|
|
});
|
|
var map = new OpenLayers.Map("map");
|
|
map.addLayer(layer);
|
|
map.zoomToMaxExtent();
|
|
t.delay_call(1, function() {
|
|
t.ok(true, "waited for 1s");
|
|
});
|
|
|
|
}
|
|
function test_GML_setUrl(t) {
|
|
t.plan(2);
|
|
var layer = new OpenLayers.Layer.GML(name, gml);
|
|
var map = new OpenLayers.Map("map");
|
|
map.addLayer(layer);
|
|
t.eq(layer.url, gml, "layer has correct original url");
|
|
layer.setUrl(gml2);
|
|
t.eq(layer.url, gml2, "layer has correctly changed url");
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="map" style="width:500px;height:550px"></div>
|
|
</body>
|
|
</html>
|
|
|