summaryrefslogtreecommitdiff
path: root/misc/openlayers/tests/deprecated/Layer/MapServer.html
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2014-08-12 21:56:44 +0200
committerChris Schlaeger <chris@linux.com>2014-08-12 21:56:44 +0200
commitea346a785dc1b3f7c156f6fc33da634e1f1a627b (patch)
treeaf67530553d20b6e82ad60fd79593e9c4abf5565 /misc/openlayers/tests/deprecated/Layer/MapServer.html
parent59741cd535c47f25971bf8c32b25da25ceadc6d5 (diff)
downloadpostrunner-ea346a785dc1b3f7c156f6fc33da634e1f1a627b.zip
Adding jquery, flot and openlayers to be included with the GEM.v0.0.4
Diffstat (limited to 'misc/openlayers/tests/deprecated/Layer/MapServer.html')
-rw-r--r--misc/openlayers/tests/deprecated/Layer/MapServer.html59
1 files changed, 59 insertions, 0 deletions
diff --git a/misc/openlayers/tests/deprecated/Layer/MapServer.html b/misc/openlayers/tests/deprecated/Layer/MapServer.html
new file mode 100644
index 0000000..d65fef6
--- /dev/null
+++ b/misc/openlayers/tests/deprecated/Layer/MapServer.html
@@ -0,0 +1,59 @@
+<html>
+<head>
+<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
+
+<script src="../../OLLoader.js"></script>
+<script src="../../../lib/deprecated.js"></script>
+<script type="text/javascript">
+ var isMozilla = (navigator.userAgent.indexOf("compatible") == -1);
+ var layer;
+
+ var name = 'Test Layer';
+ var url = "http://labs.metacarta.com/cgi-bin/mapserv";
+ var params = { map: '/mapdata/vmap_wms.map',
+ layers: 'basic'};
+
+ function test_Layer_MapServer_Reproject (t) {
+ var validkey = (window.location.protocol == "file:") ||
+ (window.location.host == "localhost") ||
+ (window.location.host == "openlayers.org");
+
+ if (OpenLayers.BROWSER_NAME == "opera" || OpenLayers.BROWSER_NAME == "safari") {
+ t.plan(1);
+ t.debug_print("Can't test google reprojection in Opera or Safari.");
+ } else if(validkey) {
+ t.plan(5);
+ var map = new OpenLayers.Map('map', {tileManager: null});
+ var layer = new OpenLayers.Layer.Google("Google");
+ map.addLayer(layer);
+ layer = new OpenLayers.Layer.MapServer(name, url, params, {reproject: true, isBaseLayer: false, buffer: 2});
+ layer.isBaseLayer=false;
+ map.addLayer(layer);
+ map.setCenter(new OpenLayers.LonLat(0,0), 5);
+ var tile = layer.grid[0][0];
+ t.eq( tile.bounds.left, -22.5, "left side matches" );
+ t.eq( tile.bounds.right, -11.25, "right side matches" );
+ t.eq( tile.bounds.bottom.toFixed(6), '11.781325', "bottom side matches" );
+ t.eq( tile.bounds.top.toFixed(6), '22.512557', "top side matches" );
+ map.destroy();
+ } else {
+ t.plan(1);
+ t.debug_print("can't test google layer from " +
+ window.location.host);
+ }
+
+ var map = new OpenLayers.Map('map', {tileManager: null});
+ layer = new OpenLayers.Layer.MapServer(name, url, params, {buffer:2});
+ map.addLayer(layer);
+ map.setCenter(new OpenLayers.LonLat(0,0), 5);
+ var tile = layer.grid[0][0];
+ t.ok( tile.bounds.equals(new OpenLayers.Bounds(-33.75, 33.75, -22.5, 45)), "okay");
+ map.destroy();
+ }
+
+</script>
+</head>
+<body>
+<div id="map" style="width:500px;height:550px"></div>
+</body>
+</html>