summaryrefslogtreecommitdiff
path: root/misc/openlayers/tests/deprecated/Layer/GML.html
diff options
context:
space:
mode:
Diffstat (limited to 'misc/openlayers/tests/deprecated/Layer/GML.html')
-rw-r--r--misc/openlayers/tests/deprecated/Layer/GML.html61
1 files changed, 61 insertions, 0 deletions
diff --git a/misc/openlayers/tests/deprecated/Layer/GML.html b/misc/openlayers/tests/deprecated/Layer/GML.html
new file mode 100644
index 0000000..daf5917
--- /dev/null
+++ b/misc/openlayers/tests/deprecated/Layer/GML.html
@@ -0,0 +1,61 @@
+<html>
+<head>
+ <script src="../../OLLoader.js"></script>
+ <script src="../../../lib/deprecated.js"></script>
+ <script type="text/javascript">
+
+ var name = "GML Layer";
+
+ var gml = "./owls.xml";
+ var gml2 = "./mice.xml";
+
+ // if this test is running online, different rules apply
+ var isMSIE = (navigator.userAgent.indexOf("MSIE") > -1);
+ if (isMSIE) {
+ gml = "." + gml;
+ gml2 = "." + gml2;
+ }
+
+ function test_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(3, function() {
+ t.ok(true, "waited for 3s");
+ });
+
+ }
+ 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>
+