From ef00010111848d0c87b56d64448bcb3af842b9f5 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Sun, 27 Aug 2006 01:46:09 +0000 Subject: [PATCH] Multimap now conforms to other EventPane subclasses in expected behavior for some functions, and has tests available, so when I break it at some point, hopefully I'll know :) git-svn-id: http://svn.openlayers.org/trunk/openlayers@1389 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/MultiMap.js | 11 ++- tests/list-tests.html | 1 + tests/run-tests.html | 2 +- tests/test_Layer_MultiMap.html | 128 +++++++++++++++++++++++++++++++ 4 files changed, 139 insertions(+), 3 deletions(-) create mode 100644 tests/test_Layer_MultiMap.html diff --git a/lib/OpenLayers/Layer/MultiMap.js b/lib/OpenLayers/Layer/MultiMap.js index 8804c367a8..6a8b888b9f 100644 --- a/lib/OpenLayers/Layer/MultiMap.js +++ b/lib/OpenLayers/Layer/MultiMap.js @@ -237,7 +237,8 @@ OpenLayers.Layer.MultiMap.prototype = * @type int */ getOLZoomFromMMZoom: function(mmZoom) { - return mmZoom - 1; + if (mmZoom) return mmZoom - 1; + return null; }, /** @@ -248,7 +249,8 @@ OpenLayers.Layer.MultiMap.prototype = * @type int */ getMMZoomFromOLZoom: function(olZoom) { - return olZoom + 1; + if (olZoom) return olZoom + 1; + return null; }, // @@ -326,6 +328,11 @@ OpenLayers.Layer.MultiMap.prototype = return pixel; }, + destroy: function() { + this.multimap = null; + OpenLayers.Layer.EventPane.prototype.destroy.apply(this, arguments); + }, + /** @final @type String */ CLASS_NAME: "OpenLayers.Layer.MultiMap" }); diff --git a/tests/list-tests.html b/tests/list-tests.html index f199f0aa7f..d44c02a7a3 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -19,6 +19,7 @@
  • test_Layer_KaMap.html
  • test_Layer_WMS.html
  • test_Layer_Google.html
  • +
  • test_Layer_MultiMap.html
  • test_Tile.html
  • test_Tile_Image.html
  • test_Control.html
  • diff --git a/tests/run-tests.html b/tests/run-tests.html index a4cfbe87d1..7302498b6c 100644 --- a/tests/run-tests.html +++ b/tests/run-tests.html @@ -785,7 +785,7 @@ Test.AnotherWay._set_iframe_location=function( iframe, loc, outside_path_correct Test.AnotherWay._start_loading_page=function() { var test_page=Test.AnotherWay._g_tests_queue[0]; - test_page.loading_timeout_milliseconds=2000; + test_page.loading_timeout_milliseconds=4000; test_page.timeout_id=setTimeout( Test.AnotherWay._loading_timeout, Test.AnotherWay._g_timeout_granularity ); test_page.wait_msg=Test.AnotherWay._print_counter_result( test_page.url, "loading...", test_page.loading_timeout_milliseconds, "loading" ); if( test_page.convention=="jsan" ) { diff --git a/tests/test_Layer_MultiMap.html b/tests/test_Layer_MultiMap.html new file mode 100644 index 0000000000..251dc8302e --- /dev/null +++ b/tests/test_Layer_MultiMap.html @@ -0,0 +1,128 @@ + + + + + + + +
    + +