3 <script src="../../lib/OpenLayers.js"></script>
4 <script type="text/javascript">
6 var name = "GML Layer";
8 var gml = "./owls.xml";
9 var gml2 = "./mice.xml";
11 // if this test is running online, different rules apply
12 var isMSIE = (navigator.userAgent.indexOf("MSIE") > -1);
18 function test_Layer_GML_constructor(t) {
21 var layer = new OpenLayers.Layer.GML(name);
22 t.ok(layer instanceof OpenLayers.Layer.GML, "new OpenLayers.Layer.GML returns correct object" );
23 t.eq(layer.name, name, "layer name is correctly set");
24 t.ok(layer.renderer.CLASS_NAME, "layer has a renderer");
27 function test_Layer_GML_events(t) {
30 var layer = new OpenLayers.Layer.GML(name, gml, {isBaseLayer: true});
31 layer.events.register("loadstart", layer, function() {
32 t.ok(true, "loadstart called.")
34 layer.events.register("loadend", layer, function() {
35 t.ok(true, "loadend called.")
37 var map = new OpenLayers.Map("map");
39 map.zoomToMaxExtent();
40 t.delay_call(1, function() {
41 t.ok(true, "waited for 1s");
45 function test_GML_setUrl(t) {
47 var layer = new OpenLayers.Layer.GML(name, gml);
48 var map = new OpenLayers.Map("map");
50 t.eq(layer.url, gml, "layer has correct original url");
52 t.eq(layer.url, gml2, "layer has correctly changed url");
57 <div id="map" style="width:500px;height:550px"></div>