summaryrefslogtreecommitdiff
path: root/misc/openlayers/tests/Layer/MapGuide.html
diff options
context:
space:
mode:
Diffstat (limited to 'misc/openlayers/tests/Layer/MapGuide.html')
-rw-r--r--misc/openlayers/tests/Layer/MapGuide.html177
1 files changed, 0 insertions, 177 deletions
diff --git a/misc/openlayers/tests/Layer/MapGuide.html b/misc/openlayers/tests/Layer/MapGuide.html
deleted file mode 100644
index b1eb386..0000000
--- a/misc/openlayers/tests/Layer/MapGuide.html
+++ /dev/null
@@ -1,177 +0,0 @@
-<html>
-<head>
- <script type="text/javascript">var oldAlert = window.alert, gMess; window.alert = function(message) {gMess = message; return true;};</script>
- <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
- <script type="text/javascript">window.alert = oldAlert;</script>
-<script src="../OLLoader.js"></script>
- <script type="text/javascript">
- var isMozilla = (navigator.userAgent.indexOf("compatible") == -1);
- var layer;
-
- var name = 'MapGuide Test Layer';
- var url = "http://data.mapguide.com/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&";
- var paramsTiled = {
- mapdefinition: 'Library://Samples/Sheboygan/MapsTiled/Sheboygan.MapDefinition',
- basemaplayergroupname: "Base Layer Group"
- }
- var paramsUntiled = {
- mapdefinition: 'Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition'
- };
-
- function test_Layer_MapGuide_untiled_constructor (t) {
- t.plan( 8 );
-
- var trans_format = "image/png";
- var options = {singleTile:true};
- if (OpenLayers.Util.alphaHack()) { trans_format = "image/gif"; }
-
- layer = new OpenLayers.Layer.MapGuide(name, url, paramsUntiled, options);
- t.ok( layer instanceof OpenLayers.Layer.MapGuide, "new OpenLayers.Layer.MapGuide returns object" );
- t.eq( layer.url, "http://data.mapguide.com/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&", "layer.url is correct (HTTPRequest inited)" );
- t.eq( layer.params.mapdefinition, "Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition", "params passed in correctly" );
-
- t.eq( layer.params.operation, "GETMAPIMAGE", "default params set correctly and copied");
-
- t.eq(layer.isBaseLayer, true, "no transparency setting, layer is baselayer");
-
- options.transparent = "true";
- var layer2 = new OpenLayers.Layer.MapGuide(name, url, paramsUntiled, options);
- t.eq(layer2.isBaseLayer, false, "transparency == 'true', layer is not baselayer");
-
- options.transparent = true;
- var layer5 = new OpenLayers.Layer.MapGuide(name, url, paramsUntiled, options);
- t.eq(layer5.isBaseLayer, false, "transparency == true, layer is not baselayer");
-
- options.transparent = false;
- var layer6 = new OpenLayers.Layer.MapGuide(name, url, paramsUntiled, options);
- t.eq(layer6.isBaseLayer, true, "transparency == false, layer is baselayer");
- }
-
- function test_Layer_MapGuide_tiled_constructor (t) {
- t.plan( 5 );
-
- var trans_format = "image/png";
- var options = {singleTile:false};
- if (OpenLayers.Util.alphaHack()) { trans_format = "image/gif"; }
-
- layer = new OpenLayers.Layer.MapGuide(name, url, paramsTiled, options);
- t.ok( layer instanceof OpenLayers.Layer.MapGuide, "new OpenLayers.Layer.MapGuide returns object" );
- t.eq( layer.url, "http://data.mapguide.com/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&", "layer.url is correct (HTTPRequest inited)" );
- t.eq( layer.params.basemaplayergroupname, "Base Layer Group", "params passed in correctly" );
-
- t.eq( layer.params.operation, "GETTILEIMAGE", "default params correctly uppercased and copied");
- t.eq( layer.params.version, "1.2.0", "version params set correctly set");
- }
-
- function test_Layer_MapGuide_inittiles (t) {
- t.plan( 1 );
- var map = new OpenLayers.Map('map');
- layer = new OpenLayers.Layer.MapGuide(name, url, paramsTiled);
- map.addLayer(layer);
- map.setCenter(new OpenLayers.LonLat(0,400000),5);
- t.eq( layer.grid.length, 3, "Grid rows is correct." );
- // t.eq( layer.grid[0].length, 6, "Grid cols is correct." );
- map.destroy();
- }
-
-
- function test_Layer_MapGuide_clone (t) {
- t.plan(4);
-
- var options = {tileSize: new OpenLayers.Size(500,50)};
- var map = new OpenLayers.Map('map', options);
- layer = new OpenLayers.Layer.MapGuide(name, url, paramsTiled);
- map.addLayer(layer);
-
- layer.grid = [ [6, 7],
- [8, 9]];
-
- var clone = layer.clone();
-
- t.eq( layer.tileSize.w, 300, "layer.tileSize fixed to 300x300");
- t.ok( clone.grid != layer.grid, "clone does not copy grid");
-
- t.ok( clone.tileSize.equals(layer.tileSize), "tileSize correctly cloned");
-
- layer.tileSize.w += 40;
-
- t.eq( clone.alpha, layer.alpha, "alpha copied correctly");
-
- layer.grid = null;
- map.destroy();
- }
-
- function test_Layer_MapGuide_isBaseLayer(t) {
- t.plan(3);
-
- var options = {singleTile:true};
- layer = new OpenLayers.Layer.MapGuide(name, url, paramsUntiled, options);
- t.ok( layer.isBaseLayer, "baselayer is true by default");
-
- var newParams = OpenLayers.Util.extend({}, paramsUntiled);
- options.transparent = "true";
- layer = new OpenLayers.Layer.MapGuide(name, url, newParams, options);
- t.ok( !layer.isBaseLayer, "baselayer is false when transparent is set to true");
-
- newParams = OpenLayers.Util.extend({}, paramsUntiled);
- options.isBaseLayer = false;
- layer = new OpenLayers.Layer.MapGuide(name, url, newParams, options);
- t.ok( !layer.isBaseLayer, "baselayer is false when option is set to false" );
- }
-
- function test_Layer_MapGuide_mergeNewParams (t) {
- t.plan( 4 );
-
- var options = {singleTile:true};
- var map = new OpenLayers.Map("map");
- layer = new OpenLayers.Layer.MapGuide(name, url, paramsUntiled, options);
-
- var newParams = { mapDefinition: 'Library://Samples/Gmap/Maps/gmap.MapDefinition',
- chickpeas: 'image/png'};
-
- map.addLayer(layer);
- map.zoomToMaxExtent();
-
- layer.redraw = function() {
- t.ok(true, "layer is redrawn after new params merged");
- }
-
- layer.mergeNewParams(newParams);
-
- t.eq( layer.params.mapDefinition, "Library://Samples/Gmap/Maps/gmap.MapDefinition", "mergeNewParams() overwrites well");
- t.eq( layer.params.chickpeas, "image/png", "mergeNewParams() adds well");
-
- newParams.chickpeas = 151;
-
- t.eq( layer.params.chickpeas, "image/png", "mergeNewParams() makes clean copy of hashtable");
- map.destroy();
- }
-
- function test_Layer_MapGuide_destroy (t) {
-
- t.plan( 1 );
-
- var options = {singleTile:true};
- var map = new OpenLayers.Map('map');
- layer = new OpenLayers.Layer.MapGuide(name, url, paramsUntiled, options);
- map.addLayer(layer);
-
- map.setCenter(new OpenLayers.LonLat(0,0), 5);
-
- //grab a reference to one of the tiles
- var tile = layer.grid[0][0];
-
- layer.destroy();
-
- // checks to make sure superclass (grid) destroy() was called
-
- t.ok( layer.grid == null, "grid set to null");
- }
-
-
- </script>
-</head>
-<body>
-<div id="map" style="width:500px;height:550px"></div>
-</body>
-</html>