From 9011c8ca0a0bb8392b3db598c4ae46bdb8351a2d Mon Sep 17 00:00:00 2001 From: crschmidt Date: Fri, 20 Apr 2007 01:29:54 +0000 Subject: [PATCH] Tag 2.4-RC2. git-svn-id: http://svn.openlayers.org/tags/openlayers/release-2.4-rc2@3089 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- build/license.txt | 4 +- examples/image-layer.html | 5 +- examples/openmnnd.html | 26 +- examples/vector-features.html | 1 - examples/wfs-scribble.html | 4 +- examples/wfs-t.html | 6 +- examples/wkt.html | 4 +- lib/OpenLayers.js | 4 +- lib/OpenLayers/Ajax.js | 4 +- lib/OpenLayers/BaseTypes.js | 4 +- lib/OpenLayers/Control.js | 4 +- lib/OpenLayers/Control/ArgParser.js | 4 +- lib/OpenLayers/Control/DragPan.js | 4 +- lib/OpenLayers/Control/DrawFeature.js | 6 +- lib/OpenLayers/Control/EditingToolbar.js | 4 +- lib/OpenLayers/Control/KeyboardDefaults.js | 46 ++- lib/OpenLayers/Control/LayerSwitcher.js | 6 +- lib/OpenLayers/Control/MouseDefaults.js | 6 +- lib/OpenLayers/Control/MousePosition.js | 4 +- lib/OpenLayers/Control/MouseToolbar.js | 6 +- lib/OpenLayers/Control/NavToolbar.js | 4 +- lib/OpenLayers/Control/Navigation.js | 4 +- lib/OpenLayers/Control/OverviewMap.js | 9 +- lib/OpenLayers/Control/PanZoom.js | 6 +- lib/OpenLayers/Control/PanZoomBar.js | 6 +- lib/OpenLayers/Control/Panel.js | 4 +- lib/OpenLayers/Control/Permalink.js | 4 +- lib/OpenLayers/Control/Scale.js | 4 +- lib/OpenLayers/Control/SelectFeature.js | 79 ++--- lib/OpenLayers/Control/ZoomBox.js | 4 +- lib/OpenLayers/Control/ZoomToMaxExtent.js | 4 +- lib/OpenLayers/Events.js | 4 +- lib/OpenLayers/Feature.js | 4 +- lib/OpenLayers/Feature/Vector.js | 70 +--- lib/OpenLayers/Feature/WFS.js | 4 +- lib/OpenLayers/Format.js | 4 +- lib/OpenLayers/Format/GML.js | 6 +- lib/OpenLayers/Format/GeoRSS.js | 4 +- lib/OpenLayers/Format/KML.js | 6 +- lib/OpenLayers/Format/WFS.js | 4 +- lib/OpenLayers/Format/WKT.js | 4 +- lib/OpenLayers/Geometry.js | 13 +- lib/OpenLayers/Geometry/Collection.js | 12 +- lib/OpenLayers/Geometry/Curve.js | 4 +- lib/OpenLayers/Geometry/LineString.js | 4 +- lib/OpenLayers/Geometry/LinearRing.js | 4 +- lib/OpenLayers/Geometry/MultiLineString.js | 4 +- lib/OpenLayers/Geometry/MultiPoint.js | 4 +- lib/OpenLayers/Geometry/MultiPolygon.js | 4 +- lib/OpenLayers/Geometry/Point.js | 4 +- lib/OpenLayers/Geometry/Polygon.js | 4 +- lib/OpenLayers/Geometry/Rectangle.js | 4 +- lib/OpenLayers/Geometry/Surface.js | 4 +- lib/OpenLayers/Handler.js | 4 +- lib/OpenLayers/Handler/Box.js | 6 +- lib/OpenLayers/Handler/Drag.js | 25 +- lib/OpenLayers/Handler/Feature.js | 38 +-- lib/OpenLayers/Handler/Keyboard.js | 4 +- lib/OpenLayers/Handler/MouseWheel.js | 4 +- lib/OpenLayers/Handler/Path.js | 59 ++-- lib/OpenLayers/Handler/Point.js | 43 +-- lib/OpenLayers/Handler/Polygon.js | 43 +-- lib/OpenLayers/Icon.js | 4 +- lib/OpenLayers/Layer.js | 95 +++--- lib/OpenLayers/Layer/Boxes.js | 9 +- lib/OpenLayers/Layer/Canvas.js | 4 +- lib/OpenLayers/Layer/EventPane.js | 4 +- lib/OpenLayers/Layer/FixedZoomLevels.js | 4 +- lib/OpenLayers/Layer/GML.js | 4 +- lib/OpenLayers/Layer/GeoRSS.js | 4 +- lib/OpenLayers/Layer/Google.js | 4 +- lib/OpenLayers/Layer/Grid.js | 4 +- lib/OpenLayers/Layer/HTTPRequest.js | 7 +- lib/OpenLayers/Layer/Image.js | 55 +++- lib/OpenLayers/Layer/KaMap.js | 34 +- lib/OpenLayers/Layer/MapServer.js | 4 +- lib/OpenLayers/Layer/Markers.js | 4 +- lib/OpenLayers/Layer/MultiMap.js | 4 +- lib/OpenLayers/Layer/TMS.js | 4 +- lib/OpenLayers/Layer/Text.js | 4 +- lib/OpenLayers/Layer/Vector.js | 119 ++++--- lib/OpenLayers/Layer/VirtualEarth.js | 4 +- lib/OpenLayers/Layer/WFS.js | 17 +- lib/OpenLayers/Layer/WMS.js | 4 +- lib/OpenLayers/Layer/WMS/Untiled.js | 4 +- lib/OpenLayers/Layer/WorldWind.js | 4 +- lib/OpenLayers/Layer/Yahoo.js | 4 +- lib/OpenLayers/Map.js | 4 +- lib/OpenLayers/Marker.js | 4 +- lib/OpenLayers/Marker/Box.js | 15 +- lib/OpenLayers/Popup.js | 12 +- lib/OpenLayers/Popup/Anchored.js | 4 +- lib/OpenLayers/Popup/AnchoredBubble.js | 4 +- lib/OpenLayers/Renderer.js | 57 +++- lib/OpenLayers/Renderer/Elements.js | 74 ++--- lib/OpenLayers/Renderer/SVG.js | 183 +++++++++-- lib/OpenLayers/Renderer/VML.js | 49 +-- lib/OpenLayers/SingleFile.js | 4 +- lib/OpenLayers/Tile.js | 17 +- lib/OpenLayers/Tile/Image.js | 15 +- lib/OpenLayers/Tile/WFS.js | 15 +- lib/OpenLayers/Util.js | 6 +- repository-license.txt | 35 -- tests/Control/test_KeyboardDefaults.html | 107 ++++++ tests/Control/test_PanZoom.html | 73 ++++- tests/Feature/test_Vector.html | 1 - tests/Geometry/test_Collection.html | 13 +- tests/Layer/test_Image.html | 20 +- tests/Layer/test_KaMap.html | 4 +- tests/Layer/test_Vector.html | 75 ++++- tests/Layer/test_WFS.html | 37 +++ tests/Marker/test_Box.html | 362 +++++++++++++++++++++ tests/list-tests.html | 2 + tests/test_Geometry.html | 4 +- tests/test_Layer.html | 18 +- theme/default/style.css | 12 + tools/mergejs.py | 4 +- tools/release.sh | 2 +- 118 files changed, 1591 insertions(+), 730 deletions(-) delete mode 100644 repository-license.txt create mode 100644 tests/Control/test_KeyboardDefaults.html create mode 100644 tests/Layer/test_WFS.html create mode 100644 tests/Marker/test_Box.html diff --git a/build/license.txt b/build/license.txt index 7b91084f45..1a2ddfd9a8 100644 --- a/build/license.txt +++ b/build/license.txt @@ -2,8 +2,8 @@ OpenLayers.js -- OpenLayers Map Viewer Library - Copyright 2005-2006 MetaCarta, Inc., released under a modified BSD license. - Please see http://svn.openlayers.org/trunk/openlayers/repository-license.txt + Copyright 2005-2006 MetaCarta, Inc., released under a BSD license. + Please see http://svn.openlayers.org/trunk/openlayers/release-license.txt for the full text of the license. Includes compressed code under the following licenses: diff --git a/examples/image-layer.html b/examples/image-layer.html index 25ed41f2cd..bcfab86b0b 100644 --- a/examples/image-layer.html +++ b/examples/image-layer.html @@ -13,10 +13,11 @@ + + +
+ + diff --git a/tests/Control/test_PanZoom.html b/tests/Control/test_PanZoom.html index faf1e92d68..efd1b9b7e6 100644 --- a/tests/Control/test_PanZoom.html +++ b/tests/Control/test_PanZoom.html @@ -36,29 +36,84 @@ //ie can't simulate mouseclicks t.plan(0) } else { - t.plan( 7 ); + t.plan(35); t.open_window( "Control/test_PanZoom.html", function( wnd ) { t.delay_call( 3, function() { - simulateClick(wnd, wnd.control.buttons[0]); + var flag; + function setFlag(evt) { + flag[evt.type] = true; + } + function resetFlags() { + flag = { + mousedown: false, + mouseup: false, + click: false, + dblclick: false + }; + } + resetFlags(); + + wnd.mapper.events.register("mousedown", mapper, setFlag); + wnd.mapper.events.register("mouseup", mapper, setFlag); + wnd.mapper.events.register("click", mapper, setFlag); + wnd.mapper.events.register("dblclick", mapper, setFlag); + + simulateClick(wnd, wnd.control.buttons[0]); t.ok( wnd.mapper.getCenter().lat > wnd.centerLL.lat, "Pan up works correctly" ); + t.ok(!flag.mousedown, "mousedown does not get to the map"); + t.ok(!flag.mouseup, "mouseup does not get to the map"); + t.ok(!flag.click, "click does not get to the map"); + t.ok(!flag.dblclick, "dblclick does not get to the map"); + resetFlags(); simulateClick(wnd, wnd.control.buttons[1]); t.ok( wnd.mapper.getCenter().lon < wnd.centerLL.lon, "Pan left works correctly" ); + t.ok(!flag.mousedown, "mousedown does not get to the map"); + t.ok(!flag.mouseup, "mouseup does not get to the map"); + t.ok(!flag.click, "click does not get to the map"); + t.ok(!flag.dblclick, "dblclick does not get to the map"); + resetFlags(); simulateClick(wnd, wnd.control.buttons[2]); t.ok( wnd.mapper.getCenter().lon == wnd.centerLL.lon, "Pan right works correctly" ); + t.ok(!flag.mousedown, "mousedown does not get to the map"); + t.ok(!flag.mouseup, "mouseup does not get to the map"); + t.ok(!flag.click, "click does not get to the map"); + t.ok(!flag.dblclick, "dblclick does not get to the map"); + resetFlags(); simulateClick(wnd, wnd.control.buttons[3]); t.ok( wnd.mapper.getCenter().lat == wnd.centerLL.lat, "Pan down works correctly" ); + t.ok(!flag.mousedown, "mousedown does not get to the map"); + t.ok(!flag.mouseup, "mouseup does not get to the map"); + t.ok(!flag.click, "click does not get to the map"); + t.ok(!flag.dblclick, "dblclick does not get to the map"); + resetFlags(); simulateClick(wnd, wnd.control.buttons[4]); t.eq( wnd.mapper.getZoom(), 6, "zoomin works correctly" ); + t.ok(!flag.mousedown, "mousedown does not get to the map"); + t.ok(!flag.mouseup, "mouseup does not get to the map"); + t.ok(!flag.click, "click does not get to the map"); + t.ok(!flag.dblclick, "dblclick does not get to the map"); + resetFlags(); simulateClick(wnd, wnd.control.buttons[6]); t.eq( wnd.mapper.getZoom(), 5, "zoomout works correctly" ); + t.ok(!flag.mousedown, "mousedown does not get to the map"); + t.ok(!flag.mouseup, "mouseup does not get to the map"); + t.ok(!flag.click, "click does not get to the map"); + t.ok(!flag.dblclick, "dblclick does not get to the map"); + resetFlags(); simulateClick(wnd, wnd.control.buttons[5]); t.eq( wnd.mapper.getZoom(), 2, "zoomworld works correctly" ); + t.ok(!flag.mousedown, "mousedown does not get to the map"); + t.ok(!flag.mouseup, "mouseup does not get to the map"); + t.ok(!flag.click, "click does not get to the map"); + t.ok(!flag.dblclick, "dblclick does not get to the map"); + resetFlags(); + }); }); } @@ -67,7 +122,19 @@ function simulateClick(wnd, elem) { var evt = wnd.document.createEvent("MouseEvents"); evt.initMouseEvent("mousedown", true, true, wnd, 0, 0, 0, 0, 0, false, false, false, false, 0, null); - var canceled = !elem.dispatchEvent(evt); + elem.dispatchEvent(evt); + + evt = wnd.document.createEvent("MouseEvents"); + evt.initMouseEvent("mouseup", true, true, wnd, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + elem.dispatchEvent(evt); + + evt = wnd.document.createEvent("MouseEvents"); + evt.initMouseEvent("click", true, true, wnd, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + elem.dispatchEvent(evt); + + evt = wnd.document.createEvent("MouseEvents"); + evt.initMouseEvent("dblclick", true, true, wnd, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + elem.dispatchEvent(evt); } function loader() { diff --git a/tests/Feature/test_Vector.html b/tests/Feature/test_Vector.html index 7f3810f608..52e83e22ce 100644 --- a/tests/Feature/test_Vector.html +++ b/tests/Feature/test_Vector.html @@ -2,7 +2,6 @@ + + +
+ + diff --git a/tests/Marker/test_Box.html b/tests/Marker/test_Box.html new file mode 100644 index 0000000000..066cf4197e --- /dev/null +++ b/tests/Marker/test_Box.html @@ -0,0 +1,362 @@ + + + + + + +
+ + + + + + + + +
+ + diff --git a/tests/list-tests.html b/tests/list-tests.html index 3f8bb3fc58..d8104a89e4 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -20,6 +20,7 @@
  • Format/test_WKT.html
  • test_Icon.html
  • test_Marker.html
  • +
  • Marker/test_Box.html
  • test_Popup.html
  • test_Feature.html
  • Feature/test_Vector.html
  • @@ -41,6 +42,7 @@
  • Layer/test_MapServer_Untiled.html
  • Layer/test_Text.html
  • Layer/test_WMS.html
  • +
  • Layer/test_WFS.html
  • Layer/test_TMS.html
  • Layer/test_Vector.html
  • Layer/test_GML.html
  • diff --git a/tests/test_Geometry.html b/tests/test_Geometry.html index 8919ae6d31..3d099446f1 100644 --- a/tests/test_Geometry.html +++ b/tests/test_Geometry.html @@ -178,11 +178,10 @@ } function test_99_Geometry_destroy(t) { - t.plan( 3 ); + t.plan( 2 ); var g = new OpenLayers.Geometry(); g.bounds = new OpenLayers.Bounds(); - g.feature = new Object(); g_style_destroy = null; g.destroy(); @@ -190,7 +189,6 @@ t.eq(g.id, null, "id nullified"); t.eq(g.bounds, null, "bounds nullified"); - t.eq(g.feature, null, "feature reference nullified"); } diff --git a/tests/test_Layer.html b/tests/test_Layer.html index 7767e80945..920f4706bb 100644 --- a/tests/test_Layer.html +++ b/tests/test_Layer.html @@ -118,7 +118,7 @@ function test_05_Layer_visibility(t) { - t.plan(3) + t.plan(5) var layer = new OpenLayers.Layer('Test Layer'); @@ -129,6 +129,22 @@ layer.setVisibility(true); t.eq(layer.getVisibility(), true, "setVisibility true works"); + + // Need a map in order to have moveTo called. + // Tests added for #654. + var layer = new OpenLayers.Layer.WMS('Test Layer','http://example.com'); + var m = new OpenLayers.Map('map'); + m.addLayer(layer); + m.zoomToMaxExtent(); + + layermoved = false; + layer.moveTo = function() { layermoved = true; } + + layer.setVisibility(false); + t.eq(layermoved, false, "Layer didn't move when calling setvis false"); + + layer.setVisibility(true); + t.eq(layermoved, true, "Layer moved when calling setvis true."); } diff --git a/theme/default/style.css b/theme/default/style.css index b1e6cc32f6..ba75a09daf 100644 --- a/theme/default/style.css +++ b/theme/default/style.css @@ -89,16 +89,20 @@ div.olControlMousePosition { .olControlNavToolbar .olControlNavigationItemActive { background-image: url("img/panning-hand-on.png"); + background-repeat: no-repeat; } .olControlNavToolbar .olControlNavigationItemInactive { background-image: url("img/panning-hand-off.png"); + background-repeat: no-repeat; } .olControlNavToolbar .olControlZoomBoxItemActive { background-image: url("img/drag-rectangle-on.png"); background-color: orange; + background-repeat: no-repeat; } .olControlNavToolbar .olControlZoomBoxItemInactive { background-image: url("img/drag-rectangle-off.png"); + background-repeat: no-repeat; } .olControlEditingToolbar { float:right; @@ -114,25 +118,33 @@ div.olControlMousePosition { } .olControlEditingToolbar .olControlNavigationItemActive { background-image: url("img/pan_on.png"); + background-repeat: no-repeat; } .olControlEditingToolbar .olControlNavigationItemInactive { background-image: url("img/pan_off.png"); + background-repeat: no-repeat; } .olControlEditingToolbar .olControlDrawFeaturePointItemActive { background-image: url("img/draw_point_on.png"); + background-repeat: no-repeat; } .olControlEditingToolbar .olControlDrawFeaturePointItemInactive { background-image: url("img/draw_point_off.png"); + background-repeat: no-repeat; } .olControlEditingToolbar .olControlDrawFeaturePathItemInactive { background-image: url("img/draw_line_off.png"); + background-repeat: no-repeat; } .olControlEditingToolbar .olControlDrawFeaturePathItemActive { background-image: url("img/draw_line_on.png"); + background-repeat: no-repeat; } .olControlEditingToolbar .olControlDrawFeaturePolygonItemInactive { background-image: url("img/draw_polygon_off.png"); + background-repeat: no-repeat; } .olControlEditingToolbar .olControlDrawFeaturePolygonItemActive { background-image: url("img/draw_polygon_on.png"); + background-repeat: no-repeat; } diff --git a/tools/mergejs.py b/tools/mergejs.py index 23acf81b4e..7dafd25785 100755 --- a/tools/mergejs.py +++ b/tools/mergejs.py @@ -117,9 +117,9 @@ class Config: """ Parses the content of the named file and stores the values. """ - lines = [line[:-1] # Assumes end-of-line character is present + lines = [line.strip() # Assumes end-of-line character is present for line in open(filename) - if line != "\n"] # Skip blank lines + if line.strip()] # Skip blank lines self.forceFirst = lines[lines.index("[first]") + 1:lines.index("[last]")] diff --git a/tools/release.sh b/tools/release.sh index 7c9e230586..e58ad3c4b0 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -3,7 +3,7 @@ VERSION=$1 echo "Building OpenLayers $VERSION" svn export http://svn.openlayers.org/tags/openlayers/release-$VERSION OpenLayers-$VERSION cd OpenLayers-$VERSION/build -./build.sh +./build.py full mkdir /www/openlayers/htdocs/api/$VERSION cp OpenLayers.js /www/openlayers/htdocs/api/$VERSION cd ..