From 2624ea089ec66d7f16aef5e8a6e58e9b600c2a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Wed, 16 May 2012 21:10:08 +0200 Subject: [PATCH 1/6] set VERSION_NUMBER to 2.12-rc4 --- lib/OpenLayers.js | 2 +- lib/OpenLayers/SingleFile.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index 24c7d0e8b5..b38c036bf6 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -414,4 +414,4 @@ /** * Constant: VERSION_NUMBER */ -OpenLayers.VERSION_NUMBER="Release 2.12-rc3"; +OpenLayers.VERSION_NUMBER="Release 2.12-rc4"; diff --git a/lib/OpenLayers/SingleFile.js b/lib/OpenLayers/SingleFile.js index 53060cc956..d3f7179301 100644 --- a/lib/OpenLayers/SingleFile.js +++ b/lib/OpenLayers/SingleFile.js @@ -7,7 +7,7 @@ var OpenLayers = { /** * Constant: VERSION_NUMBER */ - VERSION_NUMBER: "Release 2.12-rc3", + VERSION_NUMBER: "Release 2.12-rc4", /** * Constant: singleFile From f435a98a2aa003b33b47f21e8f410875377364ad Mon Sep 17 00:00:00 2001 From: Peter Robins Date: Thu, 17 May 2012 16:48:43 +0100 Subject: [PATCH 2/6] Fix Google terms/poweredby/popup --- lib/OpenLayers/Layer/Google/v3.js | 44 +++++++++++++++++-------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/lib/OpenLayers/Layer/Google/v3.js b/lib/OpenLayers/Layer/Google/v3.js index 57b024dd74..777f6e7d67 100644 --- a/lib/OpenLayers/Layer/Google/v3.js +++ b/lib/OpenLayers/Layer/Google/v3.js @@ -137,27 +137,31 @@ OpenLayers.Layer.Google.v3 = { var cache = OpenLayers.Layer.Google.cache[this.map.id]; var container = this.map.viewPortDiv; - // move the Map Data popup to the container, if any - while (div.lastChild.style.display == "none") { - container.appendChild(div.lastChild); - } - // move the ToS and branding stuff up to the container div - var termsOfUse = div.lastChild; - container.appendChild(termsOfUse); - termsOfUse.style.zIndex = "1100"; - termsOfUse.style.bottom = ""; - termsOfUse.className = "olLayerGoogleCopyright olLayerGoogleV3"; - termsOfUse.style.display = ""; - cache.termsOfUse = termsOfUse; - - var poweredBy = div.lastChild; - container.appendChild(poweredBy); - poweredBy.style.zIndex = "1100"; - poweredBy.style.bottom = ""; - poweredBy.className = "olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint"; - poweredBy.style.display = ""; - cache.poweredBy = poweredBy; + // depends on value of zIndex, which is not robust + for (var i=div.children.length-1; i>=0; --i) { + if (div.children[i].style.zIndex == 1000001) { + var termsOfUse = div.children[i]; + container.appendChild(termsOfUse); + termsOfUse.style.zIndex = "1100"; + termsOfUse.style.bottom = ""; + termsOfUse.className = "olLayerGoogleCopyright olLayerGoogleV3"; + termsOfUse.style.display = ""; + cache.termsOfUse = termsOfUse; + } + if (div.children[i].style.zIndex == 1000000) { + var poweredBy = div.children[i]; + container.appendChild(poweredBy); + poweredBy.style.zIndex = "1100"; + poweredBy.style.bottom = ""; + poweredBy.className = "olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint"; + poweredBy.style.display = ""; + cache.poweredBy = poweredBy; + } + if (div.children[i].style.zIndex == 10000002) { + container.appendChild(div.children[i]); + } + } this.setGMapVisibility(this.visibility); From a612302a117365284d9da43d7aaabdceb24b6119 Mon Sep 17 00:00:00 2001 From: tschaub Date: Thu, 17 May 2012 11:06:21 -0600 Subject: [PATCH 3/6] Demonstrating the use of MapQuest tiles in OL. --- examples/mapquest.html | 28 ++++++++++++++++++++++++++++ examples/mapquest.js | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 examples/mapquest.html create mode 100644 examples/mapquest.js diff --git a/examples/mapquest.html b/examples/mapquest.html new file mode 100644 index 0000000000..0fc02ec9e6 --- /dev/null +++ b/examples/mapquest.html @@ -0,0 +1,28 @@ + + + + + + + OpenLayers MapQuest Demo + + + + +

OpenLayers with MapQuest Tiles

+
+ This example demonstrates the use of MapQuest tiles with OpenLayers. +
+
+ MapQuest, OSM, XYZ +
+
+
+

+ See the mapquest.js source for + detail on using MapQuest tiles in OpenLayers. +

+
+ + + \ No newline at end of file diff --git a/examples/mapquest.js b/examples/mapquest.js new file mode 100644 index 0000000000..708cfdc4ad --- /dev/null +++ b/examples/mapquest.js @@ -0,0 +1,36 @@ +var map = new OpenLayers.Map({ + div: "map", + projection: "EPSG:900913", + layers: [ + new OpenLayers.Layer.XYZ( + "OpenStreetMap", + [ + "http://otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png", + "http://otile2.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png", + "http://otile3.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png", + "http://otile4.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png" + ], + { + attribution: "Tiles Courtesy of MapQuest ", + transitionEffect: "resize" + } + ), + new OpenLayers.Layer.XYZ( + "Imagery", + [ + "http://oatile1.mqcdn.com/naip/${z}/${x}/${y}.png", + "http://oatile2.mqcdn.com/naip/${z}/${x}/${y}.png", + "http://oatile3.mqcdn.com/naip/${z}/${x}/${y}.png", + "http://oatile4.mqcdn.com/naip/${z}/${x}/${y}.png" + ], + { + attribution: "Tiles Courtesy of MapQuest ", + transitionEffect: "resize" + } + ) + ], + center: [0, 0], + zoom: 1 +}); + +map.addControl(new OpenLayers.Control.LayerSwitcher()); \ No newline at end of file From 120cc0680daad4617d815e70ae207d988085343f Mon Sep 17 00:00:00 2001 From: ahocevar Date: Fri, 18 May 2012 12:38:34 +0200 Subject: [PATCH 4/6] Using display:block instead of position:absolute. This fixes a regression that can be seen e.g. when using the FeatureRenderer in GeoExt, causing an incorrect alignment of the renderer. --- lib/OpenLayers/Renderer/SVG.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Renderer/SVG.js b/lib/OpenLayers/Renderer/SVG.js index ecaac9e27f..fece8890cd 100644 --- a/lib/OpenLayers/Renderer/SVG.js +++ b/lib/OpenLayers/Renderer/SVG.js @@ -447,7 +447,7 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, { */ createRenderRoot: function() { var svg = this.nodeFactory(this.container.id + "_svgRoot", "svg"); - svg.style.position = "absolute"; + svg.style.display = "block"; return svg; }, From a997334816f8e2ca588cf9e600a8685287972ea3 Mon Sep 17 00:00:00 2001 From: Pierre GIRAUD Date: Mon, 21 May 2012 11:13:48 +0200 Subject: [PATCH 5/6] Adding support support for metaKey (Mac Cmd key) --- lib/OpenLayers/Handler.js | 15 +++++++++++---- tests/Handler.html | 16 ++++++++++------ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/lib/OpenLayers/Handler.js b/lib/OpenLayers/Handler.js index ae4c3c0719..8efcaf866b 100644 --- a/lib/OpenLayers/Handler.js +++ b/lib/OpenLayers/Handler.js @@ -139,7 +139,8 @@ OpenLayers.Handler = OpenLayers.Class({ var keyModifiers = (evt.shiftKey ? OpenLayers.Handler.MOD_SHIFT : 0) | (evt.ctrlKey ? OpenLayers.Handler.MOD_CTRL : 0) | - (evt.altKey ? OpenLayers.Handler.MOD_ALT : 0); + (evt.altKey ? OpenLayers.Handler.MOD_ALT : 0) | + (evt.metaKey ? OpenLayers.Handler.MOD_META : 0); /* if it differs from the handler object's key mask, bail out of the event handler */ @@ -232,12 +233,12 @@ OpenLayers.Handler = OpenLayers.Class({ * to get more information about the event that the handler is * processing. * - * This allows modifier keys on the event to be checked (alt, shift, - * and ctrl cannot be checked with the keyboard handler). For a + * This allows modifier keys on the event to be checked (alt, shift, ctrl, + * and meta cannot be checked with the keyboard handler). For a * control to determine which modifier keys are associated with the * event that a handler is currently processing, it should access * (code)handler.evt.altKey || handler.evt.shiftKey || - * handler.evt.ctrlKey(end). + * handler.evt.ctrlKey || handler.evt.metaKey(end). * * Parameters: * evt - {Event} The browser event. @@ -285,4 +286,10 @@ OpenLayers.Handler.MOD_CTRL = 2; */ OpenLayers.Handler.MOD_ALT = 4; +/** + * Constant: OpenLayers.Handler.MOD_META + * If set as the , returns false if Cmd is down. + */ +OpenLayers.Handler.MOD_META = 8; + diff --git a/tests/Handler.html b/tests/Handler.html index a20ffbb657..eb266d7307 100644 --- a/tests/Handler.html +++ b/tests/Handler.html @@ -123,7 +123,7 @@ } function test_Handler_setEvent(t) { - t.plan(4); + t.plan(5); var map = new OpenLayers.Map('map'); var control = new OpenLayers.Control(); map.addControl(control); @@ -135,7 +135,8 @@ xy: new OpenLayers.Pixel(Math.random(), Math.random()), altKey: (Math.random() > 0.5), shiftKey: (Math.random() > 0.5), - ctrlKey: (Math.random() > 0.5) + ctrlKey: (Math.random() > 0.5), + metaKey: (Math.random() > 0.5) } map.events.triggerEvent("click", testEvent); t.ok(handler.evt.xy.x == testEvent.xy.x && @@ -147,6 +148,8 @@ "handler.evt.shiftKey correct"); t.eq(handler.evt.ctrlKey, testEvent.ctrlKey, "handler.evt.ctrlKey correct"); + t.eq(handler.evt.metaKey, testEvent.metaKey, + "handler.evt.metaKey correct"); } function test_Handler_destroy(t) { @@ -173,7 +176,7 @@ } function test_Handler_checkModifiers(t) { - t.plan(26); + t.plan(62); var handler = new OpenLayers.Handler({}); handler.keyMask = null; var proceed = handler.checkModifiers({}); @@ -192,7 +195,8 @@ MOD_NONE: null, MOD_SHIFT: "shiftKey", MOD_CTRL: "ctrlKey", - MOD_ALT: "altKey" + MOD_ALT: "altKey", + MOD_META: "metaKey" } var proceed, evt, value, c, k; for(c in constants) { @@ -220,8 +224,8 @@ * is OpenLayers.Handler.MOD_SHIFT, checkModifiers should return * true. */ - var constants = ["MOD_SHIFT", "MOD_CTRL", "MOD_ALT"]; - var keys = ["shiftKey", "ctrlKey", "altKey"]; + var constants = ["MOD_SHIFT", "MOD_CTRL", "MOD_ALT", "MOD_META"]; + var keys = ["shiftKey", "ctrlKey", "altKey", "metaKey"]; var proceed, evt, c1, c2, k1, k2; for(var i=0; i Date: Tue, 22 May 2012 13:36:08 +0200 Subject: [PATCH 6/6] Small spelling corrections in the documentation. --- lib/OpenLayers/Format/ArcXML.js | 2 +- lib/OpenLayers/Format/ArcXML/Features.js | 2 +- lib/OpenLayers/Format/Filter.js | 2 +- lib/OpenLayers/Format/GML.js | 2 +- lib/OpenLayers/Format/SLD.js | 2 +- lib/OpenLayers/Format/XLS.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/OpenLayers/Format/ArcXML.js b/lib/OpenLayers/Format/ArcXML.js index e0affcee03..038ed87c18 100644 --- a/lib/OpenLayers/Format/ArcXML.js +++ b/lib/OpenLayers/Format/ArcXML.js @@ -13,7 +13,7 @@ /** * Class: OpenLayers.Format.ArcXML - * Read/Wite ArcXML. Create a new instance with the + * Read/Write ArcXML. Create a new instance with the * constructor. * * Inherits from: diff --git a/lib/OpenLayers/Format/ArcXML/Features.js b/lib/OpenLayers/Format/ArcXML/Features.js index dc01a4a439..6c8945dbe2 100644 --- a/lib/OpenLayers/Format/ArcXML/Features.js +++ b/lib/OpenLayers/Format/ArcXML/Features.js @@ -9,7 +9,7 @@ /** * Class: OpenLayers.Format.ArcXML.Features - * Read/Wite ArcXML features. Create a new instance with the + * Read/Write ArcXML features. Create a new instance with the * constructor. * * Inherits from: diff --git a/lib/OpenLayers/Format/Filter.js b/lib/OpenLayers/Format/Filter.js index 664b29446c..c8dd36151d 100644 --- a/lib/OpenLayers/Format/Filter.js +++ b/lib/OpenLayers/Format/Filter.js @@ -12,7 +12,7 @@ /** * Class: OpenLayers.Format.Filter - * Read/Wite ogc:Filter. Create a new instance with the + * Read/Write ogc:Filter. Create a new instance with the * constructor. * * Inherits from: diff --git a/lib/OpenLayers/Format/GML.js b/lib/OpenLayers/Format/GML.js index eb39180947..073eae0a1c 100644 --- a/lib/OpenLayers/Format/GML.js +++ b/lib/OpenLayers/Format/GML.js @@ -16,7 +16,7 @@ /** * Class: OpenLayers.Format.GML - * Read/Wite GML. Create a new instance with the + * Read/Write GML. Create a new instance with the * constructor. Supports the GML simple features profile. * * Inherits from: diff --git a/lib/OpenLayers/Format/SLD.js b/lib/OpenLayers/Format/SLD.js index 274c5bb781..1bbce4766d 100644 --- a/lib/OpenLayers/Format/SLD.js +++ b/lib/OpenLayers/Format/SLD.js @@ -15,7 +15,7 @@ /** * Class: OpenLayers.Format.SLD - * Read/Wite SLD. Create a new instance with the + * Read/Write SLD. Create a new instance with the * constructor. * * Inherits from: diff --git a/lib/OpenLayers/Format/XLS.js b/lib/OpenLayers/Format/XLS.js index 118b26d565..d0347f8596 100644 --- a/lib/OpenLayers/Format/XLS.js +++ b/lib/OpenLayers/Format/XLS.js @@ -9,7 +9,7 @@ /** * Class: OpenLayers.Format.XLS - * Read/Wite XLS (OpenLS). Create a new instance with the + * Read/Write XLS (OpenLS). Create a new instance with the * constructor. Currently only implemented for Location Utility Services, more * specifically only for Geocoding. No support for Reverse Geocoding as yet. *