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 ..