From 5f69105e08f4d0a16dbcc2e731d51fb603234a6c Mon Sep 17 00:00:00 2001 From: crschmidt Date: Mon, 23 May 2011 15:45:07 +0000 Subject: [PATCH 001/141] Updated tools for releasing. git-svn-id: http://svn.openlayers.org/trunk/openlayers@11998 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tools/branch.sh | 5 +++++ tools/rc.sh | 13 +++++++++++++ tools/release.sh | 14 +++++++------- 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100755 tools/branch.sh create mode 100755 tools/rc.sh diff --git a/tools/branch.sh b/tools/branch.sh new file mode 100755 index 0000000000..ec07d02e32 --- /dev/null +++ b/tools/branch.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +RELEASE=$1 + +svn copy -m "Branching for the $RELEASE release" http://svn.openlayers.org/trunk/openlayers http://svn.openlayers.org/branches/openlayers/$RELEASE diff --git a/tools/rc.sh b/tools/rc.sh new file mode 100755 index 0000000000..73b1835abb --- /dev/null +++ b/tools/rc.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +RELEASE=$1 +RC=$2 + +svn co http://svn.openlayers.org/branches/openlayers/$RELEASE +cd $RELEASE +sed -i -e "s/OpenLayers.VERSION_NUMBER=.*/OpenLayers.VERSION_NUMBER=\"Release $1-$2\";/" lib/OpenLayers.js +sed -i -e "s/VERSION_NUMBER: .*,/VERSION_NUMBER: \"Release $1-$2\",/" lib/OpenLayers/SingleFile.js +svn diff; +sleep 10; +svn ci -m "Updating version numbers for $1-$2". +svn cp -m "Tagging the $1-$2 release." http://svn.openlayers.org/branches/openlayers/$1 http://svn.openlayers.org/tags/openlayers/release-$1-$2 diff --git a/tools/release.sh b/tools/release.sh index 307b3f46a7..85124e8790 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -24,17 +24,17 @@ mkdir doc/devdocs mkdir doc/apidocs rm tools/*.pyc -mkdir /www/openlayers/htdocs/api/$VERSION -cp OpenLayers.js /www/openlayers/htdocs/api/$VERSION -cp -a img/ /www/openlayers/htdocs/api/$VERSION -cp -a theme/ /www/openlayers/htdocs/api/$VERSION +mkdir /osgeo/openlayers/docs/api/$VERSION +cp OpenLayers.js /osgeo/openlayers/docs/api/$VERSION +cp -a img/ /osgeo/openlayers/docs/api/$VERSION +cp -a theme/ /osgeo/openlayers/docs/api/$VERSION cd .. -~/nd/NaturalDocs -i OpenLayers-$VERSION/lib -o HTML OpenLayers-$VERSION/doc/devdocs -p OpenLayers-$VERSION/doc_config -s Small OL -~/nd/NaturalDocs -i OpenLayers-$VERSION/lib -o HTML OpenLayers-$VERSION/doc/apidocs -p OpenLayers-$VERSION/apidoc_config -s Small OL +naturaldocs -i OpenLayers-$VERSION/lib -o HTML OpenLayers-$VERSION/doc/devdocs -p OpenLayers-$VERSION/doc_config -s Small OL +naturaldocs -i OpenLayers-$VERSION/lib -o HTML OpenLayers-$VERSION/doc/apidocs -p OpenLayers-$VERSION/apidoc_config -s Small OL tar cvfz OpenLayers-$VERSION.tar.gz OpenLayers-$VERSION/ zip -9r OpenLayers-$VERSION.zip OpenLayers-$VERSION/ -cp OpenLayers-$VERSION.* /www/openlayers/htdocs/download +cp OpenLayers-$VERSION.* /osgeo/openlayers/docs/download From 0c943fb5e067dd1d637abd452715a430588b1e85 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 23 May 2011 21:27:54 +0000 Subject: [PATCH 002/141] adding note about attribution git-svn-id: http://svn.openlayers.org/trunk/openlayers@11999 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Bing.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Layer/Bing.js b/lib/OpenLayers/Layer/Bing.js index 277e8d1f86..395a5d6b9c 100644 --- a/lib/OpenLayers/Layer/Bing.js +++ b/lib/OpenLayers/Layer/Bing.js @@ -11,7 +11,9 @@ * Class: OpenLayers.Layer.Bing * Bing layer using direct tile access as provided by Bing Maps REST Services. * See http://msdn.microsoft.com/en-us/library/ff701713.aspx for more - * information. + * information. Note: Terms of Service compliant use requires the map to be + * configured with an control and the + * attribution placed on or near the map. * * Inherits from: * - From 275889aa1ad4f117f210e087881fdf6527f5e0ca Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 23 May 2011 21:42:09 +0000 Subject: [PATCH 003/141] New GoogleNG layer using tiles from the v3 API's mapType::getTile method. r=bartvde (closes #3312) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12000 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/google-ng.html | 42 ++++++ examples/google-ng.js | 28 ++++ lib/OpenLayers.js | 2 + lib/OpenLayers/Layer/GoogleNG.js | 239 +++++++++++++++++++++++++++++++ lib/OpenLayers/Tile.js | 4 +- lib/OpenLayers/Tile/Google.js | 151 +++++++++++++++++++ tests/Layer/GoogleNG.html | 96 +++++++++++++ tests/Tile/Google.html | 74 ++++++++++ tests/list-tests.html | 2 + theme/default/style.css | 13 ++ 10 files changed, 650 insertions(+), 1 deletion(-) create mode 100644 examples/google-ng.html create mode 100644 examples/google-ng.js create mode 100644 lib/OpenLayers/Layer/GoogleNG.js create mode 100644 lib/OpenLayers/Tile/Google.js create mode 100644 tests/Layer/GoogleNG.html create mode 100644 tests/Tile/Google.html diff --git a/examples/google-ng.html b/examples/google-ng.html new file mode 100644 index 0000000000..5462c84d29 --- /dev/null +++ b/examples/google-ng.html @@ -0,0 +1,42 @@ + + + + + + OpenLayers Google NG Layer Example + + + + + + + + + +

Google NG Layer Example

+
+ Google, api key, apikey +
+

+ Demonstrate use of tiles from the Google Maps v3 API. +

+
+
+

+ If you use OpenLayers.Layer.GoogleNG, the getTile method of the + GMaps v3 API's MapType is used to load tiles. This allows for + better integration than interacting with a whole map generated + by a google.maps.Map instance, as done with + OpenLayers.Layer.Google. See the + google-ng.js source + to see how this is done. +

+
+ + diff --git a/examples/google-ng.js b/examples/google-ng.js new file mode 100644 index 0000000000..fa2ba35b25 --- /dev/null +++ b/examples/google-ng.js @@ -0,0 +1,28 @@ +var map; + +function init() { + map = new OpenLayers.Map('map'); + map.addControl(new OpenLayers.Control.LayerSwitcher()); + + var gphy = new OpenLayers.Layer.GoogleNG( + {type: google.maps.MapTypeId.TERRAIN} + ); + var gmap = new OpenLayers.Layer.GoogleNG( + // ROADMAP, the default + ); + var ghyb = new OpenLayers.Layer.GoogleNG( + {type: google.maps.MapTypeId.HYBRID} + ); + var gsat = new OpenLayers.Layer.GoogleNG( + {type: google.maps.MapTypeId.SATELLITE} + ); + + map.addLayers([gphy, gmap, ghyb, gsat]); + + // GoogleNG uses EPSG:900913 as projection, so we have to + // transform our coordinates + map.setCenter(new OpenLayers.LonLat(10.2, 48.9).transform( + new OpenLayers.Projection("EPSG:4326"), + map.getProjectionObject() + ), 5); +} diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index a9061c93b0..82249753f7 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -120,6 +120,7 @@ "OpenLayers/Marker/Box.js", "OpenLayers/Popup.js", "OpenLayers/Tile.js", + "OpenLayers/Tile/Google.js", "OpenLayers/Tile/Image.js", "OpenLayers/Tile/Image/IFrame.js", "OpenLayers/Tile/WFS.js", @@ -152,6 +153,7 @@ "OpenLayers/Layer/Boxes.js", "OpenLayers/Layer/XYZ.js", "OpenLayers/Layer/Bing.js", + "OpenLayers/Layer/GoogleNG.js", "OpenLayers/Layer/TMS.js", "OpenLayers/Layer/TileCache.js", "OpenLayers/Layer/Zoomify.js", diff --git a/lib/OpenLayers/Layer/GoogleNG.js b/lib/OpenLayers/Layer/GoogleNG.js new file mode 100644 index 0000000000..7dc9e986f2 --- /dev/null +++ b/lib/OpenLayers/Layer/GoogleNG.js @@ -0,0 +1,239 @@ +/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the Clear BSD license. + * See http://svn.openlayers.org/trunk/openlayers/license.txt for the + * full text of the license. */ + +/** + * @requires OpenLayers/Layer/XYZ.js + */ + +/** + * Class: OpenLayers.Layer.GoogleNG + * Google layer using tiles. Note: Terms of Service + * compliant use requires the map to be configured with an + * control and the attribution placed on or + * near the map. + * + * Inherits from: + * - + */ +OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { + + /** + * Property: SUPPORTED_TRANSITIONS + * {Array} An immutable (that means don't change it!) list of supported + * transitionEffect values. This layer type supports none. + */ + SUPPORTED_TRANSITIONS: [], + + /** + * Property: attributionTemplate + * {String} + */ + attributionTemplate: '' + + '
' + + '
' + + 'Map data - ' + + 'Terms of Use
', + + /** + * Property: mapTypes + * {Object} mapping of {google.maps.MapTypeId} to the t param of + * http://maps.google.com/maps? permalinks + */ + mapTypes: { + "roadmap": "m", + "satellite": "k", + "hybrid": "h", + "terrain": "p" + }, + + /** + * Property: mapObject + * {google.maps.Map} Shared GMaps instance - will be set on the prototype + * upon instantiation of the 1st GoogleNG layer + */ + mapObject: null, + + /** + * APIProperty: type + * {google.maps.MapTypeId} See + * http://code.google.com/apis/maps/documentation/javascript/reference.html#MapTypeId + */ + type: null, + + /** + * Constructor: OpenLayers.Layer.GoogleNG + * Create a new GoogleNG layer. Requires the GMaps v3 JavaScript API script + * included in the html document. + * + * Example: + * (code) + * var terrain = new OpenLayers.Layer.GoogleNG({ + * name: "Google Terrain", + * type: google.maps.MapTypeId.TERRAIN + * }); + * (end) + * + * Parameters: + * options - {Object} Configuration properties for the layer. + * + * Required configuration properties: + * type - {google.maps.MapTypeId} The layer identifier. See + * http://code.google.com/apis/maps/documentation/javascript/reference.html#MapTypeId + * for valid types. + * + * Any other documented layer properties can be provided in the config object. + */ + initialize: function(options) { + options = OpenLayers.Util.applyDefaults({ + sphericalMercator: true + }, options); + + if (!options.type) { + options.type = google.maps.MapTypeId.ROADMAP; + } + var newArgs = [options.name, null, options]; + OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs); + + this.options.numZoomLevels = options.numZoomLevels; + if (!this.mapObject) { + OpenLayers.Layer.GoogleNG.prototype.mapObject = + new google.maps.Map(document.createElement("div")); + } + if (this.mapObject.mapTypes[this.type]) { + this.initLayer(); + } else { + google.maps.event.addListenerOnce( + this.mapObject, + "idle", + OpenLayers.Function.bind(this.initLayer, this) + ); + } + }, + + /** + * Method: initLayer + * + * Sets layer properties according to the metadata provided by the API + */ + initLayer: function() { + var mapType = this.mapObject.mapTypes[this.type]; + if (!this.name) { + this.setName("Google " + mapType.name); + } + + var numZoomLevels = mapType.maxZoom + 1; + if (this.options.numZoomLevels != null) { + numZoomLevels = Math.min(numZoomLevels, this.options.numZoomLevels); + } + var restrictedMinZoom; + if (this.restrictedMinZoom || mapType.minZoom) { + restrictedMinZoom = Math.max( + mapType.minZoom || 0, this.restrictedMinZoom || 0 + ); + } + + this.addOptions({ + restrictedMinZoom: restrictedMinZoom, + numZoomLevels: numZoomLevels, + tileSize: new OpenLayers.Size( + mapType.tileSize.width, mapType.tileSize.height + ) + }); + // redraw to populate tiles with content + this.redraw(); + }, + + /** + * APIMethod: addTile + * Create a tile, initialize it, and add it to the layer div. + * + * Parameters + * bounds - {} + * position - {} + * + * Returns: + * {} The added OpenLayers.Tile.Google + */ + addTile:function(bounds, position) { + return new OpenLayers.Tile.Google( + this, position, bounds, this.tileOptions + ); + }, + + /** + * Method: updateAttribution + * Updates the attribution using the + */ + updateAttribution: function() { + var center = this.map.getCenter(); + center && center.transform( + this.map.getProjectionObject(), + new OpenLayers.Projection("EPSG:4326") + ); + var size = this.map.getSize(); + this.attribution = OpenLayers.String.format(this.attributionTemplate, { + center: center ? center.lat + "," + center.lon : "", + zoom: this.map.getZoom(), + size: size.w + "x" + size.h, + t: this.mapTypes[this.type], + mapType: this.type + }); + this.map && this.map.events.triggerEvent("changelayer", {layer: this}); + }, + + /** + * Method: setMap + */ + setMap: function() { + OpenLayers.Layer.XYZ.prototype.setMap.apply(this, arguments); + + this.updateAttribution(); + this.map.events.register("moveend", this, this.updateAttribution); + }, + + /** + * Method: removeMap + */ + removeMap: function() { + OpenLayers.Layer.XYZ.prototype.removeMap.apply(this, arguments); + this.map.events.unregister("moveend", this, this.updateAttribution); + }, + + /** + * APIMethod: clone + * + * Parameters: + * obj - {Object} + * + * Returns: + * {} An exact clone of this + * + */ + clone: function(obj) { + if (obj == null) { + obj = new OpenLayers.Layer.GoogleNG(this.options); + } + //get all additions from superclasses + obj = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]); + // copy/set any non-init, non-simple values here + return obj; + }, + + /** + * Method: destroy + */ + destroy: function() { + this.map && + this.map.events.unregister("moveend", this, this.updateAttribution); + OpenLayers.Layer.XYZ.prototype.destroy.apply(this, arguments); + }, + + CLASS_NAME: "OpenLayers.Layer.GoogleNG" +}); \ No newline at end of file diff --git a/lib/OpenLayers/Tile.js b/lib/OpenLayers/Tile.js index 44d268f987..f71de074aa 100644 --- a/lib/OpenLayers/Tile.js +++ b/lib/OpenLayers/Tile.js @@ -103,7 +103,9 @@ OpenLayers.Tile = OpenLayers.Class({ this.position = position.clone(); this.bounds = bounds.clone(); this.url = url; - this.size = size.clone(); + if (size) { + this.size = size.clone(); + } //give the tile a unique id based on its BBOX. this.id = OpenLayers.Util.createUniqueID("Tile_"); diff --git a/lib/OpenLayers/Tile/Google.js b/lib/OpenLayers/Tile/Google.js new file mode 100644 index 0000000000..11686734a6 --- /dev/null +++ b/lib/OpenLayers/Tile/Google.js @@ -0,0 +1,151 @@ +/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the Clear BSD license. + * See http://svn.openlayers.org/trunk/openlayers/license.txt for the + * full text of the license. */ + + +/* + * @requires OpenLayers/BaseTypes/Class.js + * @requires OpenLayers/Util.js + * @requires OpenLayers/Console.js + * @requires OpenLayers/Lang.js + */ + +/* + * Class: OpenLayers.Tile.Google + * Instances of OpenLayers.Tile.Google are used to manage the tiles created + * by google.maps.MapType (see + * http://code.google.com/apis/maps/documentation/javascript/reference.html#MapType). + * + * Inherits from: + * - + */ +OpenLayers.Tile.Google = OpenLayers.Class(OpenLayers.Tile, { + + /** + * Property: node + * {DOMElement} The tile node from the MapType's getTile method + */ + node: null, + + /** + * Constructor: OpenLayers.Tile.Google + * Constructor for a new instance. + * + * Parameters: + * layer - {} layer that the tile will go in. + * position - {} + * bounds - {} + * options - {Object} + */ + initialize: function(layer, position, bounds, options) { + OpenLayers.Tile.prototype.initialize.apply(this, [ + layer, position, bounds, null, null, options + ]); + }, + + /** + * APIMethod: destroy + * Nullify references to prevent circular references and memory leaks. + */ + destroy:function() { + this.node && this.clear(); + this.node = null; + OpenLayers.Tile.prototype.destroy.apply(this, arguments); + }, + + /** + * Method: clone + * + * Parameters: + * obj - {} The tile to be cloned + * + * Returns: + * {} An exact clone of this + */ + clone: function (obj) { + if (obj == null) { + obj = new OpenLayers.Tile.Google(this.layer, + this.position, + this.bounds); + } + + // catch any randomly tagged-on properties + OpenLayers.Util.applyDefaults(obj, this); + + obj.node = null; + + return obj; + }, + + /** + * Method: draw + * Check that a tile should be drawn, and draw it. + * + * Returns: + * {Boolean} Always returns true. + */ + draw: function() { + var layerType = this.layer.mapObject.mapTypes[this.layer.type]; + if (layerType && OpenLayers.Tile.prototype.draw.apply(this, arguments)) { + var xyz = this.layer.getXYZ(this.bounds); + var point = new google.maps.Point(xyz.x, xyz.y); + + // The hybrid tile consists of two images. For some reason, we have + // to make sure that the satellite image loads first, otherwise we + // occasionally get blank tiles for one of the two images. This is + // done by requesting the tile for just the satellite mapType + // first, before requesting the hybrid one. + //TODO revisit this - it may be a temporary issue with GMaps + var tempTile; + if (this.layer.type === google.maps.MapTypeId.HYBRID) { + tempTile = layerType.getTile(point, xyz.z, document); + } + + this.node = layerType.getTile(point, xyz.z, document); + + this.isLoading = true; + this.events.triggerEvent("loadstart"); + + this.layer.div.appendChild(this.node); + + // We only modify what we need to - we expect the size to be set + // by getTile, and we have a test that will fail if this changes. + OpenLayers.Util.modifyDOMElement( + this.node, null, this.position, null, "absolute" + ); + + // The images inside the node returned from getTile seem to be + // preloaded already, so registering onload events on these images + // won't work. Instead, we trigger the loadend event immediately + // in the next cycle. + window.setTimeout(OpenLayers.Function.bind(function() { + this.isLoading = false; + // check for this.events - we may be destroyed already + this.events && this.events.triggerEvent("loadend"); + + // see hybrid tile issue above + //TODO revisit this - it may be a temporary issue with GMaps + if (tempTile) { + layerType.releaseTile(tempTile); + } + }, this), 0); + } + return true; + }, + + /** + * Method: clear + * Clear the tile of any bounds/position-related data so that it can + * be reused in a new location. To be implemented by subclasses. + */ + clear: function() { + if (this.node) { + this.node.parentNode && + this.node.parentNode.removeChild(this.node); + this.layer.mapObject.mapTypes[this.layer.type].releaseTile(this.node); + } + }, + + CLASS_NAME: "OpenLayers.Tile.Google" +}); diff --git a/tests/Layer/GoogleNG.html b/tests/Layer/GoogleNG.html new file mode 100644 index 0000000000..a302450440 --- /dev/null +++ b/tests/Layer/GoogleNG.html @@ -0,0 +1,96 @@ + + + + + + + +
+
+ + diff --git a/tests/Tile/Google.html b/tests/Tile/Google.html new file mode 100644 index 0000000000..e1710847ba --- /dev/null +++ b/tests/Tile/Google.html @@ -0,0 +1,74 @@ + + + + + + + +
+ + \ No newline at end of file diff --git a/tests/list-tests.html b/tests/list-tests.html index 214c2ffb58..d5d9a8ae10 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -144,6 +144,7 @@
  • Layer/GML.html
  • Layer/Google.html
  • Layer/Google/v3.html
  • +
  • Layer/GoogleNG.html
  • Layer/Grid.html
  • Layer/HTTPRequest.html
  • Layer/Image.html
  • @@ -213,6 +214,7 @@
  • Symbolizer/Raster.html
  • Symbolizer/Text.html
  • Tile.html
  • +
  • Tile/Google.html
  • Tile/Image.html
  • Tile/Image/IFrame.html
  • Tile/WFS.html
  • diff --git a/theme/default/style.css b/theme/default/style.css index ae5b6b4a74..5db30cafe1 100644 --- a/theme/default/style.css +++ b/theme/default/style.css @@ -355,6 +355,19 @@ div.olControlSaveFeaturesItemInactive { color: #333; } +.olGoogleAttribution.hybrid, .olGoogleAttribution.satellite { + color: #DDD; +} +.olGoogleAttribution { + color: #333; +} +span.olGoogleAttribution a { + color: #77C; +} +span.olGoogleAttribution.hybrid a, span.olGoogleAttribution.satellite a { + color: white; +} + /** * Editing and navigation icons. * (using the editing_tool_bar.png sprint image) From d0d0fd92953fc8506cb8c26cc083bc628095ed85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Thu, 26 May 2011 14:31:14 +0000 Subject: [PATCH 004/141] XYZ.js trips-up JavaScript minify tools, no functional change (#3314) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12016 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/XYZ.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Layer/XYZ.js b/lib/OpenLayers/Layer/XYZ.js index 4689f9c9f0..d0b6a34991 100644 --- a/lib/OpenLayers/Layer/XYZ.js +++ b/lib/OpenLayers/Layer/XYZ.js @@ -140,10 +140,10 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, { */ getXYZ: function(bounds) { var res = this.map.getResolution(); - var x = Math.round((bounds.left - this.maxExtent.left) - / (res * this.tileSize.w)); - var y = Math.round((this.maxExtent.top - bounds.top) - / (res * this.tileSize.h)); + var x = Math.round((bounds.left - this.maxExtent.left) / + (res * this.tileSize.w)); + var y = Math.round((this.maxExtent.top - bounds.top) / + (res * this.tileSize.h)); var z = this.serverResolutions != null ? OpenLayers.Util.indexOf(this.serverResolutions, res) : this.map.getZoom() + this.zoomOffset; From a794eec5cf886179e9447cd1c38b1e4e7405a9c3 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sat, 28 May 2011 09:05:15 +0000 Subject: [PATCH 005/141] nicer attribution style git-svn-id: http://svn.openlayers.org/trunk/openlayers@12021 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/google-ng.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/google-ng.html b/examples/google-ng.html index 5462c84d29..a2820f3ed4 100644 --- a/examples/google-ng.html +++ b/examples/google-ng.html @@ -9,9 +9,10 @@ From 090c8bc63a4180826343088016ead2e96cf27869 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sat, 28 May 2011 09:13:20 +0000 Subject: [PATCH 006/141] nicer attribution style git-svn-id: http://svn.openlayers.org/trunk/openlayers@12022 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/bing-tiles.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/bing-tiles.html b/examples/bing-tiles.html index 5d8f5c807b..776dced84b 100644 --- a/examples/bing-tiles.html +++ b/examples/bing-tiles.html @@ -8,9 +8,10 @@ From d6698e3771a4fd9324eeb81c8cf2e4ae7962e209 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sat, 28 May 2011 15:52:37 +0000 Subject: [PATCH 007/141] fixing a typo git-svn-id: http://svn.openlayers.org/trunk/openlayers@12030 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Renderer/NG.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Renderer/NG.js b/lib/OpenLayers/Renderer/NG.js index d78d10d388..8787a0da0d 100644 --- a/lib/OpenLayers/Renderer/NG.js +++ b/lib/OpenLayers/Renderer/NG.js @@ -47,7 +47,7 @@ OpenLayers.Renderer.NG = OpenLayers.Class(OpenLayers.Renderer.Elements, { * Method: updateDimensions * To be extended by subclasses - here we set positioning related styles * on HTML elements, subclasses have to do the same for renderer specific - * elements (e.g. viesBox, width and height of the rendererRoot) + * elements (e.g. viewBox, width and height of the rendererRoot) */ updateDimensions: function() { var mapExtent = this.map.getExtent(); From 7a51a782bc10a6c9894b770870f7f947a33d0e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 30 May 2011 12:55:16 +0000 Subject: [PATCH 008/141] sensible defaut for dragpan interval, r=crschmidt (#3317) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12031 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/mobile-base.js | 1 - examples/mobile-drawing.js | 6 +----- examples/mobile-layers.js | 1 - examples/mobile-navigation.js | 1 - examples/mobile.js | 1 - lib/OpenLayers/Control/DragPan.js | 7 ++++--- 6 files changed, 5 insertions(+), 12 deletions(-) diff --git a/examples/mobile-base.js b/examples/mobile-base.js index c23f9f79e1..f320581787 100644 --- a/examples/mobile-base.js +++ b/examples/mobile-base.js @@ -51,7 +51,6 @@ var init = function (onSelectFeatureFunction) { new OpenLayers.Control.Attribution(), new OpenLayers.Control.TouchNavigation({ dragPanOptions: { - interval: 100, enableKinetic: true } }), diff --git a/examples/mobile-drawing.js b/examples/mobile-drawing.js index 98998d0072..3de462b380 100644 --- a/examples/mobile-drawing.js +++ b/examples/mobile-drawing.js @@ -48,11 +48,7 @@ function init() { -20037508.34, -20037508.34, 20037508.34, 20037508.34 ), controls: [ - new OpenLayers.Control.TouchNavigation({ - dragPanOptions: { - interval: 100 - } - }), + new OpenLayers.Control.TouchNavigation(), new OpenLayers.Control.ZoomPanel(), toolbar ], diff --git a/examples/mobile-layers.js b/examples/mobile-layers.js index 30b9cc5677..05e1f03399 100644 --- a/examples/mobile-layers.js +++ b/examples/mobile-layers.js @@ -29,7 +29,6 @@ function init() { new OpenLayers.Control.Attribution(), new OpenLayers.Control.TouchNavigation({ dragPanOptions: { - interval: 100, enableKinetic: true } }), diff --git a/examples/mobile-navigation.js b/examples/mobile-navigation.js index 29bd5135a1..ce08b498e6 100644 --- a/examples/mobile-navigation.js +++ b/examples/mobile-navigation.js @@ -14,7 +14,6 @@ function init() { controls: [ new OpenLayers.Control.TouchNavigation({ dragPanOptions: { - interval: 100, enableKinetic: true } }), diff --git a/examples/mobile.js b/examples/mobile.js index bd5c5da90d..094647a69e 100644 --- a/examples/mobile.js +++ b/examples/mobile.js @@ -23,7 +23,6 @@ var init = function () { new OpenLayers.Control.Attribution(), new OpenLayers.Control.TouchNavigation({ dragPanOptions: { - interval: 100, enableKinetic: true } }), diff --git a/lib/OpenLayers/Control/DragPan.js b/lib/OpenLayers/Control/DragPan.js index 61001f2bc4..b46c15e36a 100644 --- a/lib/OpenLayers/Control/DragPan.js +++ b/lib/OpenLayers/Control/DragPan.js @@ -32,10 +32,11 @@ OpenLayers.Control.DragPan = OpenLayers.Class(OpenLayers.Control, { /** * Property: interval * {Integer} The number of milliseconds that should ellapse before - * panning the map again. Set this to increase dragging performance. - * Defaults to 25 milliseconds. + * panning the map again. Defaults to 1 millisecond. In most cases + * you won't want to change this value. For slow machines/devices + * larger values can be tried out. */ - interval: 25, + interval: 1, /** * APIProperty: documentDrag From 15be7ff39b41b3c68aa8101674f73ab78fd48981 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Tue, 31 May 2011 15:00:51 +0000 Subject: [PATCH 009/141] use HTML5 in all examples, and some minor example improvements (pullup #3333) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12032 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/KMLParser.html | 15 +++++---- examples/SLDSelect.html | 12 ++++--- examples/WMSDescribeLayerParser.html | 17 ++++++---- examples/accelerometer.html | 9 +++--- examples/accessible.html | 16 ++++++---- examples/all-overlays-google.html | 5 +-- examples/all-overlays.html | 12 ++++--- examples/anchor-permalink.html | 10 +++--- examples/animated_panning.html | 14 ++++---- examples/arcgis93rest.html | 12 ++++--- examples/arcgiscache_ags.html | 8 +++-- examples/arcgiscache_direct.html | 10 +++--- examples/arcgiscache_jsonp.html | 8 +++-- examples/arcims-thematic.html | 12 ++++--- examples/arcims.html | 12 ++++--- examples/attribution.html | 22 +++++++------ examples/behavior-fixed-http-gml.html | 16 ++++++---- examples/bing-tiles.html | 5 +-- examples/bing.html | 18 ++++++----- examples/boxes-vector.html | 14 ++++---- examples/boxes.html | 14 ++++---- examples/browser.html | 9 +++--- examples/buffer.html | 12 ++++--- examples/canvas-hit-detection.html | 2 +- examples/canvas-inspector.html | 1 + examples/canvas.html | 12 ++++--- examples/click-handler.html | 12 ++++--- examples/click.html | 16 ++++++---- examples/controls.html | 12 ++++--- examples/cql-format.html | 7 ++-- examples/cross-origin.html | 5 +-- examples/custom-control.html | 16 ++++++---- examples/custom-style.html | 12 ++++--- examples/debug.html | 18 +++++------ examples/document-drag.html | 14 ++++---- examples/donut.html | 5 +-- examples/doubleSetCenter.html | 12 ++++--- examples/drag-feature.html | 12 ++++--- examples/draw-feature.html | 12 ++++--- examples/dynamic-text-layer.html | 26 +++++++-------- examples/editingtoolbar-outside.html | 13 ++++---- examples/editingtoolbar.html | 17 +++++----- examples/events.html | 10 +++--- examples/example-list.html | 11 ++++--- examples/example.html | 5 +-- examples/filter-strategy.html | 5 +-- examples/filter.html | 18 ++++++----- examples/fractional-zoom.html | 14 ++++---- examples/fullScreen.html | 9 +++--- examples/game-accel-ball.html | 14 ++++---- examples/geojson.html | 14 ++++---- examples/geolocation.html | 1 + examples/georss-flickr.html | 12 ++++--- examples/georss-markers.html | 12 ++++--- examples/georss.html | 16 ++++++---- examples/getfeature-wfs.html | 20 ++++++------ examples/getfeatureinfo-control.html | 14 ++++---- examples/getfeatureinfo-popup.html | 10 +++--- examples/gml-layer.html | 14 ++++---- examples/google-ng.html | 5 +-- examples/google-reproject.html | 16 ++++++---- examples/google-v3-alloverlays.html | 5 +-- examples/google-v3.html | 5 +-- examples/google.html | 14 ++++---- examples/graphic-name.html | 9 +++--- examples/graticule.html | 12 ++++--- examples/gutter.html | 12 ++++--- examples/highlight-feature.html | 14 ++++---- examples/hover-handler.html | 12 ++++--- examples/image-layer.html | 14 ++++---- examples/intersects.html | 22 +++++++------ examples/kamap.html | 12 ++++--- examples/kinetic.html | 5 +-- examples/kml-layer.html | 5 +-- examples/kml-pointtrack.html | 6 ++-- examples/kml-track.html | 5 +-- examples/late-render.html | 16 ++++++---- examples/layer-opacity.html | 12 ++++--- examples/layerLoadMonitoring.html | 12 ++++--- examples/layerswitcher.html | 12 ++++--- examples/lite.html | 15 +++++---- examples/mapguide.html | 12 ++++--- examples/mapserver.html | 16 ++++++---- examples/mapserver_untiled.html | 16 ++++++---- examples/marker-shadow.html | 12 ++++--- examples/markerResize.html | 17 ++++++---- examples/markers.html | 16 ++++++---- examples/markersTextLayer.html | 12 ++++--- examples/measure.html | 12 ++++--- examples/mm.html | 12 ++++--- examples/mobile-navigation.html | 9 +++--- examples/modify-feature.html | 12 ++++--- examples/mouse-position.html | 16 ++++++---- examples/mousewheel-interval.html | 12 ++++--- examples/multimap-mercator.html | 12 ++++--- examples/multiserver.html | 20 ++++++++---- examples/multitouch.html | 2 ++ examples/mvs.html | 6 ++-- examples/navigation-control.html | 18 +++++++---- examples/navigation-history.html | 10 +++--- examples/navtoolbar-alwaysZoom.html | 12 ++++--- examples/navtoolbar-outsidemap.html | 12 ++++--- examples/navtoolbar.html | 12 ++++--- examples/openls.html | 4 ++- examples/ordering.html | 12 ++++--- examples/osm-google.html | 5 +-- examples/osm-layer.html | 12 ++++--- examples/osm.html | 14 ++++---- examples/outOfRangeMarkers.html | 12 ++++--- examples/overviewmap.html | 9 +++--- examples/pan-zoom-panels.html | 9 +++--- examples/panel.html | 12 ++++--- examples/point-track-markers.html | 12 ++++--- examples/popupMatrix.html | 14 ++++---- examples/popups.html | 12 ++++--- examples/projected-map.html | 12 ++++--- examples/protocol-gears.html | 12 ++++--- examples/regular-polygons.html | 12 ++++--- examples/resize-features.html | 12 ++++--- examples/restricted-extent.html | 12 ++++--- examples/rotate-features.html | 12 ++++--- examples/select-feature-multilayer.html | 12 ++++--- examples/select-feature-openpopup.html | 14 ++++---- examples/select-feature.html | 12 ++++--- examples/setextent.html | 8 ++--- examples/simplify-linestring.html | 5 +-- examples/single-tile.html | 5 +-- examples/sld-parser.html | 9 +++--- examples/sld.html | 32 ++++++++++--------- examples/snap-split.html | 22 +++++++------ examples/snapping.html | 14 ++++---- examples/sos.html | 14 ++++---- examples/spherical-mercator.html | 12 ++++--- examples/split-feature.html | 16 ++++++---- examples/strategy-bbox.html | 12 ++++--- examples/strategy-cluster-extended.html | 11 ++++--- examples/strategy-cluster-threshold.html | 14 ++++---- examples/strategy-cluster.html | 12 ++++--- examples/strategy-paging.html | 14 ++++---- examples/style-rules.html | 12 ++++--- examples/stylemap.html | 12 ++++--- examples/styles-context.html | 28 ++++++++++------ examples/styles-rotation.html | 12 ++++--- examples/styles-unique.html | 12 ++++--- examples/sundials-spherical-mercator.html | 12 ++++--- examples/sundials.html | 14 ++++---- examples/symbolizers-fill-stroke-graphic.html | 12 ++++--- examples/teleportation.html | 16 ++++++---- examples/tile-origin.html | 5 +-- examples/tilecache.html | 16 ++++++---- examples/tms.html | 16 ++++++---- examples/transform-feature.html | 12 ++++--- examples/transition.html | 10 +++--- examples/urban.html | 14 ++++---- examples/ve-novibrate.html | 16 ++++++---- examples/ve.html | 14 ++++---- examples/vector-features-with-text.html | 13 ++++---- examples/vector-features.html | 11 ++++--- examples/vector-formats.html | 20 ++++++------ examples/web-mercator.html | 9 +++--- examples/wfs-filter.html | 5 +-- examples/wfs-protocol-transactions.html | 10 +++--- examples/wfs-protocol.html | 12 ++++--- examples/wfs-reprojection.html | 12 ++++--- examples/wfs-snap-split.html | 9 +++--- examples/wfs-states.html | 10 +++--- examples/wmc.html | 24 +++++++------- examples/wms-long-url.html | 9 +++--- examples/wms-untiled.html | 12 ++++--- examples/wms-v13.html | 16 ++++++---- examples/wms.html | 17 ++++++---- examples/wmst.html | 19 +++++++---- examples/wmts-capabilities.html | 7 ++-- examples/wmts-getfeatureinfo.html | 7 ++-- examples/wmts.html | 7 ++-- examples/worldwind.html | 24 ++++++++++---- examples/wrapDateLine.html | 12 ++++--- examples/xhtml.html | 11 ++++--- examples/xml.html | 16 +++++----- examples/xyz-esri.html | 15 +++++---- examples/xyz-offset.html | 9 +++--- examples/yahoo.html | 19 ++++++----- examples/zoomLevels.html | 16 ++++++---- examples/zoomify.html | 22 +++++++------ 184 files changed, 1311 insertions(+), 955 deletions(-) diff --git a/examples/KMLParser.html b/examples/KMLParser.html index 04b7c9072f..3442cd42e6 100644 --- a/examples/KMLParser.html +++ b/examples/KMLParser.html @@ -1,9 +1,11 @@ - + + - - + + + OpenLayers KML Parser Example - + - +

    Feature Info Example

    diff --git a/examples/getfeatureinfo-popup.html b/examples/getfeatureinfo-popup.html index 5b9c24c33c..15ac843ec1 100644 --- a/examples/getfeatureinfo-popup.html +++ b/examples/getfeatureinfo-popup.html @@ -1,11 +1,13 @@ + - - + + + GetFeatureInfo Popup - - + + @@ -50,12 +52,12 @@
    - An overlay in a Geographic projection can be stretched to somewhat +

    An overlay in a Geographic projection can be stretched to somewhat line up with Google tiles (in a Mercator projection). Results get worse farther from the equator. Use the "reproject" option on a layer to get this behavior. Use the sphericalMercator option on a Google layer to get proper overlays (with other layers in - Spherical Mercator). + Spherical Mercator).

    diff --git a/examples/google-v3-alloverlays.html b/examples/google-v3-alloverlays.html index ddf9556bf4..1f417a7b33 100644 --- a/examples/google-v3-alloverlays.html +++ b/examples/google-v3-alloverlays.html @@ -1,8 +1,9 @@ - - + + + OpenLayers Google (v3) Layer Example diff --git a/examples/google-v3.html b/examples/google-v3.html index 7c9ad3d12b..a517f10727 100644 --- a/examples/google-v3.html +++ b/examples/google-v3.html @@ -1,8 +1,9 @@ - - + + + OpenLayers Google (v3) Layer Example diff --git a/examples/google.html b/examples/google.html index af2ca3d4a9..b80daa936a 100644 --- a/examples/google.html +++ b/examples/google.html @@ -1,11 +1,13 @@ - + + - - + + + OpenLayers Google Layer Example - - - + + + diff --git a/examples/graphic-name.html b/examples/graphic-name.html index 35026f5de1..369048dc20 100644 --- a/examples/graphic-name.html +++ b/examples/graphic-name.html @@ -1,12 +1,13 @@ - - + + + OpenLayers Graphic Names - - + + diff --git a/examples/graticule.html b/examples/graticule.html index 3f8f665c56..120c154407 100644 --- a/examples/graticule.html +++ b/examples/graticule.html @@ -1,11 +1,13 @@ - + + - - + + + OpenLayers Graticule Example - - + + diff --git a/lib/OpenLayers/Layer/GoogleNG.js b/lib/OpenLayers/Layer/GoogleNG.js index 1d85396acb..e5192a386c 100644 --- a/lib/OpenLayers/Layer/GoogleNG.js +++ b/lib/OpenLayers/Layer/GoogleNG.js @@ -10,10 +10,7 @@ /** * Class: OpenLayers.Layer.GoogleNG - * Google layer using tiles. Note: Terms of Service - * compliant use requires the map to be configured with an - * control and the attribution placed on or - * near the map. + * Google layer using tiles. * * Inherits from: * - @@ -32,13 +29,11 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { * {String} */ attributionTemplate: '' + - '
    ' + - '
    ' + - 'Map data - ${mapData}' + 'Terms of Use
    ', @@ -54,13 +49,6 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { "terrain": "p" }, - /** - * Property: mapObject - * {google.maps.Map} Shared GMaps instance - will be set on the prototype - * upon instantiation of the 1st GoogleNG layer - */ - mapObject: null, - /** * APIProperty: type * {google.maps.MapTypeId} See @@ -71,7 +59,10 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { /** * Constructor: OpenLayers.Layer.GoogleNG * Create a new GoogleNG layer. Requires the GMaps v3 JavaScript API script - * included in the html document. + * (http://maps.google.com/maps/api/js?v=3.5&sensor=false) loaded in + * the html document. Note: Terms of Service compliant use requires the map + * to be configured with an control and + * the attribution placed on the map. * * Example: * (code) @@ -103,15 +94,15 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs); this.options.numZoomLevels = options.numZoomLevels; - if (!this.mapObject) { - OpenLayers.Layer.GoogleNG.prototype.mapObject = + if (!OpenLayers.Layer.GoogleNG.mapObject) { + OpenLayers.Layer.GoogleNG.mapObject = new google.maps.Map(document.createElement("div")); } - if (this.mapObject.mapTypes[this.type]) { + if (OpenLayers.Layer.GoogleNG.mapObject.mapTypes[this.type]) { this.initLayer(); } else { google.maps.event.addListenerOnce( - this.mapObject, + OpenLayers.Layer.GoogleNG.mapObject, "idle", OpenLayers.Function.bind(this.initLayer, this) ); @@ -124,7 +115,7 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { * Sets layer properties according to the metadata provided by the API */ initLayer: function() { - var mapType = this.mapObject.mapTypes[this.type]; + var mapType = OpenLayers.Layer.GoogleNG.mapObject.mapTypes[this.type]; if (!this.name) { this.setName("Google " + mapType.name); } @@ -171,8 +162,31 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { /** * Method: updateAttribution * Updates the attribution using the + * + * Parameters: + * copyrights - {Object} Object with "m", "k", "h" and "p" properties (see + * ), each holding an array of copyrights. */ - updateAttribution: function() { + updateAttribution: function(copyrights) { + var myCopyrights; + if (this.type == google.maps.MapTypeId.HYBRID) { + // the Copyright Service returns "k" and "m" copyrights for the + // HYBRID layer type. + var candidates = [].concat( + copyrights["h"], copyrights["k"], copyrights["m"] + ); + myCopyrights = []; + for (var i=candidates.length-1; i>=0; --i) { + if (OpenLayers.Util.indexOf(candidates, myCopyrights) == -1) { + myCopyrights.push(candidates[i]); + } + } + } else { + myCopyrights = copyrights[this.mapTypes[this.type]]; + } + var mapData = myCopyrights.length == 0 ? "" : + "Map Data ©" + new Date().getFullYear() + " " + + myCopyrights.join(", ") + " - "; var center = this.map.getCenter(); center && center.transform( this.map.getProjectionObject(), @@ -180,23 +194,23 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { ); var size = this.map.getSize(); this.attribution = OpenLayers.String.format(this.attributionTemplate, { - center: center ? center.lat + "," + center.lon : "", - zoom: this.map.getZoom(), - size: size.w + "x" + size.h, t: this.mapTypes[this.type], - mapType: this.type + zoom: this.map.getZoom(), + center: center.lat + "," + center.lon, + mapType: this.type, + mapData: mapData }); this.map && this.map.events.triggerEvent("changelayer", {layer: this}); }, - + /** * Method: setMap */ setMap: function() { OpenLayers.Layer.XYZ.prototype.setMap.apply(this, arguments); - - this.updateAttribution(); - this.map.events.register("moveend", this, this.updateAttribution); + this.events.register("moveend", this, + OpenLayers.Layer.GoogleNG.loadCopyrights + ); }, /** @@ -204,7 +218,9 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { */ removeMap: function() { OpenLayers.Layer.XYZ.prototype.removeMap.apply(this, arguments); - this.map.events.unregister("moveend", this, this.updateAttribution); + this.events.unregister("moveend", this, + OpenLayers.Layer.GoogleNG.loadCopyrights + ); }, /** @@ -227,14 +243,86 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { return obj; }, - /** - * Method: destroy - */ - destroy: function() { - this.map && - this.map.events.unregister("moveend", this, this.updateAttribution); - OpenLayers.Layer.XYZ.prototype.destroy.apply(this, arguments); - }, - CLASS_NAME: "OpenLayers.Layer.GoogleNG" -}); \ No newline at end of file +}); + +/** + * Property: mapObject + * {google.maps.Map} Shared GMaps instance - will be set upon instantiation of + * the 1st GoogleNG layer + */ +OpenLayers.Layer.GoogleNG.mapObject = null; + +/** + * Function: loadCopyrights + * Using the Google Maps Copyright Service mode (see + * http://mapki.com/wiki/Google_Map_Parameters#Misc) to get the attribution for + * the current map extent. Will be called by each GoogleNG layer instance on + * moveend. + */ +OpenLayers.Layer.GoogleNG.loadCopyrights = function() { + var me = OpenLayers.Layer.GoogleNG.loadCopyrights; + if (me.numLoadingScripts == undefined) { + me.loadingScripts = []; + me.numLoadingScripts = 0; + me.copyrights = {"m": [], "k": [], "h": [], "p": []}; + + // store window scope functions before overwriting them + me.origGAddCopyright = window.GAddCopyright; + me.origGVerify = window.GVerify; + me.origGAppFeatures = window.GAppFeatures; + + // defining window scope functions called by the script that the + // Copyright Service returns + window.GAddCopyright = function() { + var copyright = arguments[7]; + var category = me.copyrights[arguments[0]]; + if (OpenLayers.Util.indexOf(category, copyright) == -1) { + copyright && category.push(copyright); + } + }; + window.GVerify = OpenLayers.Function.True; + window.GAppFeatures = OpenLayers.Function.bind(function() { + me.numLoadingScripts--; + if (me.numLoadingScripts == 0) { + var script; + for (var i=me.loadingScripts.length-1; i>=0; --i) { + script = me.loadingScripts[i][0]; + me.loadingScripts[i][1].updateAttribution(me.copyrights); + script.parentNode.removeChild(script); + } + + // restore original functions + window.GAddCopyright = me.origGAddCopyright; + delete me.origGAddCopyright; + window.GVerify = me.origGVerify; + delete me.origGVerify; + window.GAppFeatures = me.origGAppFeatures; + delete me.origGAppFeatures; + + delete me.loadingScripts; + delete me.numLoadingScripts; + delete me.copyrights; + } + }, this); + } + var mapProj = this.map.getProjectionObject(); + var llProj = new OpenLayers.Projection("EPSG:4326"); + var center = this.map.getCenter().transform(mapProj, llProj); + var extent = this.map.getExtent().transform(mapProj, llProj); + var params = { + spn: extent.getHeight() + "," + extent.getWidth(), + z: this.map.getZoom(), + t: this.mapTypes[this.type], + vp: center.lat + "," + center.lon + }; + var url = "http://maps.google.com/maps?" + + OpenLayers.Util.getParameterString(params); + var script = document.createElement("script"); + script.type = "text/javascript"; + script.src = url; + me.numLoadingScripts++; + me.loadingScripts.push([script, this]); + document.getElementsByTagName("head")[0].appendChild(script); +}; + diff --git a/lib/OpenLayers/Tile/Google.js b/lib/OpenLayers/Tile/Google.js index 11686734a6..c5fc651baa 100644 --- a/lib/OpenLayers/Tile/Google.js +++ b/lib/OpenLayers/Tile/Google.js @@ -86,7 +86,9 @@ OpenLayers.Tile.Google = OpenLayers.Class(OpenLayers.Tile, { * {Boolean} Always returns true. */ draw: function() { - var layerType = this.layer.mapObject.mapTypes[this.layer.type]; + var layerType = OpenLayers.Layer.GoogleNG.mapObject.mapTypes[ + this.layer.type + ]; if (layerType && OpenLayers.Tile.prototype.draw.apply(this, arguments)) { var xyz = this.layer.getXYZ(this.bounds); var point = new google.maps.Point(xyz.x, xyz.y); @@ -143,7 +145,9 @@ OpenLayers.Tile.Google = OpenLayers.Class(OpenLayers.Tile, { if (this.node) { this.node.parentNode && this.node.parentNode.removeChild(this.node); - this.layer.mapObject.mapTypes[this.layer.type].releaseTile(this.node); + OpenLayers.Layer.GoogleNG.mapObject.mapTypes[ + this.layer.type + ].releaseTile(this.node); } }, diff --git a/tests/Layer/GoogleNG.html b/tests/Layer/GoogleNG.html index a302450440..946bc9e0d9 100644 --- a/tests/Layer/GoogleNG.html +++ b/tests/Layer/GoogleNG.html @@ -34,11 +34,11 @@ numZoomLevels: 24, initLayer: function() { log[layer2.id] = true; - var origMinZoom = layer2.mapObject.mapTypes[layer2.type].minZoom; + var origMinZoom = OpenLayers.Layer.GoogleNG.mapObject.mapTypes[layer2.type].minZoom; // pretend the API reports a minZoom of 1 - layer2.mapObject.mapTypes[layer2.type].minZoom = 1; + OpenLayers.Layer.GoogleNG.mapObject.mapTypes[layer2.type].minZoom = 1; OpenLayers.Layer.GoogleNG.prototype.initLayer.apply(this, arguments); - layer2.mapObject.mapTypes[layer2.type].minZoom = origMinZoom; + OpenLayers.Layer.GoogleNG.mapObject.mapTypes[layer2.type].minZoom = origMinZoom; } }); map2.addLayer(layer2); @@ -49,7 +49,7 @@ t.eq(log[layer2.id], true, "initLayer called for 2nd layer"); t.eq(layer.numZoomLevels, 10, "numZoomLevels from configuration takes precedence if lower"); - t.eq(layer2.numZoomLevels, layer2.mapObject.mapTypes[layer2.type].maxZoom+1, "numZoomLevels from API takes precedence if lower"); + t.eq(layer2.numZoomLevels, OpenLayers.Layer.GoogleNG.mapObject.mapTypes[layer2.type].maxZoom+1, "numZoomLevels from API takes precedence if lower"); t.eq(layer.restrictedMinZoom, 2, "restrictedMinZoom from configuration takes precedence if higher"); t.eq(layer2.restrictedMinZoom, 1, "restrictedMinZoom from API takes precedence if higher"); @@ -60,18 +60,25 @@ } function test_attribution(t) { - t.plan(3); + t.plan(4); var log = []; map = new OpenLayers.Map("map"); - layer = new OpenLayers.Layer.GoogleNG({type: google.maps.MapTypeId.HYBRID}); + layer = new OpenLayers.Layer.GoogleNG({ + type: google.maps.MapTypeId.HYBRID, + updateAttribution: function(copyrights) { + log.push(copyrights); + OpenLayers.Layer.GoogleNG.prototype.updateAttribution.apply(this, arguments); + } + }); map.addLayer(layer); - map.zoomToMaxExtent(); + map.setCenter(new OpenLayers.LonLat(16, 48).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), 5); - t.delay_call(1, function() { - t.ok(layer.attribution.indexOf('olGoogleAttribution hybrid') !== -1, "Attribution has the correct css class"); - t.ok(layer.attribution.indexOf('?ll=0,0&z=0&t=h"') != -1, "maps.google.com link has correct parameters"); - t.ok(layer.attribution.indexOf('¢er=0,0&zoom=0&size=500x550&maptype=hybrid') != -1 , "Attribution has correct map data link"); + t.delay_call(3, function() { + t.eq(log.length, 1, "updateAttribution was called once"); + t.ok(log[0]["m"].length && log[0]["k"].length, "'m' and 'k' copyrights populated for hybrid layer"); + t.ok(layer.attribution.indexOf('olGoogleAttribution hybrid') != -1, "Attribution has the correct css class"); + t.ok(layer.attribution.indexOf('?ll=48,16&z=5&t=h"') != -1, "maps.google.com link has correct parameters"); map.destroy(); }); } diff --git a/theme/default/style.css b/theme/default/style.css index 5db30cafe1..3aeac29c2e 100644 --- a/theme/default/style.css +++ b/theme/default/style.css @@ -356,7 +356,7 @@ div.olControlSaveFeaturesItemInactive { } .olGoogleAttribution.hybrid, .olGoogleAttribution.satellite { - color: #DDD; + color: #EEE; } .olGoogleAttribution { color: #333; @@ -365,7 +365,7 @@ span.olGoogleAttribution a { color: #77C; } span.olGoogleAttribution.hybrid a, span.olGoogleAttribution.satellite a { - color: white; + color: #EEE; } /** From 9d5ab38fc0d6fcfe65eea138e793fa8dc7996009 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Wed, 8 Jun 2011 03:05:02 +0000 Subject: [PATCH 025/141] Get rid of unneeded alert = print. If your app needs alert messages, deal with them in your app. (No functional change; makes OpenLayers functional without jsdom in node.js.) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12071 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/node.js/mockdom.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/node.js/mockdom.js b/tests/node.js/mockdom.js index b502c7b4a4..68c088aa77 100644 --- a/tests/node.js/mockdom.js +++ b/tests/node.js/mockdom.js @@ -5,8 +5,6 @@ XMLHttpRequest = function() { } }; -alert = print; - navigator = { 'appName': 'mockdom', 'userAgent': 'mockdom', From 2b04fd6c34416b458280d52526aa23bc17208e01 Mon Sep 17 00:00:00 2001 From: bartvde Date: Wed, 8 Jun 2011 14:39:12 +0000 Subject: [PATCH 026/141] adding a format to parsing OGC service exceptions (WMS 1.1 WMS 1.3 WFS 1.0 and OWSCommon 1.0 and 1.1) and hooking it up into the GetCapabilities parsers, r=tschaub (closes #2234) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12074 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers.js | 2 + lib/OpenLayers/Format/OGCExceptionReport.js | 110 ++++++++++++++++++++ lib/OpenLayers/Format/OWSCommon.js | 91 ++++++++++++++++ lib/OpenLayers/Format/OWSCommon/v1.js | 36 ++++++- lib/OpenLayers/Format/OWSCommon/v1_0_0.js | 20 ++-- lib/OpenLayers/Format/OWSCommon/v1_1_0.js | 11 +- lib/OpenLayers/Format/WFSCapabilities.js | 6 ++ lib/OpenLayers/Format/WMSCapabilities/v1.js | 14 ++- tests/Format/OGCExceptionReport.html | 100 ++++++++++++++++++ tests/Format/OWSCommon/v1_0_0.html | 34 ++++++ tests/Format/OWSCommon/v1_1_0.html | 34 ++++++ tests/Format/WFSCapabilities/v1.html | 17 +++ tests/Format/WMSCapabilities/v1_1_1.html | 15 +++ tests/Format/WMSCapabilities/v1_3_0.html | 29 ++++++ tests/list-tests.html | 3 + 15 files changed, 505 insertions(+), 17 deletions(-) create mode 100644 lib/OpenLayers/Format/OGCExceptionReport.js create mode 100644 lib/OpenLayers/Format/OWSCommon.js create mode 100644 tests/Format/OGCExceptionReport.html create mode 100644 tests/Format/OWSCommon/v1_0_0.html create mode 100644 tests/Format/OWSCommon/v1_1_0.html diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index 82249753f7..fe395f7ddf 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -296,6 +296,7 @@ "OpenLayers/Format/SLD.js", "OpenLayers/Format/SLD/v1.js", "OpenLayers/Format/SLD/v1_0_0.js", + "OpenLayers/Format/OWSCommon.js", "OpenLayers/Format/OWSCommon/v1.js", "OpenLayers/Format/OWSCommon/v1_0_0.js", "OpenLayers/Format/OWSCommon/v1_1_0.js", @@ -334,6 +335,7 @@ "OpenLayers/Format/XLS.js", "OpenLayers/Format/XLS/v1.js", "OpenLayers/Format/XLS/v1_1_0.js", + "OpenLayers/Format/OGCExceptionReport.js", "OpenLayers/Layer/WFS.js", "OpenLayers/Control/GetFeature.js", "OpenLayers/Control/MouseToolbar.js", diff --git a/lib/OpenLayers/Format/OGCExceptionReport.js b/lib/OpenLayers/Format/OGCExceptionReport.js new file mode 100644 index 0000000000..12bee74a80 --- /dev/null +++ b/lib/OpenLayers/Format/OGCExceptionReport.js @@ -0,0 +1,110 @@ +/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the Clear BSD license. + * See http://svn.openlayers.org/trunk/openlayers/license.txt for the + * full text of the license. */ + +/** + * @requires OpenLayers/Format/XML.js + * @requires OpenLayers/Format/OWSCommon/v1_0_0.js + * @requires OpenLayers/Format/OWSCommon/v1_1_0.js + */ + +/** + * Class: OpenLayers.Format.OGCExceptionReport + * Class to read exception reports for various OGC services and versions. + * + * Inherits from: + * - + */ +OpenLayers.Format.OGCExceptionReport = OpenLayers.Class(OpenLayers.Format.XML, { + + /** + * Property: namespaces + * {Object} Mapping of namespace aliases to namespace URIs. + */ + namespaces: { + ogc: "http://www.opengis.net/ogc" + }, + + /** + * Property: regExes + * Compiled regular expressions for manipulating strings. + */ + regExes: { + trimSpace: (/^\s*|\s*$/g), + removeSpace: (/\s*/g), + splitSpace: (/\s+/), + trimComma: (/\s*,\s*/g) + }, + + /** + * Property: defaultPrefix + */ + defaultPrefix: "ogc", + + /** + * Constructor: OpenLayers.Format.OGCExceptionReport + * Create a new parser for OGC exception reports. + * + * Parameters: + * options - {Object} An optional object whose properties will be set on + * this instance. + */ + + /** + * APIMethod: read + * Read OGC exception report data from a string, and return an object with + * information about the exceptions. + * + * Parameters: + * data - {String} or {DOMElement} data to read/parse. + * + * Returns: + * {Object} Information about the exceptions that occurred. + */ + read: function(data) { + var result; + if(typeof data == "string") { + data = OpenLayers.Format.XML.prototype.read.apply(this, [data]); + } + var root = data.documentElement; + var exceptionInfo = {exceptionReport: null}; + if (root) { + this.readChildNodes(data, exceptionInfo); + if (exceptionInfo.exceptionReport === null) { + // fall-back to OWSCommon since this is a common output format for exceptions + // we cannot easily use the ows readers directly since they differ for 1.0 and 1.1 + exceptionInfo = new OpenLayers.Format.OWSCommon().read(data); + } + } + return exceptionInfo; + }, + + /** + * Property: readers + * Contains public functions, grouped by namespace prefix, that will + * be applied when a namespaced node is found matching the function + * name. The function will be applied in the scope of this parser + * with two arguments: the node being read and a context object passed + * from the parent. + */ + readers: { + "ogc": { + "ServiceExceptionReport": function(node, obj) { + obj.exceptionReport = {exceptions: []}; + this.readChildNodes(node, obj.exceptionReport); + }, + "ServiceException": function(node, exceptionReport) { + var exception = { + code: node.getAttribute("code"), + locator: node.getAttribute("locator"), + text: this.getChildValue(node) + }; + exceptionReport.exceptions.push(exception); + } + } + }, + + CLASS_NAME: "OpenLayers.Format.OGCExceptionReport" + +}); diff --git a/lib/OpenLayers/Format/OWSCommon.js b/lib/OpenLayers/Format/OWSCommon.js new file mode 100644 index 0000000000..db975f2be9 --- /dev/null +++ b/lib/OpenLayers/Format/OWSCommon.js @@ -0,0 +1,91 @@ +/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the Clear BSD license. + * See http://svn.openlayers.org/trunk/openlayers/license.txt for the + * full text of the license. */ + +/** + * @requires OpenLayers/Format/XML.js + */ + +/** + * Class: OpenLayers.Format.OWSCommon + * Read OWSCommon. Create a new instance with the + * constructor. + * + * Inherits from: + * - + */ +OpenLayers.Format.OWSCommon = OpenLayers.Class(OpenLayers.Format.XML, { + + /** + * APIProperty: defaultVersion + * {String} Version number to assume if none found. Default is "1.0.0". + */ + defaultVersion: "1.0.0", + + /** + * APIProperty: version + * {String} Specify a version string if one is known. + */ + version: null, + + /** + * Property: parser + * {Object} Instance of the versioned parser. Cached for multiple read and + * write calls of the same version. + */ + parser: null, + + /** + * Constructor: OpenLayers.Format.OWSCommon + * Create a new parser for OWSCommon. + * + * Parameters: + * options - {Object} An optional object whose properties will be set on + * this instance. + */ + + /** + * APIMethod: read + * Read an OWSCommon document and return an object. + * + * Parameters: + * data - {String | DOMElement} Data to read. + * options - {Object} Options for the reader. + * + * Returns: + * {Object} An object representing the structure of the document. + */ + read: function(data, options) { + if(typeof data == "string") { + data = OpenLayers.Format.XML.prototype.read.apply(this, [data]); + } + var root = data.documentElement; + var version = this.version; + if(!version) { + // remember version does not correspond to the OWS version + // it corresponds to the WMS/WFS/WCS etc. request version + var uri = root.getAttribute("xmlns:ows"); + if (uri.substring(uri.lastIndexOf("/")+1) === "1.1") { + version ="1.1.0"; + } + if(!version) { + version = this.defaultVersion; + } + } + if(!this.parser || this.parser.VERSION != version) { + var format = OpenLayers.Format.OWSCommon[ + "v" + version.replace(/\./g, "_") + ]; + if(!format) { + throw "Can't find a OWSCommon parser for version " + + version; + } + this.parser = new format(this.options); + } + var ows = this.parser.read(data, options); + return ows; + }, + + CLASS_NAME: "OpenLayers.Format.OWSCommon" +}); diff --git a/lib/OpenLayers/Format/OWSCommon/v1.js b/lib/OpenLayers/Format/OWSCommon/v1.js index 4716b17461..924d25874e 100644 --- a/lib/OpenLayers/Format/OWSCommon/v1.js +++ b/lib/OpenLayers/Format/OWSCommon/v1.js @@ -4,13 +4,9 @@ * full text of the license. */ /** - * @requires OpenLayers/Format/XML.js + * @requires OpenLayers/Format/OWSCommon.js */ -if (!OpenLayers.Format.OWSCommon) { - OpenLayers.Format.OWSCommon = {}; -} - /** * Class: OpenLayers.Format.OWSCommon.v1 * Common readers and writers for OWSCommon v1.X formats @@ -28,6 +24,23 @@ OpenLayers.Format.OWSCommon.v1 = OpenLayers.Class(OpenLayers.Format.XML, { trimComma: (/\s*,\s*/g) }, + /** + * Method: read + * + * Parameters: + * data - {DOMElement} An OWSCommon document element. + * options - {Object} Options for the reader. + * + * Returns: + * {Object} An object representing the OWSCommon document. + */ + read: function(data, options) { + options = OpenLayers.Util.applyDefaults(options, this.options); + var ows = {}; + this.readChildNodes(data, ows); + return ows; + }, + /** * Property: readers * Contains public functions, grouped by namespace prefix, that will @@ -38,6 +51,19 @@ OpenLayers.Format.OWSCommon.v1 = OpenLayers.Class(OpenLayers.Format.XML, { */ readers: { "ows": { + "Exception": function(node, exceptionReport) { + var exception = { + code: node.getAttribute('exceptionCode'), + locator: node.getAttribute('locator'), + texts: [] + }; + exceptionReport.exceptions.push(exception); + this.readChildNodes(node, exception); + }, + "ExceptionText": function(node, exception) { + var text = this.getChildValue(node); + exception.texts.push(text); + }, "ServiceIdentification": function(node, obj) { obj.serviceIdentification = {}; this.readChildNodes(node, obj.serviceIdentification); diff --git a/lib/OpenLayers/Format/OWSCommon/v1_0_0.js b/lib/OpenLayers/Format/OWSCommon/v1_0_0.js index f864b9b00a..590cca3b6c 100644 --- a/lib/OpenLayers/Format/OWSCommon/v1_0_0.js +++ b/lib/OpenLayers/Format/OWSCommon/v1_0_0.js @@ -9,8 +9,7 @@ /** * Class: OpenLayers.Format.OWSCommon.v1_0_0 - * Parser for OWS Common version 1.0.0 which can be used by other parsers. - * It is not intended to be used on its own. + * Parser for OWS Common version 1.0.0. */ OpenLayers.Format.OWSCommon.v1_0_0 = OpenLayers.Class(OpenLayers.Format.OWSCommon.v1, { @@ -19,7 +18,7 @@ OpenLayers.Format.OWSCommon.v1_0_0 = OpenLayers.Class(OpenLayers.Format.OWSCommo * {Object} Mapping of namespace aliases to namespace URIs. */ namespaces: { - ows: "http://www.opengis.net/ows/1.0", + ows: "http://www.opengis.net/ows", xlink: "http://www.w3.org/1999/xlink" }, @@ -32,7 +31,16 @@ OpenLayers.Format.OWSCommon.v1_0_0 = OpenLayers.Class(OpenLayers.Format.OWSCommo * from the parent. */ readers: { - "ows": OpenLayers.Format.OWSCommon.v1.prototype.readers["ows"] + "ows": OpenLayers.Util.applyDefaults({ + "ExceptionReport": function(node, obj) { + obj.exceptionReport = { + version: node.getAttribute('version'), + language: node.getAttribute('language'), + exceptions: [] + }; + this.readChildNodes(node, obj.exceptionReport); + } + }, OpenLayers.Format.OWSCommon.v1.prototype.readers.ows) }, /** @@ -42,9 +50,9 @@ OpenLayers.Format.OWSCommon.v1_0_0 = OpenLayers.Class(OpenLayers.Format.OWSCommo * node names they produce. */ writers: { - "ows": OpenLayers.Format.OWSCommon.v1.prototype.writers["ows"] + "ows": OpenLayers.Format.OWSCommon.v1.prototype.writers.ows }, - CLASS_NAME: "OpenLayers.Format.OWSCommon.v1_1_0" + CLASS_NAME: "OpenLayers.Format.OWSCommon.v1_0_0" }); diff --git a/lib/OpenLayers/Format/OWSCommon/v1_1_0.js b/lib/OpenLayers/Format/OWSCommon/v1_1_0.js index 3c5aad03aa..167d6dfc59 100644 --- a/lib/OpenLayers/Format/OWSCommon/v1_1_0.js +++ b/lib/OpenLayers/Format/OWSCommon/v1_1_0.js @@ -9,8 +9,7 @@ /** * Class: OpenLayers.Format.OWSCommon.v1_1_0 - * Parser for OWS Common version 1.1.0 which can be used by other parsers. - * It is not intended to be used on its own. + * Parser for OWS Common version 1.1.0. */ OpenLayers.Format.OWSCommon.v1_1_0 = OpenLayers.Class(OpenLayers.Format.OWSCommon.v1, { @@ -33,6 +32,14 @@ OpenLayers.Format.OWSCommon.v1_1_0 = OpenLayers.Class(OpenLayers.Format.OWSCommo */ readers: { "ows": OpenLayers.Util.applyDefaults({ + "ExceptionReport": function(node, obj) { + obj.exceptionReport = { + version: node.getAttribute('version'), + language: node.getAttribute('xml:lang'), + exceptions: [] + }; + this.readChildNodes(node, obj.exceptionReport); + }, "AllowedValues": function(node, parameter) { parameter.allowedValues = {}; this.readChildNodes(node, parameter.allowedValues); diff --git a/lib/OpenLayers/Format/WFSCapabilities.js b/lib/OpenLayers/Format/WFSCapabilities.js index 0c6d4460c9..45f62a5af2 100644 --- a/lib/OpenLayers/Format/WFSCapabilities.js +++ b/lib/OpenLayers/Format/WFSCapabilities.js @@ -5,6 +5,7 @@ /** * @requires OpenLayers/Format/XML.js + * @requires OpenLayers/Format/OGCExceptionReport.js */ /** @@ -67,6 +68,11 @@ OpenLayers.Format.WFSCapabilities = OpenLayers.Class(OpenLayers.Format.XML, { } var parser = new constr(this.options); var capabilities = parser.read(data); + if (capabilities.service === undefined) { + // an error must have happened, so parse it and report back + var format = new OpenLayers.Format.OGCExceptionReport(); + capabilities.error = format.read(data); + } capabilities.version = version; return capabilities; }, diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1.js b/lib/OpenLayers/Format/WMSCapabilities/v1.js index b715bfd6e8..2c693aa468 100644 --- a/lib/OpenLayers/Format/WMSCapabilities/v1.js +++ b/lib/OpenLayers/Format/WMSCapabilities/v1.js @@ -5,6 +5,7 @@ /** * @requires OpenLayers/Format/WMSCapabilities.js + * @requires OpenLayers/Format/OGCExceptionReport.js * @requires OpenLayers/Format/XML.js */ @@ -60,15 +61,20 @@ OpenLayers.Format.WMSCapabilities.v1 = OpenLayers.Class( if(typeof data == "string") { data = OpenLayers.Format.XML.prototype.read.apply(this, [data]); } + var raw = data; if(data && data.nodeType == 9) { data = data.documentElement; } var capabilities = {}; this.readNode(data, capabilities); - - // postprocess the layer list - this.postProcessLayers(capabilities); - + if (capabilities.service === undefined) { + // an exception must have occurred, so parse it + var parser = new OpenLayers.Format.OGCExceptionReport(); + capabilities.error = parser.read(raw); + } else { + // postprocess the layer list + this.postProcessLayers(capabilities); + } return capabilities; }, diff --git a/tests/Format/OGCExceptionReport.html b/tests/Format/OGCExceptionReport.html new file mode 100644 index 0000000000..7846f94290 --- /dev/null +++ b/tests/Format/OGCExceptionReport.html @@ -0,0 +1,100 @@ + + + + + + + + diff --git a/tests/Format/OWSCommon/v1_0_0.html b/tests/Format/OWSCommon/v1_0_0.html new file mode 100644 index 0000000000..9d255b2252 --- /dev/null +++ b/tests/Format/OWSCommon/v1_0_0.html @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/tests/Format/OWSCommon/v1_1_0.html b/tests/Format/OWSCommon/v1_1_0.html new file mode 100644 index 0000000000..e899ea8486 --- /dev/null +++ b/tests/Format/OWSCommon/v1_1_0.html @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/tests/Format/WFSCapabilities/v1.html b/tests/Format/WFSCapabilities/v1.html index f574fff925..d7132701dc 100644 --- a/tests/Format/WFSCapabilities/v1.html +++ b/tests/Format/WFSCapabilities/v1.html @@ -2,6 +2,23 @@ From 58279bfb71a22913c9b54c7341cf68ec177f8031 Mon Sep 17 00:00:00 2001 From: bartvde Date: Wed, 15 Jun 2011 07:48:06 +0000 Subject: [PATCH 033/141] fix up WFSCapabilities tests, thanks pgiraud for the report (closes #2234) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12084 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/OWSCommon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Format/OWSCommon.js b/lib/OpenLayers/Format/OWSCommon.js index db975f2be9..2b644d48f3 100644 --- a/lib/OpenLayers/Format/OWSCommon.js +++ b/lib/OpenLayers/Format/OWSCommon.js @@ -66,7 +66,7 @@ OpenLayers.Format.OWSCommon = OpenLayers.Class(OpenLayers.Format.XML, { // remember version does not correspond to the OWS version // it corresponds to the WMS/WFS/WCS etc. request version var uri = root.getAttribute("xmlns:ows"); - if (uri.substring(uri.lastIndexOf("/")+1) === "1.1") { + if (uri && uri.substring(uri.lastIndexOf("/")+1) === "1.1") { version ="1.1.0"; } if(!version) { From dd5fa7eaab02341b55b20c24b8450a49f672df70 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Wed, 15 Jun 2011 10:59:08 +0000 Subject: [PATCH 034/141] adding a comment to explain r12084 (see #2234) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12085 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/OWSCommon.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/OpenLayers/Format/OWSCommon.js b/lib/OpenLayers/Format/OWSCommon.js index 2b644d48f3..b2d71163f7 100644 --- a/lib/OpenLayers/Format/OWSCommon.js +++ b/lib/OpenLayers/Format/OWSCommon.js @@ -66,6 +66,8 @@ OpenLayers.Format.OWSCommon = OpenLayers.Class(OpenLayers.Format.XML, { // remember version does not correspond to the OWS version // it corresponds to the WMS/WFS/WCS etc. request version var uri = root.getAttribute("xmlns:ows"); + // the above will fail if the namespace prefix is different than + // ows and if the namspace is declared on a different element if (uri && uri.substring(uri.lastIndexOf("/")+1) === "1.1") { version ="1.1.0"; } From cbac5db29a5680bf2fd3c9ef4bd7f6ece383f453 Mon Sep 17 00:00:00 2001 From: bartvde Date: Wed, 15 Jun 2011 11:19:45 +0000 Subject: [PATCH 035/141] fix typo in comment, non-functional change git-svn-id: http://svn.openlayers.org/trunk/openlayers@12086 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/OWSCommon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Format/OWSCommon.js b/lib/OpenLayers/Format/OWSCommon.js index b2d71163f7..e940e987d7 100644 --- a/lib/OpenLayers/Format/OWSCommon.js +++ b/lib/OpenLayers/Format/OWSCommon.js @@ -67,7 +67,7 @@ OpenLayers.Format.OWSCommon = OpenLayers.Class(OpenLayers.Format.XML, { // it corresponds to the WMS/WFS/WCS etc. request version var uri = root.getAttribute("xmlns:ows"); // the above will fail if the namespace prefix is different than - // ows and if the namspace is declared on a different element + // ows and if the namespace is declared on a different element if (uri && uri.substring(uri.lastIndexOf("/")+1) === "1.1") { version ="1.1.0"; } From a5f0b300f856c3b3aaa6a729c3f5789d9d2578b1 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 15 Jun 2011 20:55:08 +0000 Subject: [PATCH 036/141] Adding example demonstrating the use of a spatial filter with the WFS protocol. git-svn-id: http://svn.openlayers.org/trunk/openlayers@12087 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/wfs-spatial-filter.html | 37 ++++++++++++++++++++++++++++++++ examples/wfs-spatial-filter.js | 36 +++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 examples/wfs-spatial-filter.html create mode 100644 examples/wfs-spatial-filter.js diff --git a/examples/wfs-spatial-filter.html b/examples/wfs-spatial-filter.html new file mode 100644 index 0000000000..d6acead436 --- /dev/null +++ b/examples/wfs-spatial-filter.html @@ -0,0 +1,37 @@ + + + + + + + OpenLayers WFS Protocol with Filter + + + + + +

    WFS Protocol and Filter

    +
    + filter, wfs, spatial +
    +

    + Demonstrates the use of a spatial filter in making GetFeature requests using the WFS protocol. +

    +
    +
    +

    + If a vector layer has a filter and the protocol supports server-side filtering, + the filter will be serialized in requests for features. The WFS protocol can be + used with a vector layer to serialize a filter using OGC Filter Encoding. +

    + This example has a draw control that is always active. When you draw a polygon + on the map, the filter for the main vector layer will be updated, and features + that intersect your drawn polygon will be requested. +

    + See the source + for details on how this is done. +

    +
    + + + diff --git a/examples/wfs-spatial-filter.js b/examples/wfs-spatial-filter.js new file mode 100644 index 0000000000..d39b0bea85 --- /dev/null +++ b/examples/wfs-spatial-filter.js @@ -0,0 +1,36 @@ +OpenLayers.ProxyHost= "/proxy?url="; +var map = new OpenLayers.Map('map'); +var wms = new OpenLayers.Layer.WMS( + "OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0", + {layers: "basic"} +); + +var layer = new OpenLayers.Layer.Vector("WFS", { + strategies: [new OpenLayers.Strategy.BBOX()], + protocol: new OpenLayers.Protocol.WFS({ + url: "http://demo.opengeo.org/geoserver/wfs", + featureType: "tasmania_roads", + featureNS: "http://www.openplans.org/topp" + }) +}); + +map.addLayers([wms, layer]); +map.setCenter(new OpenLayers.LonLat(146.7, -41.8), 6); + +var drawings = new OpenLayers.Layer.Vector(); +map.addLayer(drawings); +var draw = new OpenLayers.Control.DrawFeature(drawings, OpenLayers.Handler.Polygon); +map.addControl(draw); +draw.activate(); + +drawings.events.on({ + beforefeatureadded: function(event) { + var geometry = event.feature.geometry; + layer.filter = new OpenLayers.Filter.Spatial({ + type: OpenLayers.Filter.Spatial.INTERSECTS, + value: event.feature.geometry + }); + layer.refresh({force: true}); + return false; + } +}); From 54cccc0783d9607dfab601acf0d64dc911fa5c99 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 15 Jun 2011 21:15:59 +0000 Subject: [PATCH 037/141] Proxy chasing. git-svn-id: http://svn.openlayers.org/trunk/openlayers@12088 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/wfs-spatial-filter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/wfs-spatial-filter.js b/examples/wfs-spatial-filter.js index d39b0bea85..4ca9fd5624 100644 --- a/examples/wfs-spatial-filter.js +++ b/examples/wfs-spatial-filter.js @@ -1,4 +1,4 @@ -OpenLayers.ProxyHost= "/proxy?url="; +OpenLayers.ProxyHost= "proxy.cgi?url="; var map = new OpenLayers.Map('map'); var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0", From 995d612caa5efb51e919c625bb071bc1db8c684d Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 16 Jun 2011 19:16:25 +0000 Subject: [PATCH 038/141] More robust array type check. p=mwootendev, r=me (closes #2959) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12095 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/GetFeature.js | 2 +- lib/OpenLayers/Control/ModifyFeature.js | 2 +- lib/OpenLayers/Control/Panel.js | 2 +- lib/OpenLayers/Control/SelectFeature.js | 2 +- lib/OpenLayers/Control/WMSGetFeatureInfo.js | 6 ++--- lib/OpenLayers/Control/WMTSGetFeatureInfo.js | 2 +- lib/OpenLayers/Format/ArcXML.js | 2 +- lib/OpenLayers/Format/Atom.js | 10 ++++----- lib/OpenLayers/Format/CSWGetDomain/v2_0_2.js | 4 ++-- lib/OpenLayers/Format/CSWGetRecords/v2_0_2.js | 8 +++---- lib/OpenLayers/Format/GML.js | 2 +- lib/OpenLayers/Format/GML/Base.js | 2 +- lib/OpenLayers/Format/GML/v2.js | 2 +- lib/OpenLayers/Format/GML/v3.js | 2 +- lib/OpenLayers/Format/GeoJSON.js | 6 ++--- lib/OpenLayers/Format/GeoRSS.js | 2 +- lib/OpenLayers/Format/KML.js | 2 +- lib/OpenLayers/Format/OSM.js | 2 +- lib/OpenLayers/Format/OWSContext/v0_3_1.js | 2 +- lib/OpenLayers/Format/SLD/v1.js | 4 ++-- lib/OpenLayers/Format/WMC.js | 2 +- lib/OpenLayers/Format/WMC/v1.js | 2 +- lib/OpenLayers/Format/WMSCapabilities/v1.js | 2 +- lib/OpenLayers/Format/XLS/v1.js | 2 +- lib/OpenLayers/Geometry.js | 2 +- lib/OpenLayers/Geometry/Collection.js | 6 ++--- lib/OpenLayers/Layer/ArcGISCache.js | 2 +- lib/OpenLayers/Layer/HTTPRequest.js | 2 +- lib/OpenLayers/Layer/KaMapCache.js | 2 +- lib/OpenLayers/Layer/MapServer.js | 2 +- lib/OpenLayers/Layer/TMS.js | 2 +- lib/OpenLayers/Layer/TileCache.js | 2 +- lib/OpenLayers/Layer/Vector.js | 4 ++-- lib/OpenLayers/Layer/WMTS.js | 2 +- lib/OpenLayers/Layer/XYZ.js | 2 +- lib/OpenLayers/Layer/Zoomify.js | 2 +- lib/OpenLayers/Protocol/SQL/Gears.js | 4 ++-- lib/OpenLayers/Protocol/WFS.js | 2 +- lib/OpenLayers/Renderer.js | 2 +- lib/OpenLayers/Renderer/Canvas.js | 2 +- lib/OpenLayers/Tile/Image.js | 2 +- lib/OpenLayers/Util.js | 18 ++++++++++++++- tests/Util.html | 22 +++++++++++++++++++ 43 files changed, 97 insertions(+), 59 deletions(-) diff --git a/lib/OpenLayers/Control/GetFeature.js b/lib/OpenLayers/Control/GetFeature.js index 2523100821..ee2896db13 100644 --- a/lib/OpenLayers/Control/GetFeature.js +++ b/lib/OpenLayers/Control/GetFeature.js @@ -478,7 +478,7 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, { if(!this.modifiers.multiple && !this.modifiers.toggle) { this.unselectAll(); } - if(!(features instanceof Array)) { + if(!(OpenLayers.Util.isArray(features))) { features = [features]; } diff --git a/lib/OpenLayers/Control/ModifyFeature.js b/lib/OpenLayers/Control/ModifyFeature.js index 59298627f4..dbf2348271 100644 --- a/lib/OpenLayers/Control/ModifyFeature.js +++ b/lib/OpenLayers/Control/ModifyFeature.js @@ -215,7 +215,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { this.deleteCodes = [46, 68]; this.mode = OpenLayers.Control.ModifyFeature.RESHAPE; OpenLayers.Control.prototype.initialize.apply(this, [options]); - if(!(this.deleteCodes instanceof Array)) { + if(!(OpenLayers.Util.isArray(this.deleteCodes))) { this.deleteCodes = [this.deleteCodes]; } var control = this; diff --git a/lib/OpenLayers/Control/Panel.js b/lib/OpenLayers/Control/Panel.js index b0955426c4..1129ef4e52 100644 --- a/lib/OpenLayers/Control/Panel.js +++ b/lib/OpenLayers/Control/Panel.js @@ -232,7 +232,7 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, { * controls - {} Controls to add in the panel. */ addControls: function(controls) { - if (!(controls instanceof Array)) { + if (!(OpenLayers.Util.isArray(controls))) { controls = [controls]; } this.controls = this.controls.concat(controls); diff --git a/lib/OpenLayers/Control/SelectFeature.js b/lib/OpenLayers/Control/SelectFeature.js index 570ad715d5..d9e58217e2 100644 --- a/lib/OpenLayers/Control/SelectFeature.js +++ b/lib/OpenLayers/Control/SelectFeature.js @@ -218,7 +218,7 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, { * layers - {}, or an array of vector layers. */ initLayer: function(layers) { - if(layers instanceof Array) { + if(OpenLayers.Util.isArray(layers)) { this.layers = layers; this.layer = new OpenLayers.Layer.Vector.RootContainer( this.id + "_container", { diff --git a/lib/OpenLayers/Control/WMSGetFeatureInfo.js b/lib/OpenLayers/Control/WMSGetFeatureInfo.js index 6d3775f1ae..f0a21883cd 100644 --- a/lib/OpenLayers/Control/WMSGetFeatureInfo.js +++ b/lib/OpenLayers/Control/WMSGetFeatureInfo.js @@ -300,7 +300,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { layer = candidates[i]; if(layer instanceof OpenLayers.Layer.WMS && (!this.queryVisible || layer.getVisibility())) { - url = layer.url instanceof Array ? layer.url[0] : layer.url; + url = OpenLayers.Util.isArray(layer.url) ? layer.url[0] : layer.url; // if the control was not configured with a url, set it // to the first layer url if(this.drillDown === false && !this.url) { @@ -421,7 +421,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { if (layer.params.STYLES) { styleNames = layer.params.STYLES; } else { - if (layer.params.LAYERS instanceof Array) { + if (OpenLayers.Util.isArray(layer.params.LAYERS)) { styleNames = new Array(layer.params.LAYERS.length); } else { // Assume it's a String styleNames = layer.params.LAYERS.replace(/[^,]/g, ""); @@ -469,7 +469,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { for(var i=0, len=layers.length; i 0) { + if (OpenLayers.Util.isArray(ResponseHandler) && ResponseHandler.length > 0) { // ResponseHandler must be a non-empty array for(var i=0, len=ResponseHandler.length; i 0) { + if (OpenLayers.Util.isArray(ElementName) && ElementName.length > 0) { // ElementName must be a non-empty array for(var i=0, len=ElementName.length; i)} */ write: function(features) { - if (!(features instanceof Array)) { + if (!(OpenLayers.Util.isArray(features))) { features = [features]; } diff --git a/lib/OpenLayers/Format/OWSContext/v0_3_1.js b/lib/OpenLayers/Format/OWSContext/v0_3_1.js index 35edba7de7..4f4948fbc4 100644 --- a/lib/OpenLayers/Format/OWSContext/v0_3_1.js +++ b/lib/OpenLayers/Format/OWSContext/v0_3_1.js @@ -178,7 +178,7 @@ OpenLayers.Format.OWSContext.v0_3_1 = OpenLayers.Class(OpenLayers.Format.XML, { */ decomposeNestingPath: function(nPath){ var a = []; - if (nPath instanceof Array) { + if (OpenLayers.Util.isArray(nPath)) { var path = nPath.slice(); while (path.length > 0) { a.push(path.slice()); diff --git a/lib/OpenLayers/Format/SLD/v1.js b/lib/OpenLayers/Format/SLD/v1.js index 562b12508b..8f9f39d903 100644 --- a/lib/OpenLayers/Format/SLD/v1.js +++ b/lib/OpenLayers/Format/SLD/v1.js @@ -147,7 +147,7 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, { for(var i=0, len=layer.userStyles.length; i)} An array of geometries to add */ addComponents: function(components){ - if(!(components instanceof Array)) { + if(!(OpenLayers.Util.isArray(components))) { components = [components]; } for(var i=0, len=components.length; i)} The components to be removed */ removeComponents: function(components) { - if(!(components instanceof Array)) { + if(!(OpenLayers.Util.isArray(components))) { components = [components]; } for(var i=components.length-1; i>=0; --i) { @@ -468,7 +468,7 @@ OpenLayers.Geometry.Collection = OpenLayers.Class(OpenLayers.Geometry, { if(!geometry || !geometry.CLASS_NAME || (this.CLASS_NAME != geometry.CLASS_NAME)) { equivalent = false; - } else if(!(geometry.components instanceof Array) || + } else if(!(OpenLayers.Util.isArray(geometry.components)) || (geometry.components.length != this.components.length)) { equivalent = false; } else { diff --git a/lib/OpenLayers/Layer/ArcGISCache.js b/lib/OpenLayers/Layer/ArcGISCache.js index 86f9567edb..377a3132c6 100644 --- a/lib/OpenLayers/Layer/ArcGISCache.js +++ b/lib/OpenLayers/Layer/ArcGISCache.js @@ -430,7 +430,7 @@ OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, { var url = this.url; var s = '' + x + y + z; - if (url instanceof Array) { + if (OpenLayers.Util.isArray(url)) { url = this.selectUrl(s, url); } diff --git a/lib/OpenLayers/Layer/HTTPRequest.js b/lib/OpenLayers/Layer/HTTPRequest.js index 46fe94bf62..3b7a154fcd 100644 --- a/lib/OpenLayers/Layer/HTTPRequest.js +++ b/lib/OpenLayers/Layer/HTTPRequest.js @@ -209,7 +209,7 @@ OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, { // in which case we will deterministically select one of them in // order to evenly distribute requests to different urls. // - if (url instanceof Array) { + if (OpenLayers.Util.isArray(url)) { url = this.selectUrl(paramsString, url); } diff --git a/lib/OpenLayers/Layer/KaMapCache.js b/lib/OpenLayers/Layer/KaMapCache.js index 9a33d316f1..4cf8e7efa4 100644 --- a/lib/OpenLayers/Layer/KaMapCache.js +++ b/lib/OpenLayers/Layer/KaMapCache.js @@ -117,7 +117,7 @@ OpenLayers.Layer.KaMapCache = OpenLayers.Class(OpenLayers.Layer.KaMap, { // order to evenly distribute requests to different urls. // var url = this.url; - if (url instanceof Array) { + if (OpenLayers.Util.isArray(url)) { url = this.selectUrl(paramsString, url); } diff --git a/lib/OpenLayers/Layer/MapServer.js b/lib/OpenLayers/Layer/MapServer.js index 352c9b9755..e08aa74913 100644 --- a/lib/OpenLayers/Layer/MapServer.js +++ b/lib/OpenLayers/Layer/MapServer.js @@ -136,7 +136,7 @@ OpenLayers.Layer.MapServer = OpenLayers.Class(OpenLayers.Layer.Grid, { // if url is not a string, it should be an array of strings, // in which case we will deterministically select one of them in // order to evenly distribute requests to different urls. - if (url instanceof Array) { + if (OpenLayers.Util.isArray(url)) { url = this.selectUrl(paramsString, url); } diff --git a/lib/OpenLayers/Layer/TMS.js b/lib/OpenLayers/Layer/TMS.js index 7b990e5f0c..a596f5b957 100644 --- a/lib/OpenLayers/Layer/TMS.js +++ b/lib/OpenLayers/Layer/TMS.js @@ -129,7 +129,7 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { this.map.getZoom() + this.zoomOffset; var path = this.serviceVersion + "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type; var url = this.url; - if (url instanceof Array) { + if (OpenLayers.Util.isArray(url)) { url = this.selectUrl(path, url); } return url + path; diff --git a/lib/OpenLayers/Layer/TileCache.js b/lib/OpenLayers/Layer/TileCache.js index 90d432be0d..3510af5c5f 100644 --- a/lib/OpenLayers/Layer/TileCache.js +++ b/lib/OpenLayers/Layer/TileCache.js @@ -138,7 +138,7 @@ OpenLayers.Layer.TileCache = OpenLayers.Class(OpenLayers.Layer.Grid, { ]; var path = components.join('/'); var url = this.url; - if (url instanceof Array) { + if (OpenLayers.Util.isArray(url)) { url = this.selectUrl(path, url); } url = (url.charAt(url.length - 1) == '/') ? url : url + '/'; diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js index 7a0cb51631..436ff68f66 100644 --- a/lib/OpenLayers/Layer/Vector.js +++ b/lib/OpenLayers/Layer/Vector.js @@ -554,7 +554,7 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { * options - {Object} */ addFeatures: function(features, options) { - if (!(features instanceof Array)) { + if (!(OpenLayers.Util.isArray(features))) { features = [features]; } @@ -643,7 +643,7 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { if (features === this.features) { return this.removeAllFeatures(options); } - if (!(features instanceof Array)) { + if (!(OpenLayers.Util.isArray(features))) { features = [features]; } if (features === this.selectedFeatures) { diff --git a/lib/OpenLayers/Layer/WMTS.js b/lib/OpenLayers/Layer/WMTS.js index 0c1c8c9cf8..0e6045bf59 100644 --- a/lib/OpenLayers/Layer/WMTS.js +++ b/lib/OpenLayers/Layer/WMTS.js @@ -408,7 +408,7 @@ OpenLayers.Layer.WMTS = OpenLayers.Class(OpenLayers.Layer.Grid, { path = path + this.matrixSet + "/" + this.matrix.identifier + "/" + info.row + "/" + info.col + "." + this.formatSuffix; - if (this.url instanceof Array) { + if (OpenLayers.Util.isArray(this.url)) { url = this.selectUrl(path, this.url); } else { url = this.url; diff --git a/lib/OpenLayers/Layer/XYZ.js b/lib/OpenLayers/Layer/XYZ.js index d0b6a34991..86520ab870 100644 --- a/lib/OpenLayers/Layer/XYZ.js +++ b/lib/OpenLayers/Layer/XYZ.js @@ -120,7 +120,7 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, { getURL: function (bounds) { var xyz = this.getXYZ(bounds); var url = this.url; - if (url instanceof Array) { + if (OpenLayers.Util.isArray(url)) { var s = '' + xyz.x + xyz.y + xyz.z; url = this.selectUrl(s, url); } diff --git a/lib/OpenLayers/Layer/Zoomify.js b/lib/OpenLayers/Layer/Zoomify.js index 5b2940500c..b6150a9fb1 100644 --- a/lib/OpenLayers/Layer/Zoomify.js +++ b/lib/OpenLayers/Layer/Zoomify.js @@ -211,7 +211,7 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, { var path = "TileGroup" + Math.floor( (tileIndex) / 256 ) + "/" + z + "-" + x + "-" + y + ".jpg"; var url = this.url; - if (url instanceof Array) { + if (OpenLayers.Util.isArray(url)) { url = this.selectUrl(path, url); } return url + path; diff --git a/lib/OpenLayers/Protocol/SQL/Gears.js b/lib/OpenLayers/Protocol/SQL/Gears.js index b87f177f56..55cb72d43d 100644 --- a/lib/OpenLayers/Protocol/SQL/Gears.js +++ b/lib/OpenLayers/Protocol/SQL/Gears.js @@ -302,7 +302,7 @@ OpenLayers.Protocol.SQL.Gears = OpenLayers.Class(OpenLayers.Protocol.SQL, { * object. */ createOrUpdate: function(features) { - if (!(features instanceof Array)) { + if (!(OpenLayers.Util.isArray(features))) { features = [features]; } @@ -397,7 +397,7 @@ OpenLayers.Protocol.SQL.Gears = OpenLayers.Class(OpenLayers.Protocol.SQL, { * object. */ "delete": function(features, options) { - if (!(features instanceof Array)) { + if (!(OpenLayers.Util.isArray(features))) { features = [features]; } diff --git a/lib/OpenLayers/Protocol/WFS.js b/lib/OpenLayers/Protocol/WFS.js index c0b13e4ee9..fe1da18953 100644 --- a/lib/OpenLayers/Protocol/WFS.js +++ b/lib/OpenLayers/Protocol/WFS.js @@ -45,7 +45,7 @@ OpenLayers.Protocol.WFS = function(options) { OpenLayers.Protocol.WFS.fromWMSLayer = function(layer, options) { var typeName, featurePrefix; var param = layer.params["LAYERS"]; - var parts = (param instanceof Array ? param[0] : param).split(":"); + var parts = (OpenLayers.Util.isArray(param) ? param[0] : param).split(":"); if(parts.length > 1) { featurePrefix = parts[0]; } diff --git a/lib/OpenLayers/Renderer.js b/lib/OpenLayers/Renderer.js index 500e120b26..6a35b3f34c 100644 --- a/lib/OpenLayers/Renderer.js +++ b/lib/OpenLayers/Renderer.js @@ -267,7 +267,7 @@ OpenLayers.Renderer = OpenLayers.Class({ * features - {Array()} */ eraseFeatures: function(features) { - if(!(features instanceof Array)) { + if(!(OpenLayers.Util.isArray(features))) { features = [features]; } for(var i=0, len=features.length; i)} */ eraseFeatures: function(features) { - if(!(features instanceof Array)) { + if(!(OpenLayers.Util.isArray(features))) { features = [features]; } for(var i=0; i 1){ + if (urls && OpenLayers.Util.isArray(urls) && urls.length > 1){ var src = this.src.toString(); var current_url, k; for (k = 0; current_url = urls[k]; k++){ diff --git a/tests/Util.html b/tests/Util.html index 56b6c826de..7e83d27b25 100644 --- a/tests/Util.html +++ b/tests/Util.html @@ -41,6 +41,28 @@ "isElement reports that object returned by getElement is an Element"); } + function test_isArray(t) { + t.plan(5); + + var a; + + a = null; + t.eq(OpenLayers.Util.isArray(a), false, + "isArray reports 'null' isn't an Array"); + a = "Array"; + t.eq(OpenLayers.Util.isArray(a), false, + "isArray reports \"Array\" isn't an Array"); + a = {}; + t.eq(OpenLayers.Util.isArray(a), false, + "isArray reports {} isn't an Array"); + a = []; + t.eq(OpenLayers.Util.isArray(a), true, + "isArray reports [] is an Array"); + a = new Array(); + t.eq(OpenLayers.Util.isArray(a), true, + "isArray reports new Array() is an Array"); + } + function test_$(t) { t.plan(1); t.ok($ === custom$, "OpenLayers doesn't clobber existing definition of $."); From fe4da360ce4f5b862f4e4113a47eee5224d68d64 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 17 Jun 2011 13:16:53 +0000 Subject: [PATCH 039/141] Demonstrate that instanceof doesn't work for arrays created in another frame. git-svn-id: http://svn.openlayers.org/trunk/openlayers@12097 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Util.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/Util.html b/tests/Util.html index 7e83d27b25..7ec2ab3cc1 100644 --- a/tests/Util.html +++ b/tests/Util.html @@ -63,6 +63,20 @@ "isArray reports new Array() is an Array"); } + function test_iframe_isArray(t) { + t.plan(3); + // create an array in an iframe + var iframe = document.createElement("iframe"); + document.body.appendChild(iframe); + frames[frames.length-1].document.write( + " + + + diff --git a/examples/point-grid.js b/examples/point-grid.js new file mode 100644 index 0000000000..e3a29e89ca --- /dev/null +++ b/examples/point-grid.js @@ -0,0 +1,33 @@ +var points = new OpenLayers.Layer.PointGrid({ + isBaseLayer: true, dx: 15, dy: 15 +}); + +var map = new OpenLayers.Map({ + div: "map", + layers: [points], + center: new OpenLayers.LonLat(0, 0), + zoom: 2 +}); + +var rotation = document.getElementById("rotation"); +rotation.value = String(points.rotation); +rotation.onchange = function() { + points.setRotation(Number(rotation.value)); +} + +var dx = document.getElementById("dx"); +var dy = document.getElementById("dy"); +dx.value = String(points.dx); +dy.value = String(points.dy); +dx.onchange = function() { + points.setSpacing(Number(dx.value), Number(dy.value)); +} +dy.onchange = function() { + points.setSpacing(Number(dx.value), Number(dy.value)); +} + +var max = document.getElementById("max"); +max.value = String(points.maxFeatures); +max.onchange = function() { + points.setMaxFeatures(Number(max.value)); +} diff --git a/examples/snap-grid.html b/examples/snap-grid.html new file mode 100644 index 0000000000..b6b592d23e --- /dev/null +++ b/examples/snap-grid.html @@ -0,0 +1,78 @@ + + + + + + OpenLayers Snap Grid Example + + + + + +

    Snap Grid Example

    + +
    + snap grid +
    + +
    Use a PointGrid layer and a Snapping control to snap to a grid of regularly spaced points
    + +
    + + Grid rotation: + + +   + Grid spacing: + + +   + Max points: + + +
    +

    + This example demonstrates feature editing with snapping to a regular + grid. The map is configured with a OpenLayers.Layer.PointGrid + layer and a OpenLayers.Control.Snapping agent. For the + best performance, the point grid layer should not made visible. + Snapping still works with layers that are not visible. +

    + See the + snap-grid.js source to see how this is done. +

    +
    + + + + + diff --git a/examples/snap-grid.js b/examples/snap-grid.js new file mode 100644 index 0000000000..81a72dab11 --- /dev/null +++ b/examples/snap-grid.js @@ -0,0 +1,81 @@ +var points = new OpenLayers.Layer.PointGrid({ + name: "Snap Grid", + dx: 600, dy: 600, + styleMap: new OpenLayers.StyleMap({ + pointRadius: 1, + strokeColor: "#3333ff", + strokeWidth: 1, + fillOpacity: 1, + fillColor: "#ffffff", + graphicName: "square" + }) +}); + +var lines = new OpenLayers.Layer.Vector("Lines", { + styleMap: new OpenLayers.StyleMap({ + pointRadius: 3, + strokeColor: "#ff3300", + strokeWidth: 3, + fillOpacity: 0 + }) +}); + +var map = new OpenLayers.Map({ + div: "map", + layers: [new OpenLayers.Layer.OSM(), points, lines], + controls: [ + new OpenLayers.Control.Navigation(), + new OpenLayers.Control.LayerSwitcher(), + new OpenLayers.Control.Attribution() + ], + restrictedExtent: new OpenLayers.Bounds( + 1035374, 7448940, 1074510, 7468508 + ), + center: new OpenLayers.LonLat(1054942, 7458724), + zoom: 13 +}); + +// configure the snapping agent +var snap = new OpenLayers.Control.Snapping({ + layer: lines, + targets: [{ + layer: points, + tolerance: 15 + }] +}); +snap.activate(); + +// add some editing tools to a panel +var panel = new OpenLayers.Control.Panel({ + displayClass: "olControlEditingToolbar" +}); +var draw = new OpenLayers.Control.DrawFeature( + lines, OpenLayers.Handler.Path, + {displayClass: "olControlDrawFeaturePath", title: "Draw Features"} +); +modify = new OpenLayers.Control.ModifyFeature( + lines, {displayClass: "olControlModifyFeature", title: "Modify Features"} +); +panel.addControls([ + new OpenLayers.Control.Navigation({title: "Navigate"}), + modify, draw +]); +map.addControl(panel); + +var rotation = document.getElementById("rotation"); +rotation.value = String(points.rotation); +rotation.onchange = function() { + points.setRotation(Number(rotation.value)); +} + +var spacing = document.getElementById("spacing"); +spacing.value = String(points.dx); +spacing.onchange = function() { + points.setSpacing(Number(spacing.value)); +} + +var max = document.getElementById("max"); +max.value = String(points.maxFeatures); +max.onchange = function() { + points.setMaxFeatures(Number(max.value)); +} diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index fe395f7ddf..2351f0288c 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -232,6 +232,7 @@ "OpenLayers/Renderer/Canvas.js", "OpenLayers/Renderer/VML.js", "OpenLayers/Layer/Vector.js", + "OpenLayers/Layer/PointGrid.js", "OpenLayers/Layer/Vector/RootContainer.js", "OpenLayers/Strategy.js", "OpenLayers/Strategy/Filter.js", diff --git a/lib/OpenLayers/Layer/PointGrid.js b/lib/OpenLayers/Layer/PointGrid.js new file mode 100644 index 0000000000..7a82835d52 --- /dev/null +++ b/lib/OpenLayers/Layer/PointGrid.js @@ -0,0 +1,299 @@ +/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the Clear BSD license. + * See http://svn.openlayers.org/trunk/openlayers/license.txt for the + * full text of the license. */ + +/** + * @requires OpenLayers/Layer/Vector.js + * @requires OpenLayers/Geometry/Polygon.js + */ + +/** + * Class: OpenLayers.Layer.PointGrid + * A point grid layer dynamically generates a regularly spaced grid of point + * features. This is a specialty layer for cases where an application needs + * a regular grid of points. It can be used, for example, in an editing + * environment to snap to a grid. + * + * Create a new vector layer with the constructor. + * (code) + * // create a grid with points spaced at 10 map units + * var points = new OpenLayers.Layer.PointGrid({dx: 10, dy: 10}); + * + * // create a grid with different x/y spacing rotated 15 degrees clockwise. + * var points = new OpenLayers.Layer.PointGrid({dx: 5, dy: 10, rotation: 15}); + * (end) + * + * Inherits from: + * - + */ +OpenLayers.Layer.PointGrid = OpenLayers.Class(OpenLayers.Layer.Vector, { + + /** + * APIProperty: dx + * {Number} Point grid spacing in the x-axis direction (map units). + * Read-only. Use the method to modify this value. + */ + dx: null, + + /** + * APIProperty: dy + * {Number} Point grid spacing in the y-axis direction (map units). + * Read-only. Use the method to modify this value. + */ + dy: null, + + /** + * APIProperty: ratio + * {Number} Ratio of the desired grid size to the map viewport size. + * Default is 1.5. Larger ratios mean the grid is recalculated less often + * while panning. The setting has precedence when determining + * grid size. Read-only. Use the method to modify this value. + */ + ratio: 1.5, + + /** + * APIProperty: maxFeatures + * {Number} The maximum number of points to generate in the grid. Default + * is 250. Read-only. Use the method to modify this value. + */ + maxFeatures: 250, + + /** + * APIProperty: rotation + * {Number} Grid rotation (in degrees clockwise from the positive x-axis). + * Default is 0. Read-only. Use the method to modify this + * value. + */ + rotation: 0, + + /** + * APIProperty: origin + * {OpenLayers.LonLat} Grid origin. The grid lattice will be aligned with + * the origin. If not set at construction, the center of the map's maximum + * extent is used. Read-only. Use the method to modify this + * value. + */ + origin: null, + + /** + * Property: gridBounds + * {} Internally cached grid bounds (with optional + * rotation applied). + */ + gridBounds: null, + + /** + * Constructor: OpenLayers.Layer.PointGrid + * Creates a new point grid layer. + * + * Parameters: + * config - {Object} An object containing all configuration properties for + * the layer. The and properties are required to be set at + * construction. Any other layer properties may be set in this object. + */ + initialize: function(config) { + config = config || {}; + OpenLayers.Layer.Vector.prototype.initialize.apply(this, [config.name, config]); + }, + + /** + * Method: setMap + * The layer has been added to the map. + * + * Parameters: + * map - {} + */ + setMap: function(map) { + OpenLayers.Layer.Vector.prototype.setMap.apply(this, arguments); + map.events.register("moveend", this, this.onMoveEnd); + }, + + /** + * Method: removeMap + * The layer has been removed from the map. + * + * Parameters: + * map - {} + */ + removeMap: function(map) { + map.events.unregister("moveend", this, this.onMoveEnd); + OpenLayers.Layer.Vector.prototype.removeMap.apply(this, arguments); + }, + + /** + * APIMethod: setRatio + * Set the grid property and update the grid. Can only be called + * after the layer has been added to a map with a center/extent. + * + * Parameters: + * ratio - {Number} + */ + setRatio: function(ratio) { + this.ratio = ratio; + this.updateGrid(true); + }, + + /** + * APIMethod: setMaxFeatures + * Set the grid property and update the grid. Can only be + * called after the layer has been added to a map with a center/extent. + * + * Parameters: + * maxFeatures - {Number} + */ + setMaxFeatures: function(maxFeatures) { + this.maxFeatures = maxFeatures; + this.updateGrid(true); + }, + + /** + * APIMethod: setSpacing + * Set the grid and properties and update the grid. If only one + * argument is provided, it will be set as and . Can only be + * called after the layer has been added to a map with a center/extent. + * + * Parameters: + * dx - {Number} + * dy - {Number} + */ + setSpacing: function(dx, dy) { + this.dx = dx; + this.dy = dy || dx; + this.updateGrid(true); + }, + + /** + * APIMethod: setOrigin + * Set the grid property and update the grid. Can only be called + * after the layer has been added to a map with a center/extent. + * + * Parameters: + * origin - {} + */ + setOrigin: function(origin) { + this.origin = origin; + this.updateGrid(true); + }, + + /** + * APIMethod: getOrigin + * Get the grid property. + * + * Returns: + * {} The grid origin. + */ + getOrigin: function() { + if (!this.origin) { + this.origin = this.map.getExtent().getCenterLonLat(); + } + return this.origin; + }, + + /** + * APIMethod: setRotation + * Set the grid property and update the grid. Rotation values + * are in degrees clockwise from the positive x-axis (negative values + * for counter-clockwise rotation). Can only be called after the layer + * has been added to a map with a center/extent. + * + * Parameters: + * rotation - {Number} Degrees clockwise from the positive x-axis. + */ + setRotation: function(rotation) { + this.rotation = rotation; + this.updateGrid(true); + }, + + /** + * Method: onMoveEnd + * Listener for map "moveend" events. + */ + onMoveEnd: function() { + this.updateGrid(); + }, + + /** + * Method: getViewBounds + * Gets the (potentially rotated) view bounds for grid calculations. + * + * Returns: + * {} + */ + getViewBounds: function() { + var bounds = this.map.getExtent(); + if (this.rotation) { + var origin = this.getOrigin(); + var rotationOrigin = new OpenLayers.Geometry.Point(origin.lon, origin.lat); + var rect = bounds.toGeometry(); + rect.rotate(-this.rotation, rotationOrigin); + bounds = rect.getBounds(); + } + return bounds; + }, + + /** + * Method: updateGrid + * Update the grid. + * + * Parameters: + * force - {Boolean} Update the grid even if the previous bounds are still + * valid. + */ + updateGrid: function(force) { + if (force || this.invalidBounds()) { + var viewBounds = this.getViewBounds(); + var origin = this.getOrigin(); + var rotationOrigin = new OpenLayers.Geometry.Point(origin.lon, origin.lat); + var viewBoundsWidth = viewBounds.getWidth(); + var viewBoundsHeight = viewBounds.getHeight(); + var aspectRatio = viewBoundsWidth / viewBoundsHeight; + var maxHeight = Math.sqrt(this.dx * this.dy * this.maxFeatures / aspectRatio); + var maxWidth = maxHeight * aspectRatio; + var gridWidth = Math.min(viewBoundsWidth * this.ratio, maxWidth); + var gridHeight = Math.min(viewBoundsHeight * this.ratio, maxHeight); + var center = viewBounds.getCenterLonLat(); + this.gridBounds = new OpenLayers.Bounds( + center.lon - (gridWidth / 2), + center.lat - (gridHeight / 2), + center.lon + (gridWidth / 2), + center.lat + (gridHeight / 2) + ); + var rows = Math.floor(gridHeight / this.dy); + var cols = Math.floor(gridWidth / this.dx); + var gridLeft = origin.lon + (this.dx * Math.ceil((this.gridBounds.left - origin.lon) / this.dx)); + var gridBottom = origin.lat + (this.dy * Math.ceil((this.gridBounds.bottom - origin.lat) / this.dy)); + var features = new Array(rows * cols); + var x, y, point; + for (var i=0; i + + + + + + +
    + + diff --git a/tests/list-tests.html b/tests/list-tests.html index 3f378098f1..a56c678896 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -156,6 +156,7 @@
  • Layer/MapServer.html
  • Layer/Markers.html
  • Layer/MultiMap.html
  • +
  • Layer/PointGrid.html
  • Layer/PointTrack.html
  • Layer/SphericalMercator.html
  • Layer/Text.html
  • From 2cf3f62d1b009b6fa9b9f8d59fd241d5b9889b1e Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 17 Jun 2011 18:59:16 +0000 Subject: [PATCH 042/141] Methods for programmatically manipulating sketches while digitizing features. r=bartvde (closes #3343) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12103 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/draw-undo-redo.html | 38 ++++ examples/draw-undo-redo.js | 56 +++++ examples/editing-methods.html | 58 +++++ examples/editing-methods.js | 83 +++++++ lib/OpenLayers/Control/DrawFeature.js | 100 +++++++++ lib/OpenLayers/Geometry/Collection.js | 12 +- lib/OpenLayers/Geometry/LineString.js | 7 +- lib/OpenLayers/Geometry/LinearRing.js | 8 +- lib/OpenLayers/Handler/Path.js | 129 +++++++++++ lib/OpenLayers/Handler/Polygon.js | 12 +- tests/Handler/Path.html | 300 ++++++++++++++++++++++++++ tests/Handler/Polygon.html | 44 ++++ 12 files changed, 842 insertions(+), 5 deletions(-) create mode 100644 examples/draw-undo-redo.html create mode 100644 examples/draw-undo-redo.js create mode 100644 examples/editing-methods.html create mode 100644 examples/editing-methods.js diff --git a/examples/draw-undo-redo.html b/examples/draw-undo-redo.html new file mode 100644 index 0000000000..40ad3e2995 --- /dev/null +++ b/examples/draw-undo-redo.html @@ -0,0 +1,38 @@ + + + + OpenLayers Undo/Redo Drawing Methods + + + + + + + + +

    Undo/Redo Drawing

    +

    + Demonstrates the use of undo & redo methods while drawing. +

    +
    + +
    +

    + Use Ctrl-Z or ⌘-Z to undo while drawing. + Use Ctrl-Y or ⌘-Y to redo what you have + undone. Use Esc to cancel the current sketch. +

    + The control.undo method works on the current + sketch, removing the most recently added point. + The control.redo method adds back items that were + removed from an undo. To fully erase a sketch, call the + control.cancel method. +

    + View the draw-undo-redo.js + source to see how this is done. +

    +
    + + + + diff --git a/examples/draw-undo-redo.js b/examples/draw-undo-redo.js new file mode 100644 index 0000000000..74b8ad7d38 --- /dev/null +++ b/examples/draw-undo-redo.js @@ -0,0 +1,56 @@ +var map = new OpenLayers.Map({ + div: "map", + layers: [ + new OpenLayers.Layer.WMS( + "Global Imagery", + "http://maps.opengeo.org/geowebcache/service/wms", + {layers: "bluemarble"}, + {tileOrigin: new OpenLayers.LonLat(-180, -90)} + ), + new OpenLayers.Layer.Vector() + ], + center: new OpenLayers.LonLat(0, 0), + zoom: 1 +}); + +var draw = new OpenLayers.Control.DrawFeature( + map.layers[1], OpenLayers.Handler.Path +); +map.addControl(draw); +draw.activate(); + +OpenLayers.Event.observe(document, "keydown", function(evt) { + var code = evt.keyCode; + var handled = false; + if (code === 90) { + // z + if ("metaKey" in evt) { + if (evt.metaKey) { + draw.undo(); + handled = true; + } + } else if (evt.ctrlKey) { + draw.undo(); + handled = true; + } + } + if (code === 89) { + // y + if ("metaKey" in evt) { + if (evt.metaKey) { + draw.redo(); + handled = true; + } + } else if (evt.ctrlKey) { + draw.redo(); + handled = true; + } + } + if (handled) { + OpenLayers.Event.stop(evt); + } + if (code === 27) { + // esc + draw.cancel(); + } +}); \ No newline at end of file diff --git a/examples/editing-methods.html b/examples/editing-methods.html new file mode 100644 index 0000000000..eeab9166de --- /dev/null +++ b/examples/editing-methods.html @@ -0,0 +1,58 @@ + + + + OpenLayers Editing Methods + + + + + + + + +

    Editing Methods

    +

    + Demonstrates the use of editing methods for manipulating geometries + while drawing. +

    +
    + + +
    +

    + The control.insertXY method inserts a point at the given + map coordinates (x, y) immediately prior to the most recent point + (under the mouse). + The control.insertDeltaXY method inserts a point at + the given offset values (dx, dy) from the previously added point. + The control.insertDirectionLength method inserts a + point at offset direction and length from the previously added point. + Direction is measured counter-clockwise from the positive x-axis. + The control.insertDeflectionLength method inserts a + point at offset deflection and length from the previously added point. + Deflection is measured counter-clockwise from the previous line + segment. + The control.finishSketch method completes the current + sketch without adding the point under the user's mouse. This + allows a sketch to be finished without a double-click. + The control.cancel method discards the current + sketch and leaves the control active. + The control.insertXY method may be called before + any points are digitized manually. The other methods have no + effect until at least one point has been added to the sketch. +

    + View the editing-methods.js + source to see how this is done. +

    +
    + + + + diff --git a/examples/editing-methods.js b/examples/editing-methods.js new file mode 100644 index 0000000000..6986a9944e --- /dev/null +++ b/examples/editing-methods.js @@ -0,0 +1,83 @@ +var map = new OpenLayers.Map({ + div: "map", + layers: [ + new OpenLayers.Layer.WMS( + "Global Imagery", + "http://maps.opengeo.org/geowebcache/service/wms", + {layers: "bluemarble"}, + {tileOrigin: new OpenLayers.LonLat(-180, -90)} + ), + new OpenLayers.Layer.Vector() + ], + center: new OpenLayers.LonLat(0, 0), + zoom: 1 +}); + +var draw = new OpenLayers.Control.DrawFeature( + map.layers[1], OpenLayers.Handler.Path +); +map.addControl(draw); +draw.activate(); + +// handle clicks on method links +$("insertXY").onclick = function() { + var values = parseInput( + window.prompt( + "Enter map coordinates for new point (e.g. '-111, 46')", "x, y" + ) + ); + if (values != null) { + draw.insertXY(values[0], values[1]); + } +} +$("insertDeltaXY").onclick = function() { + var values = parseInput( + window.prompt( + "Enter offset values for new point (e.g. '15, -10')", "dx, dy" + ) + ); + if (values != null) { + draw.insertDeltaXY(values[0], values[1]); + } +} +$("insertDirectionLength").onclick = function() { + var values = parseInput( + window.prompt( + "Enter direction and length offset values for new point (e.g. '-45, 10')", "direction, length" + ) + ); + if (values != null) { + draw.insertDirectionLength(values[0], values[1]); + } +} +$("insertDeflectionLength").onclick = function() { + var values = parseInput( + window.prompt( + "Enter deflection and length offset values for new point (e.g. '15, 20')", "deflection, length" + ) + ); + if (values != null) { + draw.insertDeflectionLength(values[0], values[1]); + } +} +$("cancel").onclick = function() { + draw.cancel(); +} +$("finishSketch").onclick = function() { + draw.finishSketch(); +} + +function parseInput(text) { + var values = text.split(","); + if (values.length !== 2) { + values = null; + } else { + values[0] = parseFloat(values[0]); + values[1] = parseFloat(values[1]); + if (isNaN(values[0]) || isNaN(values[1])) { + window.alert("The two values must be numeric."); + values = null; + } + } + return values; +} \ No newline at end of file diff --git a/lib/OpenLayers/Control/DrawFeature.js b/lib/OpenLayers/Control/DrawFeature.js index c85eb22f83..eb843293f5 100644 --- a/lib/OpenLayers/Control/DrawFeature.js +++ b/lib/OpenLayers/Control/DrawFeature.js @@ -121,6 +121,106 @@ OpenLayers.Control.DrawFeature = OpenLayers.Class(OpenLayers.Control, { this.events.triggerEvent("featureadded",{feature : feature}); } }, + + /** + * APIMethod: insertXY + * Insert a point in the current sketch given x & y coordinates. + * + * Parameters: + * x - {Number} The x-coordinate of the point. + * y - {Number} The y-coordinate of the point. + */ + insertXY: function(x, y) { + if (this.handler && this.handler.line) { + this.handler.insertXY(x, y); + } + }, + + /** + * APIMethod: insertDeltaXY + * Insert a point given offsets from the previously inserted point. + * + * Parameters: + * dx - {Number} The x-coordinate offset of the point. + * dy - {Number} The y-coordinate offset of the point. + */ + insertDeltaXY: function(dx, dy) { + if (this.handler && this.handler.line) { + this.handler.insertDeltaXY(dx, dy); + } + }, + + /** + * APIMethod: insertDirectionLength + * Insert a point in the current sketch given a direction and a length. + * + * Parameters: + * direction - {Number} Degrees clockwise from the positive x-axis. + * length - {Number} Distance from the previously drawn point. + */ + insertDirectionLength: function(direction, length) { + if (this.handler && this.handler.line) { + this.handler.insertDirectionLength(direction, length); + } + }, + + /** + * APIMethod: insertDeflectionLength + * Insert a point in the current sketch given a deflection and a length. + * The deflection should be degrees clockwise from the previously + * digitized segment. + * + * Parameters: + * deflection - {Number} Degrees clockwise from the previous segment. + * length - {Number} Distance from the previously drawn point. + */ + insertDeflectionLength: function(deflection, length) { + if (this.handler && this.handler.line) { + this.handler.insertDeflectionLength(deflection, length); + } + }, + + /** + * APIMethod: undo + * Remove the most recently added point in the current sketch geometry. + * + * Returns: + * {Boolean} An edit was undone. + */ + undo: function() { + return this.handler.undo && this.handler.undo(); + }, + + /** + * APIMethod: redo + * Reinsert the most recently removed point resulting from an call. + * The undo stack is deleted whenever a point is added by other means. + * + * Returns: + * {Boolean} An edit was redone. + */ + redo: function() { + return this.handler.redo && this.handler.redo(); + }, + + /** + * APIMethod: finishSketch + * Finishes the sketch without including the currently drawn point. + * This method can be called to terminate drawing programmatically + * instead of waiting for the user to end the sketch. + */ + finishSketch: function() { + this.handler.finishGeometry(); + }, + + /** + * APIMethod: cancel + * Cancel the current sketch. This removes the current sketch and keeps + * the drawing control active. + */ + cancel: function() { + this.handler.cancel(); + }, CLASS_NAME: "OpenLayers.Control.DrawFeature" }); diff --git a/lib/OpenLayers/Geometry/Collection.js b/lib/OpenLayers/Geometry/Collection.js index 720339d350..3d05ff1778 100644 --- a/lib/OpenLayers/Geometry/Collection.js +++ b/lib/OpenLayers/Geometry/Collection.js @@ -183,14 +183,20 @@ OpenLayers.Geometry.Collection = OpenLayers.Class(OpenLayers.Geometry, { * * Parameters: * components - {Array()} The components to be removed + * + * Returns: + * {Boolean} A component was removed. */ removeComponents: function(components) { + var removed = false; + if(!(OpenLayers.Util.isArray(components))) { components = [components]; } for(var i=components.length-1; i>=0; --i) { - this.removeComponent(components[i]); + removed = this.removeComponent(components[i]) || removed; } + return removed; }, /** @@ -199,6 +205,9 @@ OpenLayers.Geometry.Collection = OpenLayers.Class(OpenLayers.Geometry, { * * Parameters: * component - {} + * + * Returns: + * {Boolean} The component was removed. */ removeComponent: function(component) { @@ -207,6 +216,7 @@ OpenLayers.Geometry.Collection = OpenLayers.Class(OpenLayers.Geometry, { // clearBounds() so that it gets recalculated on the next call // to this.getBounds(); this.clearBounds(); + return true; }, /** diff --git a/lib/OpenLayers/Geometry/LineString.js b/lib/OpenLayers/Geometry/LineString.js index 5efe6e0a07..dc16f25020 100644 --- a/lib/OpenLayers/Geometry/LineString.js +++ b/lib/OpenLayers/Geometry/LineString.js @@ -37,12 +37,17 @@ OpenLayers.Geometry.LineString = OpenLayers.Class(OpenLayers.Geometry.Curve, { * * Parameters: * point - {} The point to be removed + * + * Returns: + * {Boolean} The component was removed. */ removeComponent: function(point) { - if ( this.components && (this.components.length > 2)) { + var removed = this.components && (this.components.length > 2); + if (removed) { OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this, arguments); } + return removed; }, /** diff --git a/lib/OpenLayers/Geometry/LinearRing.js b/lib/OpenLayers/Geometry/LinearRing.js index 3b007d4745..dd19c92696 100644 --- a/lib/OpenLayers/Geometry/LinearRing.js +++ b/lib/OpenLayers/Geometry/LinearRing.js @@ -91,10 +91,13 @@ OpenLayers.Geometry.LinearRing = OpenLayers.Class( * * Parameters: * point - {} + * + * Returns: + * {Boolean} The component was removed. */ removeComponent: function(point) { - if (this.components.length > 3) { - + var removed = this.components && (this.components.length > 3); + if (removed) { //remove last point this.components.pop(); @@ -106,6 +109,7 @@ OpenLayers.Geometry.LinearRing = OpenLayers.Class( OpenLayers.Geometry.Collection.prototype.addComponent.apply(this, [firstPoint]); } + return removed; }, /** diff --git a/lib/OpenLayers/Handler/Path.js b/lib/OpenLayers/Handler/Path.js index a50874372c..955e5a8a90 100644 --- a/lib/OpenLayers/Handler/Path.js +++ b/lib/OpenLayers/Handler/Path.js @@ -67,6 +67,12 @@ OpenLayers.Handler.Path = OpenLayers.Class(OpenLayers.Handler.Point, { */ timerId: null, + /** + * Property: redoStack + * {Array} Stack containing points removed with . + */ + redoStack: null, + /** * Constructor: OpenLayers.Handler.Path * Create a new path hander @@ -170,6 +176,129 @@ OpenLayers.Handler.Path = OpenLayers.Class(OpenLayers.Handler.Point, { this.callback("point", [this.point.geometry, this.getGeometry()]); this.callback("modify", [this.point.geometry, this.getSketch()]); this.drawFeature(); + delete this.redoStack; + }, + + /** + * Method: insertXY + * Insert a point in the current sketch given x & y coordinates. The new + * point is inserted immediately before the most recently drawn point. + * + * Parameters: + * x - {Number} The x-coordinate of the point. + * y - {Number} The y-coordinate of the point. + */ + insertXY: function(x, y) { + this.line.geometry.addComponent( + new OpenLayers.Geometry.Point(x, y), + this.getCurrentPointIndex() + ); + this.drawFeature(); + delete this.redoStack; + }, + + /** + * Method: insertDeltaXY + * Insert a point given offsets from the previously inserted point. + * + * Parameters: + * dx - {Number} The x-coordinate offset of the point. + * dy - {Number} The y-coordinate offset of the point. + */ + insertDeltaXY: function(dx, dy) { + var previousIndex = this.getCurrentPointIndex() - 1; + var p0 = this.line.geometry.components[previousIndex]; + if (p0 && !isNaN(p0.x) && !isNaN(p0.y)) { + this.insertXY(p0.x + dx, p0.y + dy); + } + }, + + /** + * Method: insertDirectionLength + * Insert a point in the current sketch given a direction and a length. + * + * Parameters: + * direction - {Number} Degrees clockwise from the positive x-axis. + * length - {Number} Distance from the previously drawn point. + */ + insertDirectionLength: function(direction, length) { + direction *= Math.PI / 180; + var dx = length * Math.cos(direction); + var dy = length * Math.sin(direction); + this.insertDeltaXY(dx, dy); + }, + + /** + * Method: insertDeflectionLength + * Insert a point in the current sketch given a deflection and a length. + * The deflection should be degrees clockwise from the previously + * digitized segment. + * + * Parameters: + * deflection - {Number} Degrees clockwise from the previous segment. + * length - {Number} Distance from the previously drawn point. + */ + insertDeflectionLength: function(deflection, length) { + var previousIndex = this.getCurrentPointIndex() - 1; + if (previousIndex > 0) { + var p1 = this.line.geometry.components[previousIndex]; + var p0 = this.line.geometry.components[previousIndex-1]; + var theta = Math.atan2(p1.y - p0.y, p1.x - p0.x); + this.insertDirectionLength( + (theta * 180 / Math.PI) + deflection, length + ); + } + }, + + /** + * Method: getCurrentPointIndex + * + * Returns: + * {Number} The index of the most recently drawn point. + */ + getCurrentPointIndex: function() { + return this.line.geometry.components.length - 1; + }, + + + /** + * Method: undo + * Remove the most recently added point in the sketch geometry. + * + * Returns: + * {Boolean} A point was removed. + */ + undo: function() { + var geometry = this.line.geometry; + var components = geometry.components; + var index = this.getCurrentPointIndex() - 1; + var target = components[index]; + var undone = geometry.removeComponent(target); + if (undone) { + if (!this.redoStack) { + this.redoStack = []; + } + this.redoStack.push(target); + this.drawFeature(); + } + return undone; + }, + + /** + * Method: redo + * Reinsert the most recently removed point resulting from an call. + * The undo stack is deleted whenever a point is added by other means. + * + * Returns: + * {Boolean} A point was added. + */ + redo: function() { + var target = this.redoStack && this.redoStack.pop(); + if (target) { + this.line.geometry.addComponent(target, this.getCurrentPointIndex()); + this.drawFeature(); + } + return !!target; }, /** diff --git a/lib/OpenLayers/Handler/Polygon.js b/lib/OpenLayers/Handler/Polygon.js index 92342f6c81..64e626e445 100644 --- a/lib/OpenLayers/Handler/Polygon.js +++ b/lib/OpenLayers/Handler/Polygon.js @@ -127,7 +127,17 @@ OpenLayers.Handler.Polygon = OpenLayers.Class(OpenLayers.Handler.Path, { } OpenLayers.Handler.Path.prototype.addPoint.apply(this, arguments); }, - + + /** + * Method: getCurrentPointIndex + * + * Returns: + * {Number} The index of the most recently drawn point. + */ + getCurrentPointIndex: function() { + return this.line.geometry.components.length - 2; + }, + /** * Method: enforceTopology * Simple topology enforcement for drawing interior rings. Ensures vertices diff --git a/tests/Handler/Path.html b/tests/Handler/Path.html index 069fb00ccb..3f3ea03fdf 100644 --- a/tests/Handler/Path.html +++ b/tests/Handler/Path.html @@ -534,6 +534,306 @@ map.destroy(); } + /** + * Helper functions for editing method tests + */ + function editingMethodsSetup() { + var map = new OpenLayers.Map("map", { + resolutions: [1] + }); + var layer = new OpenLayers.Layer.Vector("foo", { + maxExtent: new OpenLayers.Bounds(-10, -10, 10, 10), + isBaseLayer: true + }); + map.addLayer(layer); + var control = new OpenLayers.Control.DrawFeature( + layer, OpenLayers.Handler.Path + ); + map.addControl(control); + map.setCenter(new OpenLayers.LonLat(0, 0), 0); + + control.activate(); + return { + handler: control.handler, + map: map + } + } + function userClick(handler, x, y) { + var px = new OpenLayers.Pixel(x, y); + handler.mousemove({type: "mousemove", xy: px}); + handler.mousedown({type: "mousedown", xy: px}); + handler.mouseup({type: "mouseup", xy: px}); + } + + /** + * Editing method tests: insertXY, insertDeltaXY, insertDirectionXY, + * insertDeflectionXY, undo, and redo + */ + function test_insertXY(t) { + t.plan(3); + var obj = editingMethodsSetup(); + var map = obj.map; + var handler = obj.handler; + + // add points at px(0, 0) and px(10, 10) + userClick(handler, 0, 0); + userClick(handler, 10, 10); + handler.mousemove({type: "mousemove", xy: new OpenLayers.Pixel(50, 50)}); + + t.eq(handler.line.geometry.components.length, 3, "line has three points after two clicks"); + + // programmatically add a point + handler.insertXY(5, 6); + t.eq(handler.line.geometry.components.length, 4, "line has four points after insertXY"); + t.geom_eq( + handler.line.geometry.components[2], + new OpenLayers.Geometry.Point(5, 6), + "third point comes from insertXY" + ); + + map.destroy(); + + } + + function test_insertDeltaXY(t) { + t.plan(3); + var obj = editingMethodsSetup(); + var map = obj.map; + var handler = obj.handler; + + // add points at px(0, 0) and px(10, 10) + userClick(handler, 0, 0); + userClick(handler, 10, 10); + handler.mousemove({type: "mousemove", xy: new OpenLayers.Pixel(50, 50)}); + + t.eq(handler.line.geometry.components.length, 3, "line has three points after two clicks"); + + // programmatically add a point + handler.insertDeltaXY(1, 2); + t.eq(handler.line.geometry.components.length, 4, "line has four points after insert"); + // expect a point that is offset from previous point + var exp = handler.line.geometry.components[1].clone(); + exp.move(1, 2); + t.geom_eq( + handler.line.geometry.components[2], exp, + "third point is offset by dx,dy from second point" + ); + + map.destroy(); + } + + function test_insertDirectionLength(t) { + t.plan(4); + var obj = editingMethodsSetup(); + var map = obj.map; + var handler = obj.handler; + + // add points at px(0, 0) and px(10, 10) + userClick(handler, 0, 0); + userClick(handler, 10, 10); + handler.mousemove({type: "mousemove", xy: new OpenLayers.Pixel(50, 50)}); + + t.eq(handler.line.geometry.components.length, 3, "line has three points after two clicks"); + + // programmatically add a point + handler.insertDirectionLength(45, 2); + t.eq(handler.line.geometry.components.length, 4, "line has four points after insert"); + var p1 = handler.line.geometry.components[1]; + var p2 = handler.line.geometry.components[2]; + + var direction = Math.atan2(p2.y - p1.y, p2.x - p1.x) * 180 / Math.PI; + t.eq(direction.toFixed(4), (45).toFixed(4), "inserted point offset with correct direction"); + var length = Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)); + t.eq(length.toFixed(4), (2).toFixed(4), "inserted point offset with correct length"); + + map.destroy(); + } + + function test_insertDeflectionLength(t) { + t.plan(4); + var obj = editingMethodsSetup(); + var map = obj.map; + var handler = obj.handler; + + // add points at px(0, 0) and px(10, 10) + userClick(handler, 0, 0); + userClick(handler, 10, 10); + handler.mousemove({type: "mousemove", xy: new OpenLayers.Pixel(50, 50)}); + + t.eq(handler.line.geometry.components.length, 3, "line has three points after two clicks"); + var p0 = handler.line.geometry.components[0]; + var p1 = handler.line.geometry.components[1]; + // angle of first segment + var dir0 = Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI; + + // programmatically add a point + handler.insertDeflectionLength(-30, 5); + t.eq(handler.line.geometry.components.length, 4, "line has four points after insert"); + var p2 = handler.line.geometry.components[2]; + // angle of second segment + var dir1 = Math.atan2(p2.y - p1.y, p2.x - p1.x) * 180 / Math.PI; + + var deflection = dir1 - dir0; + t.eq(deflection.toFixed(4), (-30).toFixed(4), "inserted point offset with correct deflection"); + + var length = Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)); + t.eq(length.toFixed(4), (5).toFixed(4), "inserted point offset with correct length"); + + map.destroy(); + } + + function test_undoredo1(t) { + t.plan(4); + var obj = editingMethodsSetup(); + var map = obj.map; + var handler = obj.handler; + + // add points and move mouse + userClick(handler, 0, 0); + userClick(handler, 10, 10); + userClick(handler, 50, 10); + handler.mousemove({type: "mousemove", xy: new OpenLayers.Pixel(50, 50)}); + var original = handler.line.geometry.clone(); + var len = original.components.length; + t.eq(len, 4, "original has four points after three clicks"); + + // one undo + handler.undo(); + var currentLen = handler.line.geometry.components.length; + t.eq(currentLen, len-1, "one point removed on undo"); + t.geom_eq( + handler.line.geometry.components[currentLen-1], + original.components[len-1], + "current point (mouse position) remains the same after undo" + ); + // one redo + handler.redo(); + t.geom_eq(original, handler.line.geometry, "one redo undoes one undo"); + + // cleanup + map.destroy(); + } + + function test_undoredo2(t) { + t.plan(8); + var obj = editingMethodsSetup(); + var map = obj.map; + var handler = obj.handler; + + // add points and move mouse + userClick(handler, 0, 0); + userClick(handler, 10, 10); + userClick(handler, 50, 10); + handler.mousemove({type: "mousemove", xy: new OpenLayers.Pixel(50, 50)}); + var original = handler.line.geometry.clone(); + var len = original.components.length; + t.eq(len, 4, "original has four points after three clicks"); + + // two undos + handler.undo(); + handler.undo(); + var currentLen = handler.line.geometry.components.length; + t.eq(currentLen, len-2, "two points removed on two undos"); + t.geom_eq( + handler.line.geometry.components[currentLen-1], + original.components[len-1], + "current point (mouse position) remains the same after two undos" + ); + // first redo + handler.redo(); + currentLen = handler.line.geometry.components.length; + t.eq(currentLen, len-1, "point added in first redo"); + t.geom_eq( + handler.line.geometry.components[currentLen-2], + original.components[len-3], + "correct point restored in first redo" + ); + + // second redo + handler.redo(); + currentLen = handler.line.geometry.components.length; + t.eq(currentLen, len, "point added in second redo"); + t.geom_eq( + handler.line.geometry.components[currentLen-2], + original.components[len-2], + "correct point restored in second redo" + ); + t.geom_eq(handler.line.geometry, original, "correct geometry"); + + // cleanup + map.destroy(); + } + + function test_undoredo3(t) { + t.plan(3); + var obj = editingMethodsSetup(); + var map = obj.map; + var handler = obj.handler; + + // add points and move mouse + userClick(handler, 0, 0); + userClick(handler, 10, 10); + userClick(handler, 50, 10); + handler.mousemove({type: "mousemove", xy: new OpenLayers.Pixel(50, 50)}); + var original = handler.line.geometry.clone(); + var len = original.components.length; + t.eq(len, 4, "original has four points after three clicks"); + + // gratuitous redos + var trouble = false; + try { + handler.undo(); + handler.undo(); + handler.redo(); + handler.redo(); + handler.redo(); + handler.redo(); + handler.redo(); + } catch (err) { + trouble = true; + } + t.ok(!trouble, "extra redos cause no ill effects"); + t.geom_eq(handler.line.geometry, original, "correct geometry"); + + // cleanup + map.destroy(); + } + + function test_undoredo4(t) { + t.plan(3); + var obj = editingMethodsSetup(); + var map = obj.map; + var handler = obj.handler; + + // add points and move mouse + userClick(handler, 0, 0); + userClick(handler, 10, 10); + userClick(handler, 50, 10); + handler.mousemove({type: "mousemove", xy: new OpenLayers.Pixel(50, 50)}); + var original = handler.line.geometry.clone(); + var len = original.components.length; + t.eq(len, 4, "original has four points after three clicks"); + + // gratuitous undos + var trouble = false; + try { + handler.undo(); + handler.undo(); + handler.undo(); + handler.undo(); + handler.undo(); + handler.undo(); + handler.undo(); + } catch (err) { + trouble = true; + } + t.ok(!trouble, "extra undos cause no ill effects"); + t.eq(handler.line.geometry.components.length, 2, "still left with two points after many undos") + + // cleanup + map.destroy(); + } + // // Sequence tests // diff --git a/tests/Handler/Polygon.html b/tests/Handler/Polygon.html index 1794ab9230..94e8febc5c 100644 --- a/tests/Handler/Polygon.html +++ b/tests/Handler/Polygon.html @@ -717,6 +717,50 @@ map.destroy(); } + function test_insertXY(t) { + t.plan(3); + var map = new OpenLayers.Map("map", { + resolutions: [1] + }); + var layer = new OpenLayers.Layer.Vector("foo", { + maxExtent: new OpenLayers.Bounds(-10, -10, 10, 10), + isBaseLayer: true + }); + map.addLayer(layer); + var control = new OpenLayers.Control.DrawFeature( + layer, OpenLayers.Handler.Polygon + ); + map.addControl(control); + map.setCenter(new OpenLayers.LonLat(0, 0), 0); + + control.activate(); + var handler = control.handler; + + function userClick(x, y) { + var px = new OpenLayers.Pixel(x, y); + handler.mousemove({type: "mousemove", xy: px}); + handler.mousedown({type: "mousedown", xy: px}); + handler.mouseup({type: "mouseup", xy: px}); + } + + // add points at px(0, 0) and px(10, 10) + userClick(0, 0); + userClick(10, 10); + t.eq(handler.line.geometry.components.length, 4, "ring has four points after two clicks"); + + // programmatically add a point + handler.insertXY(5, 6); + t.eq(handler.line.geometry.components.length, 5, "ring has five points after insertXY"); + t.geom_eq( + handler.line.geometry.components[2], + new OpenLayers.Geometry.Point(5, 6), + "third point comes from insertXY" + ); + + map.destroy(); + + } + // // Sequence tests // From 1ccf325285c231284a513db5995cde05d85b42a2 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 17 Jun 2011 21:10:15 +0000 Subject: [PATCH 043/141] Fix example to work where there is a metaKey but ctrl is used for undo/redo. git-svn-id: http://svn.openlayers.org/trunk/openlayers@12104 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/draw-undo-redo.js | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/examples/draw-undo-redo.js b/examples/draw-undo-redo.js index 74b8ad7d38..73900ab6a7 100644 --- a/examples/draw-undo-redo.js +++ b/examples/draw-undo-redo.js @@ -20,37 +20,26 @@ map.addControl(draw); draw.activate(); OpenLayers.Event.observe(document, "keydown", function(evt) { - var code = evt.keyCode; var handled = false; - if (code === 90) { - // z - if ("metaKey" in evt) { - if (evt.metaKey) { + switch (evt.keyCode) { + case 90: // z + if (evt.metaKey || evt.ctrlKey) { draw.undo(); handled = true; } - } else if (evt.ctrlKey) { - draw.undo(); - handled = true; - } - } - if (code === 89) { - // y - if ("metaKey" in evt) { - if (evt.metaKey) { + break; + case 89: // y + if (evt.metaKey || evt.ctrlKey) { draw.redo(); handled = true; } - } else if (evt.ctrlKey) { - draw.redo(); + break; + case 27: // esc + draw.cancel(); handled = true; - } + break; } if (handled) { OpenLayers.Event.stop(evt); } - if (code === 27) { - // esc - draw.cancel(); - } }); \ No newline at end of file From 6248cdc94dd9b15c2312ed5161b2ec0dd8fa2ea9 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sat, 18 Jun 2011 19:11:54 +0000 Subject: [PATCH 044/141] fixing getOLZoomFromMapObjectZoom so it also works when the layer is not the baseLayer. r=bartvde,tschaub (see #3342) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12105 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/FixedZoomLevels.js | 10 +++++ tests/Layer/FixedZoomLevels.html | 30 +++++++++++++- tests/manual/alloverlays-mixed.html | 55 +++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 tests/manual/alloverlays-mixed.html diff --git a/lib/OpenLayers/Layer/FixedZoomLevels.js b/lib/OpenLayers/Layer/FixedZoomLevels.js index 1c1dda8402..571398a827 100644 --- a/lib/OpenLayers/Layer/FixedZoomLevels.js +++ b/lib/OpenLayers/Layer/FixedZoomLevels.js @@ -287,6 +287,11 @@ OpenLayers.Layer.FixedZoomLevels = OpenLayers.Class({ var zoom = null; if (moZoom != null) { zoom = moZoom - this.minZoomLevel; + if (this.map.baseLayer !== this) { + zoom = this.map.baseLayer.getZoomForResolution( + this.getResolutionForZoom(zoom) + ) + } } return zoom; }, @@ -306,6 +311,11 @@ OpenLayers.Layer.FixedZoomLevels = OpenLayers.Class({ var zoom = null; if (olZoom != null) { zoom = olZoom + this.minZoomLevel; + if (this.map.baseLayer !== this) { + zoom = this.getZoomForResolution( + this.map.baseLayer.getResolutionForZoom(zoom) + ); + } } return zoom; }, diff --git a/tests/Layer/FixedZoomLevels.html b/tests/Layer/FixedZoomLevels.html index 581b445da3..133571bcb8 100644 --- a/tests/Layer/FixedZoomLevels.html +++ b/tests/Layer/FixedZoomLevels.html @@ -82,6 +82,34 @@ t.eq( layer.resolutions[i], resolutions[i + minZoomLevel], "resolutions array at index " + i + " ok"); } } + + function test_getMapObjectZoomFromOLZoom(t) { + t.plan(4); + + var map = new OpenLayers.Map("map", {allOverlays: true}); + var xyz = new OpenLayers.Layer.XYZ("xyz", "${x}${y}${z}", { + sphericalMercator: true, + resolutions: [39135.7584765625, 19567.87923828125, 9783.939619140625] + }); + var fixed = new (OpenLayers.Class(OpenLayers.Layer, OpenLayers.Layer.FixedZoomLevels, { + initialize: function() { + OpenLayers.Layer.prototype.initialize.apply(this, arguments); + } + }))("fixed", { + resolutions: [156543.03390625, 78271.516953125, 39135.7584765625, 19567.87923828125, 9783.939619140625], + minZoomLevel: 1 + }); + map.addLayers([xyz, fixed]); + map.setCenter(new OpenLayers.LonLat(0, 0), 2); + // map.getZoom() returns 2 + t.eq(fixed.getMapObjectZoomFromOLZoom(map.getZoom()), 4, "correct return value from getMapObjectZoomFromOLZoom"); + t.eq(fixed.getOLZoomFromMapObjectZoom(4), map.getZoom() - fixed.minZoomLevel, "correct return value from getOLZoomFromMapObjectZoom"); + + map.setBaseLayer(fixed); + // map.getZoom() returns 4 now + t.eq(fixed.getMapObjectZoomFromOLZoom(map.getZoom()), 5, "correct return value from getMapObjectZoomFromOLZoom"); + t.eq(fixed.getOLZoomFromMapObjectZoom(5), map.getZoom(), "correct return value from getOLZoomFromMapObjectZoom"); + } function p_createLayer(layer, mapOptions, layerOptions) { @@ -104,6 +132,6 @@ -
    +
    diff --git a/tests/manual/alloverlays-mixed.html b/tests/manual/alloverlays-mixed.html new file mode 100644 index 0000000000..4b64f11a32 --- /dev/null +++ b/tests/manual/alloverlays-mixed.html @@ -0,0 +1,55 @@ + + + + + + + OpenLayers Mixed allOverlays Test + + + + + + + + +

    Mixed allOverlays Test

    + +
    + +
    +

    + The map image aboved should show a Google layer and an opaque WMS + layer. They both should align (look at the border of West Africa) +

    +
    + + From a9d3b8b72e42e6350028e28178c89f5abd3d9d8e Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sat, 18 Jun 2011 19:25:46 +0000 Subject: [PATCH 045/141] removing the restrictedMinZoom property, and allow for restricting zoom levels with maxResolution and numZoomLevels. Thanks tschaub for the doc, test and examples improvements. r=tschaub (see #3338) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12106 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/bing-tiles.js | 2 +- lib/OpenLayers/Layer.js | 39 +++++++++++++++++------------ lib/OpenLayers/Layer/Bing.js | 30 +++++++++++++++++------ lib/OpenLayers/Layer/GoogleNG.js | 42 +++++++++++++++++--------------- lib/OpenLayers/Map.js | 18 ++------------ tests/Layer.html | 21 ++++++++++------ tests/Layer/GoogleNG.html | 13 +++++----- tests/Map.html | 38 ++++------------------------- 8 files changed, 98 insertions(+), 105 deletions(-) diff --git a/examples/bing-tiles.js b/examples/bing-tiles.js index 90c46c4c95..0d4546bd09 100644 --- a/examples/bing-tiles.js +++ b/examples/bing-tiles.js @@ -26,4 +26,4 @@ map.addControl(new OpenLayers.Control.LayerSwitcher()); map.setCenter(new OpenLayers.LonLat(-71.147, 42.472).transform( new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject() -), 12); +), 11); diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index c002f3c9b1..4a2cc4b8eb 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -275,18 +275,6 @@ OpenLayers.Layer = OpenLayers.Class({ */ numZoomLevels: null, - /** - * Property: restrictedMinZoom - * {Integer} Restriction of the minimum zoom level. This is used for layers - * that only use a subset of the resolutions in the - * array. This is independent of , which always starts - * counting at zoom level 0. If restrictedMinZoom is e.g. set to 2, - * the first two zoom levels (0 and 1) will not be used by this layer. - * If the layer is a base layer, zooming to the map's maxExtent means - * setting the map's zoom to 2. - */ - restrictedMinZoom: 0, - /** * APIProperty: minScale * {Float} @@ -474,8 +462,12 @@ OpenLayers.Layer = OpenLayers.Class({ * * Parameters: * newOptions - {Object} + * reinitialize - {Boolean} If set to true, and if resolution options of the + * current baseLayer were changed, the map will be recentered to make + * sure that it is displayed with a valid resolution, and a + * changebaselayer event will be triggered. */ - addOptions: function (newOptions) { + addOptions: function (newOptions, reinitialize) { if (this.options == null) { this.options = {}; @@ -502,6 +494,8 @@ OpenLayers.Layer = OpenLayers.Class({ // properties of the "properties" array defined below is set // in the new options if(this.map) { + // store current resolution so we can try to restore it later + var resolution = this.map.getResolution(); var properties = this.RESOLUTION_PROPERTIES.concat( ["projection", "units", "minExtent", "maxExtent"] ); @@ -510,6 +504,20 @@ OpenLayers.Layer = OpenLayers.Class({ OpenLayers.Util.indexOf(properties, o) >= 0) { this.initResolutions(); + if (reinitialize && this.map.baseLayer === this) { + // update map position, and restore previous resolution + this.map.setCenter(this.map.getCenter(), + this.map.getZoomForResolution(resolution), + false, true + ); + // trigger a changebaselayer event to make sure that + // all controls (especially + // OpenLayers.Control.PanZoomBar) get notified of the + // new options + this.map.events.triggerEvent("changebaselayer", { + layer: this + }); + } break; } } @@ -763,8 +771,7 @@ OpenLayers.Layer = OpenLayers.Class({ } else { if (this.map) { var resolution = this.map.getResolution(); - inRange = ( this.map.getZoom() >= this.restrictedMinZoom && - (resolution >= this.minResolution) && + inRange = ( (resolution >= this.minResolution) && (resolution <= this.maxResolution) ); } } @@ -1197,7 +1204,7 @@ OpenLayers.Layer = OpenLayers.Class({ } zoom = Math.max(0, i-1); } - return Math.max(this.restrictedMinZoom, zoom); + return zoom; }, /** diff --git a/lib/OpenLayers/Layer/Bing.js b/lib/OpenLayers/Layer/Bing.js index 655da7be1c..662f0301b1 100644 --- a/lib/OpenLayers/Layer/Bing.js +++ b/lib/OpenLayers/Layer/Bing.js @@ -21,6 +21,21 @@ */ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { + /** + * Property: serverResolutions + * {Array} the resolutions provided by the Bing servers. + */ + serverResolutions: [ + 156543.03390625, 78271.516953125, 39135.7584765625, + 19567.87923828125, 9783.939619140625, 4891.9698095703125, + 2445.9849047851562, 1222.9924523925781, 611.4962261962891, + 305.74811309814453, 152.87405654907226, 76.43702827453613, + 38.218514137268066, 19.109257068634033, 9.554628534317017, + 4.777314267158508, 2.388657133579254, 1.194328566789627, + 0.5971642833948135, 0.29858214169740677, 0.14929107084870338, + 0.07464553542435169 + ], + /** * Property: attributionTemplate * {String} @@ -80,7 +95,6 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { */ initialize: function(options) { options = OpenLayers.Util.applyDefaults({ - restrictedMinZoom: 1, sphericalMercator: true }, options); var name = options.name || "Bing " + (options.type || this.type); @@ -127,12 +141,14 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { this.url.push(url.replace("{subdomain}", res.imageUrlSubdomains[i])); }; this.addOptions({ - restrictedMinZoom: res.zoomMin, - numZoomLevels: res.zoomMax + 1 - }); - this.updateAttribution(); - // redraw to replace "blank.gif" tiles with real tiles - this.redraw(); + maxResolution: Math.min( + this.serverResolutions[res.zoomMin], this.maxResolution + ), + zoomOffset: res.zoomMin, + numZoomLevels: Math.min( + res.zoomMax + 1 - res.zoomMin, this.numZoomLevels + ) + }, true); }, /** diff --git a/lib/OpenLayers/Layer/GoogleNG.js b/lib/OpenLayers/Layer/GoogleNG.js index 9dde0458f6..f36c8d8ce9 100644 --- a/lib/OpenLayers/Layer/GoogleNG.js +++ b/lib/OpenLayers/Layer/GoogleNG.js @@ -25,6 +25,21 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { */ SUPPORTED_TRANSITIONS: [], + /** + * Property: serverResolutions + * {Array} the resolutions provided by the Google API. + */ + serverResolutions: [ + 156543.03390625, 78271.516953125, 39135.7584765625, + 19567.87923828125, 9783.939619140625, 4891.9698095703125, + 2445.9849047851562, 1222.9924523925781, 611.4962261962891, + 305.74811309814453, 152.87405654907226, 76.43702827453613, + 38.218514137268066, 19.109257068634033, 9.554628534317017, + 4.777314267158508, 2.388657133579254, 1.194328566789627, + 0.5971642833948135, 0.29858214169740677, 0.14929107084870338, + 0.07464553542435169, 0.037322767712175846 + ], + /** * Property: attributionTemplate * {String} @@ -94,7 +109,6 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { var newArgs = [options.name, null, options]; OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs); - this.options.numZoomLevels = options.numZoomLevels; if (!OpenLayers.Layer.GoogleNG.mapObject) { OpenLayers.Layer.GoogleNG.mapObject = new google.maps.Map(document.createElement("div")); @@ -121,26 +135,16 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { this.setName("Google " + mapType.name); } - var numZoomLevels = mapType.maxZoom + 1; - if (this.options.numZoomLevels != null) { - numZoomLevels = Math.min(numZoomLevels, this.options.numZoomLevels); - } - var restrictedMinZoom; - if (this.restrictedMinZoom || mapType.minZoom) { - restrictedMinZoom = Math.max( - mapType.minZoom || 0, this.restrictedMinZoom || 0 - ); - } - + var minZoom = mapType.minZoom || 0; this.addOptions({ - restrictedMinZoom: restrictedMinZoom, - numZoomLevels: numZoomLevels, - tileSize: new OpenLayers.Size( - mapType.tileSize.width, mapType.tileSize.height + maxResolution: Math.min( + this.serverResolutions[minZoom], this.maxResolution + ), + zoomOffset: minZoom, + numZoomLevels: Math.min( + mapType.maxZoom + 1 - minZoom, this.numZoomLevels ) - }); - // redraw to populate tiles with content - this.redraw(); + }, true); }, /** diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index ef5a475e68..e19cd62359 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -1927,8 +1927,8 @@ OpenLayers.Map = OpenLayers.Class({ */ isValidZoomLevel: function(zoomLevel) { return ( (zoomLevel != null) && - (zoomLevel >= this.getRestrictedMinZoom()) && - (zoomLevel < this.getNumZoomLevels()) ); + (zoomLevel >= 0) && + (zoomLevel < this.getNumZoomLevels()) ); }, /** @@ -2031,20 +2031,6 @@ OpenLayers.Map = OpenLayers.Class({ return maxExtent; }, - /** - * Method: getRestricteMinZoom - * - * Returns: - * {Integer} the minimum zoom level allowed for the current baseLayer. - */ - getRestrictedMinZoom: function() { - var minZoom = null; - if (this.baseLayer != null) { - minZoom = this.baseLayer.restrictedMinZoom; - } - return minZoom; - }, - /** * APIMethod: getNumZoomLevels * diff --git a/tests/Layer.html b/tests/Layer.html index 102c92139d..92976c6f21 100644 --- a/tests/Layer.html +++ b/tests/Layer.html @@ -82,9 +82,9 @@ function test_Layer_addOptions (t) { - t.plan( 19 ); + t.plan( 20 ); - var map = new OpenLayers.Map("map"); + var map = new OpenLayers.Map("map", {allOverlays: true}); var options = { chicken: 151, foo: "bar" }; var layer = new OpenLayers.Layer('Test Layer', options); map.addLayer(layer); @@ -156,6 +156,17 @@ layer.addOptions({projection: "EPSG:900913"}); t.ok(layer.projection instanceof OpenLayers.Projection, "addOptions creates a Projection object when given a projection string"); + + log = null; + // adding a 2nd layer to see if it gets reinitialized properly + var layer2 = new OpenLayers.Layer(null, { + moveTo: function(bounds) { + log = bounds; + } + }); + map.addLayer(layer2); + layer.addOptions({maxResolution: 0.00034332275390625}, true); + t.eq(log.toBBOX(), map.getExtent().toBBOX(), "when reinitialize is set to true, changing base layer's resolution property reinitializes all layers."); map.removeLayer(layer); log = 0; @@ -556,7 +567,7 @@ function test_Layer_getZoomForResolution(t) { - t.plan(13); + t.plan(12); var layer = new OpenLayers.Layer('Test Layer'); layer.map = {}; @@ -584,10 +595,6 @@ "(fractionalZoom) doesn't return zoom below zero"); t.eq(layer.getZoomForResolution(1).toPrecision(6), (layer.resolutions.length - 1).toPrecision(6), "(fractionalZoom) doesn't return zoom above highest index"); - - layer.restrictedMinZoom = 1; - t.eq(layer.getZoomForResolution(200), 1, "zoom all the way out, but we have a restrictedMinZoom of 1"); - } function test_Layer_redraw(t) { diff --git a/tests/Layer/GoogleNG.html b/tests/Layer/GoogleNG.html index 946bc9e0d9..6a864d4f90 100644 --- a/tests/Layer/GoogleNG.html +++ b/tests/Layer/GoogleNG.html @@ -20,7 +20,7 @@ var log = {}; layer = new OpenLayers.Layer.GoogleNG({ numZoomLevels: 10, - restrictedMinZoom: 2, + maxResolution: 39135.7584765625, initLayer: function() { log[layer.id] = true; OpenLayers.Layer.GoogleNG.prototype.initLayer.apply(this, arguments); @@ -30,13 +30,14 @@ map.zoomToMaxExtent(); var map2 = new OpenLayers.Map("map2"); + var minZoom = 1; var layer2 = new OpenLayers.Layer.GoogleNG({ numZoomLevels: 24, initLayer: function() { log[layer2.id] = true; var origMinZoom = OpenLayers.Layer.GoogleNG.mapObject.mapTypes[layer2.type].minZoom; - // pretend the API reports a minZoom of 1 - OpenLayers.Layer.GoogleNG.mapObject.mapTypes[layer2.type].minZoom = 1; + // pretend the API reports a different minZoom + OpenLayers.Layer.GoogleNG.mapObject.mapTypes[layer2.type].minZoom = minZoom; OpenLayers.Layer.GoogleNG.prototype.initLayer.apply(this, arguments); OpenLayers.Layer.GoogleNG.mapObject.mapTypes[layer2.type].minZoom = origMinZoom; } @@ -49,10 +50,10 @@ t.eq(log[layer2.id], true, "initLayer called for 2nd layer"); t.eq(layer.numZoomLevels, 10, "numZoomLevels from configuration takes precedence if lower"); - t.eq(layer2.numZoomLevels, OpenLayers.Layer.GoogleNG.mapObject.mapTypes[layer2.type].maxZoom+1, "numZoomLevels from API takes precedence if lower"); + t.eq(layer2.numZoomLevels, OpenLayers.Layer.GoogleNG.mapObject.mapTypes[layer2.type].maxZoom + 1 - minZoom, "numZoomLevels from API takes precedence if lower"); - t.eq(layer.restrictedMinZoom, 2, "restrictedMinZoom from configuration takes precedence if higher"); - t.eq(layer2.restrictedMinZoom, 1, "restrictedMinZoom from API takes precedence if higher"); + t.eq(layer.maxResolution, 39135.7584765625, "maxResolution from configuration takes precedence if higher"); + t.eq(layer2.maxResolution, 78271.516953125, "maxResolution from API takes precedence if higher"); map.destroy(); map2.destroy(); diff --git a/tests/Map.html b/tests/Map.html index 5f89d1a2d9..5072eea05d 100644 --- a/tests/Map.html +++ b/tests/Map.html @@ -338,31 +338,24 @@ */ function test_Map_isValidZoomLevel(t) { - t.plan(6); + t.plan(4); var map = new OpenLayers.Map("map"); map.addLayer(new OpenLayers.Layer(null, { isBaseLayer: true, numZoomLevels: 19 })) var valid; + valid = OpenLayers.Map.prototype.isValidZoomLevel.apply(map, [-1]); + t.eq(valid, false, "-1 is not a valid zoomLevel"); + valid = OpenLayers.Map.prototype.isValidZoomLevel.apply(map, [0]); - t.eq(valid, true, "0 is a valid zoomLevel when baseLayer has no restrictedMinZoom"); + t.eq(valid, true, "0 is a valid zoomLevel"); valid = OpenLayers.Map.prototype.isValidZoomLevel.apply(map, [18]); t.eq(valid, true, "18 is a valid zoomLevel"); valid = OpenLayers.Map.prototype.isValidZoomLevel.apply(map, [19]); t.eq(valid, false, "19 is not a valid zoomLevel"); - - map.baseLayer.restrictedMinZoom = 1; - valid = OpenLayers.Map.prototype.isValidZoomLevel.apply(map, [0]); - t.eq(valid, false, "0 is not a valid zoomLevel when baseLayer has restrictedMinZoom of 1"); - - valid = OpenLayers.Map.prototype.isValidZoomLevel.apply(map, [1]); - t.eq(valid, true, "1 is a valid zoomLevel"); - - valid = OpenLayers.Map.prototype.isValidZoomLevel.apply(map, [19]); - t.eq(valid, false, "19 is not a valid zoomLevel when baseLayer has restrictedMinZoom of 1"); map.destroy(); } @@ -1296,27 +1289,6 @@ var maxExtent = OpenLayers.Map.prototype.getMaxExtent.apply(map, [options]); t.ok(maxExtent == map.baseLayer.maxExtent, "null options, valid baseLayer returns map.baseLayer.maxExtent"); } - - function test_Map_getRestrictedMinZoom(t){ - t.plan(3); - - var map = {}; - - //no baseLayer - var minZoom = OpenLayers.Map.prototype.getRestrictedMinZoom.apply(map); - t.eq(minZoom, null, "no baseLayer returns null"); - - map.baseLayer = new OpenLayers.Layer(null, {isBaseLayer: true}); - - //baseLayer - minZoom = OpenLayers.Map.prototype.getRestrictedMinZoom.apply(map); - t.eq(minZoom, 0, "default baseLayer.restrictedMinZoom returns 0"); - - //custom minZoomLevel on baseLayer - map.baseLayer.restrictedMinZoom = 1; - minZoom = OpenLayers.Map.prototype.getRestrictedMinZoom.apply(map); - t.eq(minZoom, map.baseLayer.restrictedMinZoom, "custom baseLayer.restrictedMinZoom returns map.baseLayer.restrictedMinZoom"); - } function test_Map_zoomToMaxExtent(t){ t.plan(4) From 7d477fb8afb465fa63abdd5ce0add35516bee694 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sat, 18 Jun 2011 19:27:27 +0000 Subject: [PATCH 046/141] removing the restrictedMinZoom property, and allow for restricting zoom levels with maxResolution and numZoomLevels. Thanks tschaub for the doc, test and examples improvements. r=tschaub (see #3338) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12107 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/bing-tiles-restrictedzoom.html | 43 +++++++++++++++++++++++++ examples/bing-tiles-restrictedzoom.js | 37 +++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 examples/bing-tiles-restrictedzoom.html create mode 100644 examples/bing-tiles-restrictedzoom.js diff --git a/examples/bing-tiles-restrictedzoom.html b/examples/bing-tiles-restrictedzoom.html new file mode 100644 index 0000000000..992bd143ab --- /dev/null +++ b/examples/bing-tiles-restrictedzoom.html @@ -0,0 +1,43 @@ + + + + + + + Basic Bing Tiles with a Subset of Resolutions Example + + + + + +

    Bing Tiles with a Subset of Resolutions Example

    + +
    + bing tiles restrictedMinZoom numZoomLevels +
    + +
    Use Bing with direct tile access
    + +
    + +
    +

    + This example shows how to use the maxResolution and + numZoomLevels layer properties to restrict + the number of zoom levels displayed on the Bing layer. +

    + See bing-tiles-restrictedzoom.js + for the source code. +

    +
    + + + + diff --git a/examples/bing-tiles-restrictedzoom.js b/examples/bing-tiles-restrictedzoom.js new file mode 100644 index 0000000000..45c226fba6 --- /dev/null +++ b/examples/bing-tiles-restrictedzoom.js @@ -0,0 +1,37 @@ +// API key for http://openlayers.org. Please get your own at +// http://bingmapsportal.com/ and use that instead. +var apiKey = "AqTGBsziZHIJYYxgivLBf0hVdrAk9mWO5cQcb8Yux8sW5M8c8opEC2lZqKR1ZZXf"; + +var map = new OpenLayers.Map('map', { + controls: [ + new OpenLayers.Control.Attribution(), + new OpenLayers.Control.Navigation(), + new OpenLayers.Control.PanZoomBar(), + new OpenLayers.Control.LayerSwitcher() + ] +}); + +var road3 = new OpenLayers.Layer.Bing({ + name: "Road tiles with 3 zoom levels", + type: "Road", + key: apiKey, + maxResolution: 76.43702827453613, + numZoomLevels: 3 +}); +var road5 = new OpenLayers.Layer.Bing({ + name: "Road tiles with 5 zoom levels", + type: "Road", + key: apiKey, + numZoomLevels: 5 +}); +var road = new OpenLayers.Layer.Bing({ + name: "Road tiles with all zoom levels", + type: "Road", + key: apiKey +}); + +map.addLayers([road3, road5, road]); +map.setCenter(new OpenLayers.LonLat(-71.147, 42.472).transform( + new OpenLayers.Projection("EPSG:4326"), + map.getProjectionObject() +), 1); From 2aab742ced694abed26bffc1d9f835188ddd909f Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sat, 18 Jun 2011 19:33:29 +0000 Subject: [PATCH 047/141] adding getXMLDoc method that allows creating XML documents with non-HTML compliant nodes (e.g. createCDATASection). r=bartvde (closes #3366) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12108 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/XML.js | 30 ++++++++++++++++++++++++++++++ tests/Format/XML.html | 13 +++++++++++++ 2 files changed, 43 insertions(+) diff --git a/lib/OpenLayers/Format/XML.js b/lib/OpenLayers/Format/XML.js index f4c13499c0..d06e1e8317 100644 --- a/lib/OpenLayers/Format/XML.js +++ b/lib/OpenLayers/Format/XML.js @@ -848,6 +848,29 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, { return uri; }, + /** + * Method: getXMLDoc + * Get an XML document for nodes that are not supported in HTML (e.g. + * createCDATASection). On IE, this will either return an existing or + * create a new on the instance. On other browsers, this will + * either return an existing or create a new shared document (see + * ). + * + * Returns: + * {XMLDocument} + */ + getXMLDoc: function() { + if (!OpenLayers.Format.XML.document && !this.xmldom) { + if (document.implementation && document.implementation.createDocument) { + OpenLayers.Format.XML.document = + document.implementation.createDocument("", "", null); + } else if (!this.xmldom && window.ActiveXObject) { + this.xmldom = new ActiveXObject("Microsoft.XMLDOM"); + } + } + return OpenLayers.Format.XML.document || this.xmldom; + }, + CLASS_NAME: "OpenLayers.Format.XML" }); @@ -879,3 +902,10 @@ OpenLayers.Format.XML.lookupNamespaceURI = OpenLayers.Function.bind( OpenLayers.Format.XML.prototype.lookupNamespaceURI, OpenLayers.Format.XML.prototype ); + +/** + * Property: OpenLayers.Format.XML.document + * {XMLDocument} XML document to reuse for creating non-HTML compliant nodes, + * like document.createCDATASection. + */ +OpenLayers.Format.XML.document = null; diff --git a/tests/Format/XML.html b/tests/Format/XML.html index 12f12afc64..8da8fbf1e3 100644 --- a/tests/Format/XML.html +++ b/tests/Format/XML.html @@ -849,6 +849,19 @@ } + function test_getXMLDoc(t) { + t.plan(2); + var format = new OpenLayers.Format.XML(); + var doc = format.getXMLDoc(); + t.ok(doc !== document, "document returned from getXMLDoc is not the page's html doc"); + var root = format.createElementNS("http://test", "root"); + // appending CDATA created from a different document + var cdata = doc.createCDATASection(""); + root.appendChild(cdata); + var result = format.write(root); + var expect = ']]>'; + t.eq(result, expect, "document with CDATA section serialized correctly"); + } From 18ad6643b6c481ceebab7557a60897fffb40c09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 20 Jun 2011 07:47:52 +0000 Subject: [PATCH 048/141] GeoJSON strings should not include internal feature ids, r=bbinet (closes #3313) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12109 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/GeoJSON.js | 7 ++++-- tests/Format/GeoJSON.html | 39 +++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/lib/OpenLayers/Format/GeoJSON.js b/lib/OpenLayers/Format/GeoJSON.js index 9ca6f29509..8e9f49a855 100644 --- a/lib/OpenLayers/Format/GeoJSON.js +++ b/lib/OpenLayers/Format/GeoJSON.js @@ -530,12 +530,15 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, { */ 'feature': function(feature) { var geom = this.extract.geometry.apply(this, [feature.geometry]); - return { + var json = { "type": "Feature", - "id": feature.fid == null ? feature.id : feature.fid, "properties": feature.attributes, "geometry": geom }; + if (feature.fid != null) { + json.id = feature.fid; + } + return json; }, /** diff --git a/tests/Format/GeoJSON.html b/tests/Format/GeoJSON.html index 03f00377a0..98e950f795 100644 --- a/tests/Format/GeoJSON.html +++ b/tests/Format/GeoJSON.html @@ -4,7 +4,7 @@ diff --git a/tests/Format/GML/v3.html b/tests/Format/GML/v3.html index 9858b94491..49b4905106 100644 --- a/tests/Format/GML/v3.html +++ b/tests/Format/GML/v3.html @@ -212,6 +212,26 @@ t.eq(attributes["LAND_KM"], "143986.61", "read LAND_KM"); } + function test_read_autoconfig(t) { + t.plan(7); + var doc = readXML("v3/topp-states-wfs.xml"); + var format = new OpenLayers.Format.GML.v3(); + var features = format.read(doc.documentElement); + + t.eq(features.length, 3, "read 3 features"); + var feature = features[0]; + t.eq(feature.fid, "states.1", "read fid"); + t.eq(feature.geometry.CLASS_NAME, "OpenLayers.Geometry.MultiPolygon", + "read multipolygon geometry"); + t.eq(format.featureType, "states", "featureType correctly auto-configured"); + t.eq(format.featureNS, "http://www.openplans.org/topp", "featureNS correctly auto-configured"); + + t.eq(format.autoConfig, true, "autoConfig set to true"); + format.autoConfig = false; + format.read(doc.documentElement); + t.eq(format.autoConfig, false, "now that featureNS is set, the format does not auto-configure again"); + } + function test_emptyAttribute(t) { t.plan(4); var str = From c75523f432fe572e88d3305ed09776b377e3d490 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 20 Jun 2011 11:08:18 +0000 Subject: [PATCH 050/141] calling the method on the superclass only with the advertised arguments. Thanks bartvde for catching this (see #3367) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12111 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/GML/Base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Format/GML/Base.js b/lib/OpenLayers/Format/GML/Base.js index fed96e7f30..b05b3fd2ee 100644 --- a/lib/OpenLayers/Format/GML/Base.js +++ b/lib/OpenLayers/Format/GML/Base.js @@ -227,7 +227,7 @@ OpenLayers.Format.GML.Base = OpenLayers.Class(OpenLayers.Format.XML, { this.featureNS = node.namespaceURI; this.autoConfig = true; } - return OpenLayers.Format.XML.prototype.readNode.apply(this, arguments); + return OpenLayers.Format.XML.prototype.readNode.apply(this, [node, obj]); }, /** From 75be4beadc2e1bbc5d17c2c6fec9342ce277f9ec Mon Sep 17 00:00:00 2001 From: ahocevar Date: Tue, 21 Jun 2011 09:58:04 +0000 Subject: [PATCH 051/141] adding a singleTile overlay (see #3376) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12114 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/wms-long-url.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/examples/wms-long-url.js b/examples/wms-long-url.js index 21bbac0be3..bceb5c15e7 100644 --- a/examples/wms-long-url.js +++ b/examples/wms-long-url.js @@ -2,18 +2,25 @@ var longText = new Array(205).join("1234567890"); var map = new OpenLayers.Map( 'map' ); -var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", +var base = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic', makeTheUrlLong: longText}, {tileOptions: {maxGetUrlLength: 2048}} ); -map.addLayer(layer); +var overlay = new OpenLayers.Layer.WMS("Overlay", + "http://suite.opengeo.org/geoserver/wms", + {layers: "usa:states", transparent: true}, + {ratio: 1, singleTile: true, tileOptions: {maxGetUrlLength: 2048}} +); +map.addLayers([base, overlay]); map.zoomToMaxExtent(); // add behavior to dom elements document.getElementById("longurl").onclick = function() { - layer.mergeNewParams({makeTheUrlLong: longText}) -} + base.mergeNewParams({makeTheUrlLong: longText}); + overlay.mergeNewParams({makeTheUrlLong: longText}); +}; document.getElementById("shorturl").onclick = function() { - layer.mergeNewParams({makeTheUrlLong: null}) -} + base.mergeNewParams({makeTheUrlLong: null}); + overlay.mergeNewParams({makeTheUrlLong: null}); +}; From a863d9f572f7a0f182b8d4a0e015ac239a1f02d6 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Tue, 21 Jun 2011 10:05:44 +0000 Subject: [PATCH 052/141] starting with long url overlay in IFrame mode (see #3376) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12115 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/wms-long-url.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/wms-long-url.js b/examples/wms-long-url.js index bceb5c15e7..5e4693337e 100644 --- a/examples/wms-long-url.js +++ b/examples/wms-long-url.js @@ -9,7 +9,7 @@ var base = new OpenLayers.Layer.WMS( "OpenLayers WMS", ); var overlay = new OpenLayers.Layer.WMS("Overlay", "http://suite.opengeo.org/geoserver/wms", - {layers: "usa:states", transparent: true}, + {layers: "usa:states", transparent: true, makeTheUrlLong: longText}, {ratio: 1, singleTile: true, tileOptions: {maxGetUrlLength: 2048}} ); map.addLayers([base, overlay]); From 5cf73e76feea7b4825e3105296d2d303101292cb Mon Sep 17 00:00:00 2001 From: ahocevar Date: Tue, 21 Jun 2011 10:28:27 +0000 Subject: [PATCH 053/141] don't show old backbuffer tiles after loading. p=h0nIg, r=me (see #3376) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12116 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Tile/Image/IFrame.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/OpenLayers/Tile/Image/IFrame.js b/lib/OpenLayers/Tile/Image/IFrame.js index 3d4dcc11a1..7735637019 100644 --- a/lib/OpenLayers/Tile/Image/IFrame.js +++ b/lib/OpenLayers/Tile/Image/IFrame.js @@ -166,7 +166,6 @@ OpenLayers.Tile.Image.IFrame = { //bind a listener to the onload of the iframe so that we // can register when a tile has finished loading. var onload = function() { - this.show(); //normally isLoading should always be true here but there are some // right funky conditions where loading and then reloading a tile // with the same url *really*fast*. this check prevents sending From 0bfb6f53bf6076636564a7ec1a483680430b3a46 Mon Sep 17 00:00:00 2001 From: pgiraud Date: Tue, 21 Jun 2011 12:47:57 +0000 Subject: [PATCH 054/141] geolocation example : don't zoom to and pulsate circle more than once when watching position (ie. listening for locationupdated event), no functional change git-svn-id: http://svn.openlayers.org/trunk/openlayers@12117 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/geolocation.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/geolocation.js b/examples/geolocation.js index e1c3320bad..1afc12d997 100644 --- a/examples/geolocation.js +++ b/examples/geolocation.js @@ -47,6 +47,7 @@ var pulsate = function(feature) { }; var geolocate = new OpenLayers.Control.Geolocate({ + bind: false, geolocationOptions: { enableHighAccuracy: false, maximumAge: 0, @@ -54,7 +55,8 @@ var geolocate = new OpenLayers.Control.Geolocate({ } }); map.addControl(geolocate); -geolocate.events.register("locationupdated",this,function(e) { +var firstGeolocation = true; +geolocate.events.register("locationupdated",geolocate,function(e) { vector.removeAllFeatures(); var circle = new OpenLayers.Feature.Vector( OpenLayers.Geometry.Polygon.createRegularPolygon( @@ -80,8 +82,12 @@ geolocate.events.register("locationupdated",this,function(e) { ), circle ]); - map.zoomToExtent(vector.getDataExtent()); - pulsate(circle); + if (firstGeolocation) { + map.zoomToExtent(vector.getDataExtent()); + pulsate(circle); + firstGeolocation = false; + this.bind = true; + } }); geolocate.events.register("locationfailed",this,function() { OpenLayers.Console.log('Location detection failed'); @@ -92,6 +98,7 @@ $('locate').onclick = function() { geolocate.deactivate(); $('track').checked = false; geolocate.watch = false; + firstGeolocation = true; geolocate.activate(); }; $('track').onclick = function() { @@ -99,6 +106,7 @@ $('track').onclick = function() { geolocate.deactivate(); if (this.checked) { geolocate.watch = true; + firstGeolocation = true; geolocate.activate(); } }; From f0cfcd12d44b04e06025495a4cba936a90a481a0 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Tue, 21 Jun 2011 14:45:16 +0000 Subject: [PATCH 055/141] fixing indentation git-svn-id: http://svn.openlayers.org/trunk/openlayers@12118 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/wms-long-url.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/wms-long-url.js b/examples/wms-long-url.js index 5e4693337e..ecbda39312 100644 --- a/examples/wms-long-url.js +++ b/examples/wms-long-url.js @@ -3,9 +3,9 @@ var longText = new Array(205).join("1234567890"); var map = new OpenLayers.Map( 'map' ); var base = new OpenLayers.Layer.WMS( "OpenLayers WMS", - "http://vmap0.tiles.osgeo.org/wms/vmap0", - {layers: 'basic', makeTheUrlLong: longText}, - {tileOptions: {maxGetUrlLength: 2048}} + "http://vmap0.tiles.osgeo.org/wms/vmap0", + {layers: 'basic', makeTheUrlLong: longText}, + {tileOptions: {maxGetUrlLength: 2048}} ); var overlay = new OpenLayers.Layer.WMS("Overlay", "http://suite.opengeo.org/geoserver/wms", From 1fb626bc8d555a4a62ba8df43d1377bdb15a39ed Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 21 Jun 2011 16:50:50 +0000 Subject: [PATCH 056/141] The bounds.scale method should be part of the API. git-svn-id: http://svn.openlayers.org/trunk/openlayers@12119 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/BaseTypes/Bounds.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/OpenLayers/BaseTypes/Bounds.js b/lib/OpenLayers/BaseTypes/Bounds.js index 0a739f1cc3..2924de31dc 100644 --- a/lib/OpenLayers/BaseTypes/Bounds.js +++ b/lib/OpenLayers/BaseTypes/Bounds.js @@ -247,7 +247,7 @@ OpenLayers.Bounds = OpenLayers.Class({ }, /** - * Method: scale + * APIMethod: scale * Scales the bounds around a pixel or lonlat. Note that the new * bounds may return non-integer properties, even if a pixel * is passed. @@ -261,7 +261,6 @@ OpenLayers.Bounds = OpenLayers.Class({ * {} A new bounds that is scaled by ratio * from origin. */ - scale: function(ratio, origin){ if(origin == null){ origin = this.getCenterLonLat(); From 9b1aca53fae36dfb9ac9c47b07953698c3e684a1 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Tue, 21 Jun 2011 20:53:53 +0000 Subject: [PATCH 057/141] Using the correct superclass. Thanks jorix for investigating and fixing this. p=jorix (closes #3373) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12120 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Handler/RegularPolygon.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/OpenLayers/Handler/RegularPolygon.js b/lib/OpenLayers/Handler/RegularPolygon.js index 760e5fbb14..3627497ccc 100644 --- a/lib/OpenLayers/Handler/RegularPolygon.js +++ b/lib/OpenLayers/Handler/RegularPolygon.js @@ -16,7 +16,7 @@ * instance with the constructor. * * Inherits from: - * - + * - */ OpenLayers.Handler.RegularPolygon = OpenLayers.Class(OpenLayers.Handler.Drag, { @@ -141,7 +141,7 @@ OpenLayers.Handler.RegularPolygon = OpenLayers.Class(OpenLayers.Handler.Drag, { this.style = OpenLayers.Util.extend(OpenLayers.Feature.Vector.style['default'], {}); } - OpenLayers.Handler.prototype.initialize.apply(this, + OpenLayers.Handler.Drag.prototype.initialize.apply(this, [control, callbacks, options]); this.options = (options) ? options : {}; }, @@ -166,7 +166,7 @@ OpenLayers.Handler.RegularPolygon = OpenLayers.Class(OpenLayers.Handler.Drag, { */ activate: function() { var activated = false; - if(OpenLayers.Handler.prototype.activate.apply(this, arguments)) { + if(OpenLayers.Handler.Drag.prototype.activate.apply(this, arguments)) { // create temporary vector layer for rendering geometry sketch var options = OpenLayers.Util.extend({ displayInLayerSwitcher: false, From 336f82b771bc33d343d075e926683253f4b499ff Mon Sep 17 00:00:00 2001 From: ahocevar Date: Wed, 22 Jun 2011 06:04:10 +0000 Subject: [PATCH 058/141] don't fire changelayer events without a property, and do a more solid changelayer event check before changing the layer zIndex. r=tschaub (closes #3377) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12121 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Handler/Feature.js | 2 +- lib/OpenLayers/Layer/Bing.js | 5 ++++- lib/OpenLayers/Layer/GoogleNG.js | 5 ++++- lib/OpenLayers/Map.js | 12 ++++++------ tests/Handler/Feature.html | 14 ++++++++++++++ 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/lib/OpenLayers/Handler/Feature.js b/lib/OpenLayers/Handler/Feature.js index 599a02bdd3..d4c65e7872 100644 --- a/lib/OpenLayers/Handler/Feature.js +++ b/lib/OpenLayers/Handler/Feature.js @@ -404,7 +404,7 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, { * evt - {Object} */ handleMapEvents: function(evt) { - if (!evt.property || evt.property == "order") { + if (evt.type == "removelayer" || evt.property == "order") { this.moveLayerToTop(); } }, diff --git a/lib/OpenLayers/Layer/Bing.js b/lib/OpenLayers/Layer/Bing.js index 662f0301b1..fa330bba4c 100644 --- a/lib/OpenLayers/Layer/Bing.js +++ b/lib/OpenLayers/Layer/Bing.js @@ -214,7 +214,10 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { logo: metadata.brandLogoUri, copyrights: copyrights }); - this.map && this.map.events.triggerEvent("changelayer", {layer: this}); + this.map && this.map.events.triggerEvent("changelayer", { + layer: this, + property: "attribution" + }); }, /** diff --git a/lib/OpenLayers/Layer/GoogleNG.js b/lib/OpenLayers/Layer/GoogleNG.js index f36c8d8ce9..94b45324e2 100644 --- a/lib/OpenLayers/Layer/GoogleNG.js +++ b/lib/OpenLayers/Layer/GoogleNG.js @@ -205,7 +205,10 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { mapType: this.type, mapData: mapData }); - this.map && this.map.events.triggerEvent("changelayer", {layer: this}); + this.map && this.map.events.triggerEvent("changelayer", { + layer: this, + property: "attribution" + }); }, /** diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index e19cd62359..38ff104258 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -65,12 +65,12 @@ OpenLayers.Map = OpenLayers.Class({ * object will include a *layer* property that references the removed * layer. * - *changelayer* triggered after a layer name change, order change, - * opacity change, params change or visibility change - * (due to resolution thresholds). Listeners will receive an event - * object with *layer* and *property* properties. The *layer* - * property will be a reference to the changed layer. - * The *property* property will be a key to the - * changed property (name, order, opacity, params or visibility). + * opacity change, params change, visibility change (due to resolution + * thresholds) or attribution change (due to extent change). Listeners + * will receive an event object with *layer* and *property* properties. + * The *layer* property will be a reference to the changed layer. The + * *property* property will be a key to the changed property (name, + * order, opacity, params, visibility or attribution). * - *movestart* triggered after the start of a drag, pan, or zoom * - *move* triggered after each drag, pan, or zoom * - *moveend* triggered after a drag, pan, or zoom completes diff --git a/tests/Handler/Feature.html b/tests/Handler/Feature.html index 095b00c2b8..03d44c7b77 100644 --- a/tests/Handler/Feature.html +++ b/tests/Handler/Feature.html @@ -645,6 +645,20 @@ map.destroy(); } + + function test_layerorder(t) { + t.plan(2); + var map = new OpenLayers.Map("map"); + var base = new OpenLayers.Layer(null, {isBaseLayer: true}); + var vector = new OpenLayers.Layer.Vector(); + map.addLayers([base, vector]); + map.addControl(new OpenLayers.Control.SelectFeature(vector, {autoActivate: true})); + map.zoomToMaxExtent(); + t.eq(vector.getZIndex(), "725", "vector layer's zIndex correct"); + map.events.triggerEvent("changelayer"); + t.eq(vector.getZIndex(), "725", "vector layer's zIndex still correct after changelayer event"); + + } From 1951eb38151cdbacdfcba55b504014339c15fcc0 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 22 Jun 2011 06:30:45 +0000 Subject: [PATCH 059/141] Clarifying that the TouchNavigation control can be used without a standard Navigation control (closes #3350). git-svn-id: http://svn.openlayers.org/trunk/openlayers@12122 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/TouchNavigation.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/OpenLayers/Control/TouchNavigation.js b/lib/OpenLayers/Control/TouchNavigation.js index 35f0e20d94..ab4ca49c26 100644 --- a/lib/OpenLayers/Control/TouchNavigation.js +++ b/lib/OpenLayers/Control/TouchNavigation.js @@ -15,6 +15,12 @@ * double-tapping, tap with two fingers, and pinch zoom). Create a new * control with the constructor. * + * If you’re only targeting touch enabled devices with your mapping application, + * you can create a map with only a TouchNavigation control. The + * control is mobile ready by default, but + * you can generate a smaller build of the library by only including this + * touch navigation control if you aren't concerned about mouse interaction. + * * Inherits: * - */ From 39d97158532517876054c068bed6ce2040651a95 Mon Sep 17 00:00:00 2001 From: bartvde Date: Wed, 22 Jun 2011 07:14:15 +0000 Subject: [PATCH 060/141] add support for wfs:Native, r=tschaub (closes #3349) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12123 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/WFST/v1.js | 31 +++++++++++++++++++++++++++---- lib/OpenLayers/Protocol/WFS/v1.js | 8 ++++++++ tests/Format/WFST/v1.html | 24 ++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Format/WFST/v1.js b/lib/OpenLayers/Format/WFST/v1.js index 07052218aa..f810cc03d6 100644 --- a/lib/OpenLayers/Format/WFST/v1.js +++ b/lib/OpenLayers/Format/WFST/v1.js @@ -173,12 +173,16 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, { * * Parameters: * features - {Array()} A list of features. + * options - {Object} * * Returns: * {String} A serialized WFS transaction. */ - write: function(features) { - var node = this.writeNode("wfs:Transaction", features); + write: function(features, options) { + var node = this.writeNode("wfs:Transaction", { + features:features, + options: options + }); var value = this.schemaLocationAttr(); if(value) { this.setAttributeNS( @@ -216,16 +220,19 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, { } return node; }, - "Transaction": function(features) { + "Transaction": function(obj) { var node = this.createElementNSPlus("wfs:Transaction", { attributes: { service: "WFS", version: this.version } }); + var i, len; + var features = obj && obj.features; + var options = obj && obj.options; if(features) { var name, feature; - for(var i=0, len=features.length; i)} + * options - {Object} + * + * Valid options properties: + * nativeElements - {Array({Object})} Array of objects with information for writing + * out elements, these objects have vendorId, safeToIgnore and + * value properties. The element is intended to allow access to + * vendor specific capabilities of any particular web feature server or + * datastore. * * Returns: * {} A response object with a features diff --git a/tests/Format/WFST/v1.html b/tests/Format/WFST/v1.html index 9a01e7f6ae..a65d795e53 100644 --- a/tests/Format/WFST/v1.html +++ b/tests/Format/WFST/v1.html @@ -63,6 +63,30 @@ } } + function test_writeNative(t) { + t.plan(1); + var format = new OpenLayers.Format.WFST({ + featureNS: "http://www.openplans.org/topp", + featureType: "states", + version: "1.1.0", + featurePrefix: "topp", + geometryName: null + }); + var output = format.write(null, {nativeElements: [ + { + vendorId: "ORACLE", + safeToIgnore: true, + value: "ALTER SESSION ENABLE PARALLEL DML" + }, { + vendorId: "ORACLE", + safeToIgnore: false, + value: "Another native line goes here" + }] + }); + var expected = 'ALTER SESSION ENABLE PARALLEL DMLAnother native line goes here'; + t.xml_eq(output, expected, "Native elements written out correctly"); + } + function test_write_no_geometry(t) { var format = new OpenLayers.Format.WFST({ featureNS: "http://www.openplans.org/topp", From 1aa76f6de6e4040ea8ae06c61f0a19205d952abf Mon Sep 17 00:00:00 2001 From: bartvde Date: Wed, 22 Jun 2011 09:54:35 +0000 Subject: [PATCH 061/141] add formats for WPS GetCapabilities, WPS DescribeProcess and WPS Execute, thanks ahocevar for the great rework on the patch, r=ahocevar, see #3307) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12124 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers.js | 4 + lib/OpenLayers/Format/OWSCommon/v1.js | 13 + lib/OpenLayers/Format/OWSCommon/v1_1_0.js | 44 ++- lib/OpenLayers/Format/WPSCapabilities.js | 79 ++++ .../Format/WPSCapabilities/v1_0_0.js | 119 ++++++ lib/OpenLayers/Format/WPSDescribeProcess.js | 180 +++++++++ lib/OpenLayers/Format/WPSExecute.js | 243 ++++++++++++ tests/Format/WPSCapabilities/v1_0_0.html | 30 ++ tests/Format/WPSCapabilities/v1_0_0.js | 112 ++++++ tests/Format/WPSDescribeProcess.html | 196 ++++++++++ tests/Format/WPSExecute.html | 364 ++++++++++++++++++ tests/list-tests.html | 3 + 12 files changed, 1386 insertions(+), 1 deletion(-) create mode 100644 lib/OpenLayers/Format/WPSCapabilities.js create mode 100644 lib/OpenLayers/Format/WPSCapabilities/v1_0_0.js create mode 100644 lib/OpenLayers/Format/WPSDescribeProcess.js create mode 100644 lib/OpenLayers/Format/WPSExecute.js create mode 100644 tests/Format/WPSCapabilities/v1_0_0.html create mode 100644 tests/Format/WPSCapabilities/v1_0_0.js create mode 100644 tests/Format/WPSDescribeProcess.html create mode 100644 tests/Format/WPSExecute.html diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index 2351f0288c..2e5e1bb7ac 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -333,6 +333,10 @@ "OpenLayers/Format/OWSContext/v0_3_1.js", "OpenLayers/Format/WMTSCapabilities.js", "OpenLayers/Format/WMTSCapabilities/v1_0_0.js", + "OpenLayers/Format/WPSCapabilities.js", + "OpenLayers/Format/WPSCapabilities/v1_0_0.js", + "OpenLayers/Format/WPSDescribeProcess.js", + "OpenLayers/Format/WPSExecute.js", "OpenLayers/Format/XLS.js", "OpenLayers/Format/XLS/v1.js", "OpenLayers/Format/XLS/v1_1_0.js", diff --git a/lib/OpenLayers/Format/OWSCommon/v1.js b/lib/OpenLayers/Format/OWSCommon/v1.js index 924d25874e..7ee97593ce 100644 --- a/lib/OpenLayers/Format/OWSCommon/v1.js +++ b/lib/OpenLayers/Format/OWSCommon/v1.js @@ -232,6 +232,9 @@ OpenLayers.Format.OWSCommon.v1 = OpenLayers.Class(OpenLayers.Format.XML, { delete obj.bottom; delete obj.right; delete obj.top; + }, + "Language": function(node, obj) { + obj.language = this.getChildValue(node); } } }, @@ -264,11 +267,21 @@ OpenLayers.Format.OWSCommon.v1 = OpenLayers.Class(OpenLayers.Format.XML, { value: options.bounds.right + " " + options.bounds.top }); return node; }, + "Identifier": function(identifier) { + var node = this.createElementNSPlus("ows:Identifier", { + value: identifier }); + return node; + }, "Title": function(title) { var node = this.createElementNSPlus("ows:Title", { value: title }); return node; }, + "Abstract": function(abstractValue) { + var node = this.createElementNSPlus("ows:Abstract", { + value: abstractValue }); + return node; + }, "OutputFormat": function(format) { var node = this.createElementNSPlus("ows:OutputFormat", { value: format }); diff --git a/lib/OpenLayers/Format/OWSCommon/v1_1_0.js b/lib/OpenLayers/Format/OWSCommon/v1_1_0.js index 167d6dfc59..c3ccae5ab9 100644 --- a/lib/OpenLayers/Format/OWSCommon/v1_1_0.js +++ b/lib/OpenLayers/Format/OWSCommon/v1_1_0.js @@ -47,6 +47,9 @@ OpenLayers.Format.OWSCommon.v1_1_0 = OpenLayers.Class(OpenLayers.Format.OWSCommo "AnyValue": function(node, parameter) { parameter.anyValue = true; }, + "DataType": function(node, parameter) { + parameter.dataType = this.getChildValue(node); + }, "Range": function(node, allowedValues) { allowedValues.range = {}; this.readChildNodes(node, allowedValues.range); @@ -65,7 +68,46 @@ OpenLayers.Format.OWSCommon.v1_1_0 = OpenLayers.Class(OpenLayers.Format.OWSCommo } }, OpenLayers.Format.OWSCommon.v1.prototype.readers["ows"]) }, - + + /** + * Property: writers + * As a compliment to the readers property, this structure contains public + * writing functions grouped by namespace alias and named like the + * node names they produce. + */ + writers: { + "ows": OpenLayers.Util.applyDefaults({ + "Range": function(range) { + var node = this.createElementNSPlus("ows:Range", { + attributes: { + 'ows:rangeClosure': range.closure + } + }); + this.writeNode("ows:MinimumValue", range.minValue, node); + this.writeNode("ows:MaximumValue", range.maxValue, node); + return node; + }, + "MinimumValue": function(minValue) { + var node = this.createElementNSPlus("ows:MinimumValue", { + value: minValue + }); + return node; + }, + "MaximumValue": function(maxValue) { + var node = this.createElementNSPlus("ows:MaximumValue", { + value: maxValue + }); + return node; + }, + "Value": function(value) { + var node = this.createElementNSPlus("ows:Value", { + value: value + }); + return node; + } + }, OpenLayers.Format.OWSCommon.v1.prototype.writers["ows"]) + }, + CLASS_NAME: "OpenLayers.Format.OWSCommon.v1_1_0" }); diff --git a/lib/OpenLayers/Format/WPSCapabilities.js b/lib/OpenLayers/Format/WPSCapabilities.js new file mode 100644 index 0000000000..5a6d4c33dc --- /dev/null +++ b/lib/OpenLayers/Format/WPSCapabilities.js @@ -0,0 +1,79 @@ +/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the Clear BSD license. + * See http://svn.openlayers.org/trunk/openlayers/license.txt for the + * full text of the license. */ + +/** + * @requires OpenLayers/Format/XML.js + */ + +/** + * Class: OpenLayers.Format.WPSCapabilities + * Read WPS Capabilities. + * + * Inherits from: + * - + */ +OpenLayers.Format.WPSCapabilities = OpenLayers.Class(OpenLayers.Format.XML, { + + /** + * APIProperty: defaultVersion + * {String} Version number to assume if none found. Default is "1.0.0". + */ + defaultVersion: "1.0.0", + + /** + * APIProperty: version + * {String} Specify a version string if one is known. + */ + version: null, + + /** + * Property: parser + * {} A cached versioned format used for reading. + */ + parser: null, + + /** + * Constructor: OpenLayers.Format.WPSCapabilities + * Create a new parser for WPS Capabilities. + * + * Parameters: + * options - {Object} An optional object whose properties will be set on + * this instance. + */ + + /** + * APIMethod: read + * Read capabilities data from a string, and return information about + * the service. + * + * Parameters: + * data - {String} or {DOMElement} data to read/parse. + * + * Returns: + * {Object} Info about the WPS + */ + read: function(data) { + if(typeof data == "string") { + data = OpenLayers.Format.XML.prototype.read.apply(this, [data]); + } + var root = data.documentElement; + var version = this.version || root.getAttribute("version") || this.defaultVersion; + if(!this.parser || this.parser.version !== version) { + var constr = OpenLayers.Format.WPSCapabilities[ + "v" + version.replace(/\./g, "_") + ]; + if(!constr) { + throw "Can't find a WPS capabilities parser for version " + version; + } + var parser = new constr(this.options); + } + var capabilities = parser.read(data); + capabilities.version = version; + return capabilities; + }, + + CLASS_NAME: "OpenLayers.Format.WPSCapabilities" + +}); diff --git a/lib/OpenLayers/Format/WPSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/WPSCapabilities/v1_0_0.js new file mode 100644 index 0000000000..80ef888476 --- /dev/null +++ b/lib/OpenLayers/Format/WPSCapabilities/v1_0_0.js @@ -0,0 +1,119 @@ +/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the Clear BSD license. + * See http://svn.openlayers.org/trunk/openlayers/license.txt for the + * full text of the license. */ + +/** + * @requires OpenLayers/Format/WPSCapabilities.js + * @requires OpenLayers/Format/OWSCommon/v1_1_0.js + */ + +/** + * Class: OpenLayers.Format.WPSCapabilities.v1_0_0 + * Read WPS Capabilities version 1.0.0. + * + * Inherits from: + * - + */ +OpenLayers.Format.WPSCapabilities.v1_0_0 = OpenLayers.Class( + OpenLayers.Format.XML, { + + /** + * Property: namespaces + * {Object} Mapping of namespace aliases to namespace URIs. + */ + namespaces: { + ows: "http://www.opengis.net/ows/1.1", + wps: "http://www.opengis.net/wps/1.0.0", + xlink: "http://www.w3.org/1999/xlink" + }, + + /** + * Property: regExes + * Compiled regular expressions for manipulating strings. + */ + regExes: { + trimSpace: (/^\s*|\s*$/g), + removeSpace: (/\s*/g), + splitSpace: (/\s+/), + trimComma: (/\s*,\s*/g) + }, + + /** + * Constructor: OpenLayers.Format.WPSCapabilities.v1_0_0 + * Create a new parser for WPS capabilities version 1.0.0. + * + * Parameters: + * options - {Object} An optional object whose properties will be set on + * this instance. + */ + initialize: function(options) { + OpenLayers.Format.XML.prototype.initialize.apply(this, [options]); + }, + + /** + * APIMethod: read + * Read capabilities data from a string, and return info about the WPS. + * + * Parameters: + * data - {String} or {DOMElement} data to read/parse. + * + * Returns: + * {Object} Information about the WPS service. + */ + read: function(data) { + if(typeof data == "string") { + data = OpenLayers.Format.XML.prototype.read.apply(this, [data]); + } + if(data && data.nodeType == 9) { + data = data.documentElement; + } + var capabilities = {}; + this.readNode(data, capabilities); + return capabilities; + }, + + /** + * Property: readers + * Contains public functions, grouped by namespace prefix, that will + * be applied when a namespaced node is found matching the function + * name. The function will be applied in the scope of this parser + * with two arguments: the node being read and a context object passed + * from the parent. + */ + readers: { + "wps": { + "Capabilities": function(node, obj) { + this.readChildNodes(node, obj); + }, + "ProcessOfferings": function(node, obj) { + obj.processOfferings = {}; + this.readChildNodes(node, obj.processOfferings); + }, + "Process": function(node, processOfferings) { + var processVersion = this.getAttributeNS(node, this.namespaces.wps, "processVersion"); + var process = {processVersion: processVersion}; + this.readChildNodes(node, process); + processOfferings[process.identifier] = process; + }, + "Languages": function(node, obj) { + obj.languages = []; + this.readChildNodes(node, obj.languages); + }, + "Default": function(node, languages) { + var language = {isDefault: true}; + this.readChildNodes(node, language); + languages.push(language); + }, + "Supported": function(node, languages) { + var language = {}; + this.readChildNodes(node, language); + languages.push(language); + } + }, + "ows": OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers["ows"] + }, + + CLASS_NAME: "OpenLayers.Format.WPSCapabilities.v1_0_0" + +}); diff --git a/lib/OpenLayers/Format/WPSDescribeProcess.js b/lib/OpenLayers/Format/WPSDescribeProcess.js new file mode 100644 index 0000000000..885b0ee7b1 --- /dev/null +++ b/lib/OpenLayers/Format/WPSDescribeProcess.js @@ -0,0 +1,180 @@ +/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the Clear BSD license. + * See http://svn.openlayers.org/trunk/openlayers/license.txt for the + * full text of the license. */ + +/** + * @requires OpenLayers/Format/XML.js + */ + +/** + * Class: OpenLayers.Format.WPSDescribeProcess + * Read WPS DescribeProcess responses. + * + * Inherits from: + * - + */ +OpenLayers.Format.WPSDescribeProcess = OpenLayers.Class( + OpenLayers.Format.XML, { + + /** + * Constant: VERSION + * {String} 1.0.0 + */ + VERSION: "1.0.0", + + /** + * Property: namespaces + * {Object} Mapping of namespace aliases to namespace URIs. + */ + namespaces: { + wps: "http://www.opengis.net/wps/1.0.0", + ows: "http://www.opengis.net/ows/1.1", + xsi: "http://www.w3.org/2001/XMLSchema-instance" + }, + + /** + * Property: schemaLocation + * {String} Schema location + */ + schemaLocation: "http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd", + + /** + * Property: defaultPrefix + */ + defaultPrefix: "wps", + + /** + * Property: regExes + * Compiled regular expressions for manipulating strings. + */ + regExes: { + trimSpace: (/^\s*|\s*$/g), + removeSpace: (/\s*/g), + splitSpace: (/\s+/), + trimComma: (/\s*,\s*/g) + }, + + /** + * Constructor: OpenLayers.Format.WPSDescribeProcess + * + * Parameters: + * options - {Object} An optional object whose properties will be set on + * this instance. + */ + + /** + * APIMethod: read + * Parse a WPS DescribeProcess and return an object with its information. + * + * Parameters: + * data - {String} or {DOMElement} data to read/parse. + * + * Returns: + * {Object} + */ + read: function(data) { + if(typeof data == "string") { + data = OpenLayers.Format.XML.prototype.read.apply(this, [data]); + } + if(data && data.nodeType == 9) { + data = data.documentElement; + } + var info = {}; + this.readNode(data, info); + return info; + }, + + /** + * Property: readers + * Contains public functions, grouped by namespace prefix, that will + * be applied when a namespaced node is found matching the function + * name. The function will be applied in the scope of this parser + * with two arguments: the node being read and a context object passed + * from the parent. + */ + readers: { + "wps": { + "ProcessDescriptions": function(node, obj) { + obj.processDescriptions = {}; + this.readChildNodes(node, obj.processDescriptions); + }, + "ProcessDescription": function(node, processDescriptions) { + var processVersion = this.getAttributeNS(node, this.namespaces.wps, "processVersion"); + var processDescription = { + processVersion: processVersion, + statusSupported: (node.getAttribute("statusSupported") === "true"), + storeSupported: (node.getAttribute("storeSupported") === "true") + }; + this.readChildNodes(node, processDescription); + processDescriptions[processDescription.identifier] = processDescription; + }, + "DataInputs": function(node, processDescription) { + processDescription.dataInputs = []; + this.readChildNodes(node, processDescription.dataInputs); + }, + "ProcessOutputs": function(node, processDescription) { + processDescription.processOutputs = []; + this.readChildNodes(node, processDescription.processOutputs); + }, + "Output": function(node, processOutputs) { + var output = {}; + this.readChildNodes(node, output); + processOutputs.push(output); + }, + "ComplexOutput": function(node, output) { + output.complexOutput = {}; + this.readChildNodes(node, output.complexOutput); + }, + "Input": function(node, dataInputs) { + var input = { + maxOccurs: parseInt(node.getAttribute("maxOccurs")), + minOccurs: parseInt(node.getAttribute("minOccurs")) + }; + this.readChildNodes(node, input); + dataInputs.push(input); + }, + "BoundingBoxData": function(node, input) { + input.boundingBoxData = {}; + this.readChildNodes(node, input.boundingBoxData); + }, + "CRS": function(node, obj) { + if (!obj.CRSs) { + obj.CRSs = {}; + } + obj.CRSs[this.getChildValue(node)] = true; + }, + "LiteralData": function(node, input) { + input.literalData = {}; + this.readChildNodes(node, input.literalData); + }, + "ComplexData": function(node, input) { + input.complexData = {}; + this.readChildNodes(node, input.complexData); + }, + "Default": function(node, complexData) { + complexData["default"] = {}; + this.readChildNodes(node, complexData["default"]); + }, + "Supported": function(node, complexData) { + complexData["supported"] = {}; + this.readChildNodes(node, complexData["supported"]); + }, + "Format": function(node, obj) { + var format = {}; + this.readChildNodes(node, format); + if (!obj.formats) { + obj.formats = {}; + } + obj.formats[format.mimeType] = true; + }, + "MimeType": function(node, format) { + format.mimeType = this.getChildValue(node); + } + }, + "ows": OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers["ows"] + }, + + CLASS_NAME: "OpenLayers.Format.WPSDescribeProcess" + +}); diff --git a/lib/OpenLayers/Format/WPSExecute.js b/lib/OpenLayers/Format/WPSExecute.js new file mode 100644 index 0000000000..82ab2e9936 --- /dev/null +++ b/lib/OpenLayers/Format/WPSExecute.js @@ -0,0 +1,243 @@ +/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the Clear BSD license. + * See http://svn.openlayers.org/trunk/openlayers/license.txt for the + * full text of the license. */ + +/** + * @requires OpenLayers/Format/XML.js + */ + +/** + * Class: OpenLayers.Format.WPSExecute version 1.0.0 + * + * Inherits from: + * - + */ +OpenLayers.Format.WPSExecute = OpenLayers.Class(OpenLayers.Format.XML, { + + /** + * Property: namespaces + * {Object} Mapping of namespace aliases to namespace URIs. + */ + namespaces: { + ows: "http://www.opengis.net/ows/1.1", + gml: "http://www.opengis.net/gml", + wps: "http://www.opengis.net/wps/1.0.0", + wfs: "http://www.opengis.net/wfs", + ogc: "http://www.opengis.net/ogc", + wcs: "http://www.opengis.net/wcs/1.1.1", + xlink: "http://www.w3.org/1999/xlink", + xsi: "http://www.w3.org/2001/XMLSchema-instance" + }, + + /** + * Property: regExes + * Compiled regular expressions for manipulating strings. + */ + regExes: { + trimSpace: (/^\s*|\s*$/g), + removeSpace: (/\s*/g), + splitSpace: (/\s+/), + trimComma: (/\s*,\s*/g) + }, + + /** + * Constant: VERSION + * {String} 1.0.0 + */ + VERSION: "1.0.0", + + /** + * Property: schemaLocation + * {String} Schema location + */ + schemaLocation: "http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd", + + schemaLocationAttr: function(options) { + return undefined; + }, + + /** + * Constructor: OpenLayers.Format.WPSExecute + * + * Parameters: + * options - {Object} An optional object whose properties will be set on + * this instance. + */ + + /** + * Method: write + * + * Parameters: + * options - {Object} Optional object. + * + * Returns: + * {String} An WPS Execute request XML string. + */ + write: function(options) { + var doc; + if (window.ActiveXObject) { + doc = new ActiveXObject("Microsoft.XMLDOM"); + this.xmldom = doc; + } else { + doc = document.implementation.createDocument("", "", null); + } + var node = this.writeNode("wps:Execute", options, doc); + this.setAttributeNS( + node, this.namespaces.xsi, + "xsi:schemaLocation", this.schemaLocation + ); + return OpenLayers.Format.XML.prototype.write.apply(this, [node]); + }, + + /** + * Property: writers + * As a compliment to the readers property, this structure contains public + * writing functions grouped by namespace alias and named like the + * node names they produce. + */ + writers: { + "wps": { + "Execute": function(options) { + var node = this.createElementNSPlus("wps:Execute", { + attributes: { + version: this.VERSION, + service: 'WPS' + } + }); + this.writeNode("ows:Identifier", options.identifier, node); + this.writeNode("wps:DataInputs", options.dataInputs, node); + this.writeNode("wps:ResponseForm", options.responseForm, node); + return node; + }, + "ResponseForm": function(responseForm) { + var node = this.createElementNSPlus("wps:ResponseForm", {}); + if (responseForm.rawDataOutput) { + this.writeNode("wps:RawDataOutput", responseForm.rawDataOutput, node); + } + if (responseForm.responseDocument) { + this.writeNode("wps:ResponseDocument", responseForm.responseDocument, node); + } + return node; + }, + "ResponseDocument": function(responseDocument) { + var node = this.createElementNSPlus("wps:ResponseDocument", { + attributes: { + storeExecuteResponse: responseDocument.storeExecuteResponse, + lineage: responseDocument.lineage, + status: responseDocument.status + } + }); + if (responseDocument.output) { + this.writeNode("wps:Output", responseDocument.output, node); + } + return node; + }, + "Output": function(output) { + var node = this.createElementNSPlus("wps:Output", { + attributes: { + asReference: output.asReference + } + }); + this.writeNode("ows:Identifier", output.identifier, node); + this.writeNode("ows:Title", output.title, node); + this.writeNode("ows:Abstract", output["abstract"], node); + return node; + }, + "RawDataOutput": function(rawDataOutput) { + var node = this.createElementNSPlus("wps:RawDataOutput", { + attributes: { + mimeType: rawDataOutput.mimeType + } + }); + this.writeNode("ows:Identifier", rawDataOutput.identifier, node); + return node; + }, + "DataInputs": function(dataInputs) { + var node = this.createElementNSPlus("wps:DataInputs", {}); + for (var i=0, ii=dataInputs.length; i + + + + + + + + diff --git a/tests/Format/WPSCapabilities/v1_0_0.js b/tests/Format/WPSCapabilities/v1_0_0.js new file mode 100644 index 0000000000..19d12f2208 --- /dev/null +++ b/tests/Format/WPSCapabilities/v1_0_0.js @@ -0,0 +1,112 @@ +var doc = new OpenLayers.Format.XML().read( +'' + +'' + +' ' + +' Prototype GeoServer WPS' + +' ' + +' WPS' + +' 1.0.0' + +' ' + +' ' + +' The ancient geographes INC' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' ' + +' gt:Intersect' + +' Intersection' + +' Intersection between two literal geometry' + +' ' + +' ' + +' JTS:length' + +' Returns the geometry perimeters, computed using cartesian geometry' + +' expressions in the same unit of measure as the geometry (will not return a valid' + +' perimeter for geometries expressed geographic coordinates' + +' Returns the geometry perimeters, computed using cartesian geometry' + +' expressions in the same unit of measure as the geometry (will not return a valid' + +' perimeter for geometries expressed geographic coordinates' + +' ' + +' ' + +' JTS:isEmpty' + +' Checks if the provided geometry is empty' + +' Checks if the provided geometry is empty' + +' ' + +' ' + +' JTS:contains' + +' Checks if a contains b' + +' Checks if a contains b' + +' ' + +' ' + +' JTS:disjoint' + +' Returns true if the two geometries have no points in common' + +' Returns true if the two geometries have no points in common' + +' ' + +' ' + +' JTS:intersects' + +' Returns true if the two geometries intersect, false otherwise' + +' Returns true if the two geometries intersect, false' + +' otherwise' + +' ' + +' ' + +' JTS:isClosed' + +' Returns true if the line is closed' + +' Returns true if the line is closed' + +' ' + +' ' + +' JTS:isValid' + +' Returns true if the geometry is topologically valid, false' + +' otherwise' + +' Returns true if the geometry is topologically valid, false' + +' otherwise' + +' ' + +' ' + +' JTS:buffer' + +' Buffers a geometry using a certain distance' + +' Buffers a geometry using a certain distance' + +' ' + +' ' + +' JTS:getY' + +' Returns the Y ordinate of the point' + +' Returns the Y ordinate of the point' + +' ' + +' ' + +' ' + +' ' + +' en-US' + +' ' + +' ' + +' en-US' + +' ' + +' ' + +'' +); diff --git a/tests/Format/WPSDescribeProcess.html b/tests/Format/WPSDescribeProcess.html new file mode 100644 index 0000000000..c411f6267b --- /dev/null +++ b/tests/Format/WPSDescribeProcess.html @@ -0,0 +1,196 @@ + + + + + + + + diff --git a/tests/Format/WPSExecute.html b/tests/Format/WPSExecute.html new file mode 100644 index 0000000000..dc68af74dc --- /dev/null +++ b/tests/Format/WPSExecute.html @@ -0,0 +1,364 @@ + + + + + + + + diff --git a/tests/list-tests.html b/tests/list-tests.html index a56c678896..fe63cacb8e 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -96,6 +96,9 @@
  • Format/WMSGetFeatureInfo.html
  • Format/WMTSCapabilities.html
  • Format/WMTSCapabilities/v1_0_0.html
  • +
  • Format/WPSCapabilities/v1_0_0.html
  • +
  • Format/WPSDescribeProcess.html
  • +
  • Format/WPSExecute.html
  • Format/CSWGetDomain.html
  • Format/CSWGetDomain/v2_0_2.html
  • Format/CSWGetRecords.html
  • From d1009b92add144eb4c3c13c29574fad50c8b652f Mon Sep 17 00:00:00 2001 From: bartvde Date: Wed, 22 Jun 2011 15:20:01 +0000 Subject: [PATCH 062/141] add Format for writing out Web Coverage Service (WCS) requests, r=ahocevar (closes #3375) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12125 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers.js | 1 + lib/OpenLayers/Format/WCSGetCoverage.js | 198 ++++++++++++++++++++++++ lib/OpenLayers/Format/WPSExecute.js | 11 +- tests/Format/WCSGetCoverage.html | 80 ++++++++++ tests/Format/WPSExecute.html | 105 +++++++++++++ tests/list-tests.html | 1 + 6 files changed, 394 insertions(+), 2 deletions(-) create mode 100644 lib/OpenLayers/Format/WCSGetCoverage.js create mode 100644 tests/Format/WCSGetCoverage.html diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index 2e5e1bb7ac..1d95ad98de 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -316,6 +316,7 @@ "OpenLayers/Format/WMC/v1.js", "OpenLayers/Format/WMC/v1_0_0.js", "OpenLayers/Format/WMC/v1_1_0.js", + "OpenLayers/Format/WCSGetCoverage.js", "OpenLayers/Format/WMSCapabilities.js", "OpenLayers/Format/WMSCapabilities/v1.js", "OpenLayers/Format/WMSCapabilities/v1_1.js", diff --git a/lib/OpenLayers/Format/WCSGetCoverage.js b/lib/OpenLayers/Format/WCSGetCoverage.js new file mode 100644 index 0000000000..ecc6989807 --- /dev/null +++ b/lib/OpenLayers/Format/WCSGetCoverage.js @@ -0,0 +1,198 @@ +/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the Clear BSD license. + * See http://svn.openlayers.org/trunk/openlayers/license.txt for the + * full text of the license. */ + +/** + * @requires OpenLayers/Format/XML.js + */ + +/** + * Class: OpenLayers.Format.WCSGetCoverage version 1.1.0 + * + * Inherits from: + * - + */ +OpenLayers.Format.WCSGetCoverage = OpenLayers.Class(OpenLayers.Format.XML, { + + /** + * Property: namespaces + * {Object} Mapping of namespace aliases to namespace URIs. + */ + namespaces: { + ows: "http://www.opengis.net/ows/1.1", + wcs: "http://www.opengis.net/wcs/1.1", + xlink: "http://www.w3.org/1999/xlink", + xsi: "http://www.w3.org/2001/XMLSchema-instance" + }, + + /** + * Property: regExes + * Compiled regular expressions for manipulating strings. + */ + regExes: { + trimSpace: (/^\s*|\s*$/g), + removeSpace: (/\s*/g), + splitSpace: (/\s+/), + trimComma: (/\s*,\s*/g) + }, + + /** + * Constant: VERSION + * {String} 1.1.2 + */ + VERSION: "1.1.2", + + /** + * Property: schemaLocation + * {String} Schema location + */ + schemaLocation: "http://www.opengis.net/wcs/1.1 http://schemas.opengis.net/wcs/1.1/wcsGetCoverage.xsd", + + /** + * Constructor: OpenLayers.Format.WCSGetCoverage + * + * Parameters: + * options - {Object} An optional object whose properties will be set on + * this instance. + */ + + /** + * Method: write + * + * Parameters: + * options - {Object} Optional object. + * + * Returns: + * {String} A WCS GetCoverage request XML string. + */ + write: function(options) { + var node = this.writeNode("wcs:GetCoverage", options); + this.setAttributeNS( + node, this.namespaces.xsi, + "xsi:schemaLocation", this.schemaLocation + ); + return OpenLayers.Format.XML.prototype.write.apply(this, [node]); + }, + + /** + * Property: writers + * As a compliment to the readers property, this structure contains public + * writing functions grouped by namespace alias and named like the + * node names they produce. + */ + writers: { + "wcs": { + "GetCoverage": function(options) { + var node = this.createElementNSPlus("wcs:GetCoverage", { + attributes: { + version: options.version || this.VERSION, + service: 'WCS' + } + }); + this.writeNode("ows:Identifier", options.identifier, node); + this.writeNode("wcs:DomainSubset", options.domainSubset, node); + this.writeNode("wcs:Output", options.output, node); + return node; + }, + "DomainSubset": function(domainSubset) { + var node = this.createElementNSPlus("wcs:DomainSubset", {}); + this.writeNode("ows:BoundingBox", domainSubset.boundingBox, node); + if (domainSubset.temporalSubset) { + this.writeNode("wcs:TemporalSubset", domainSubset.temporalSubset, node); + } + return node; + }, + "TemporalSubset": function(temporalSubset) { + var node = this.createElementNSPlus("wcs:TemporalSubset", {}); + for (var i=0, len=temporalSubset.timePeriods.length; i + + + + + + + diff --git a/tests/Format/WPSExecute.html b/tests/Format/WPSExecute.html index dc68af74dc..fc731e8900 100644 --- a/tests/Format/WPSExecute.html +++ b/tests/Format/WPSExecute.html @@ -3,6 +3,111 @@ From 0b26fa9a5edb5cf445fe411aa4a5658e4a79e41c Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 24 Jun 2011 20:12:12 +0000 Subject: [PATCH 064/141] Making it so dictionary keys are the English values for strings displayed in the UI. By making dictionary keys be sensible strings, we make it so the i18n function returns something legible when there are no dictionaries included in a build. This means that strings from the Graticule, Permalink, LayerSwitcher, and Scale controls will be displayed in English without having to include the English dictionary (as is the case in our full build). Note that if you use the OpenLayers.i18n method in your applications, five of the dictionary keys have changed. Use the following replacements: * "permalink" -> "Permalink" * "overlays" -> "Overlays" * "baseLayer" -> "Base Layer" * "scale" -> "Scale = 1 : ${scaleDenom}" * "graticule" -> "Graticule" r=ahocevar (closes #3364) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12127 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/Graticule.js | 2 +- lib/OpenLayers/Control/LayerSwitcher.js | 4 ++-- lib/OpenLayers/Control/Permalink.js | 2 +- lib/OpenLayers/Control/Scale.js | 2 +- lib/OpenLayers/Lang/ar.js | 6 +++--- lib/OpenLayers/Lang/be-tarask.js | 8 ++++---- lib/OpenLayers/Lang/bg.js | 6 +++--- lib/OpenLayers/Lang/br.js | 8 ++++---- lib/OpenLayers/Lang/ca.js | 10 +++++----- lib/OpenLayers/Lang/cs-CZ.js | 8 ++++---- lib/OpenLayers/Lang/da-DK.js | 8 ++++---- lib/OpenLayers/Lang/de.js | 8 ++++---- lib/OpenLayers/Lang/el.js | 2 +- lib/OpenLayers/Lang/en.js | 10 +++++----- lib/OpenLayers/Lang/es.js | 10 +++++----- lib/OpenLayers/Lang/fi.js | 6 +++--- lib/OpenLayers/Lang/fr.js | 8 ++++---- lib/OpenLayers/Lang/fur.js | 8 ++++---- lib/OpenLayers/Lang/gl.js | 8 ++++---- lib/OpenLayers/Lang/gsw.js | 8 ++++---- lib/OpenLayers/Lang/hr.js | 8 ++++---- lib/OpenLayers/Lang/hsb.js | 8 ++++---- lib/OpenLayers/Lang/hu.js | 8 ++++---- lib/OpenLayers/Lang/ia.js | 8 ++++---- lib/OpenLayers/Lang/id.js | 8 ++++---- lib/OpenLayers/Lang/io.js | 2 +- lib/OpenLayers/Lang/is.js | 8 ++++---- lib/OpenLayers/Lang/it.js | 8 ++++---- lib/OpenLayers/Lang/ja.js | 8 ++++---- lib/OpenLayers/Lang/km.js | 6 +++--- lib/OpenLayers/Lang/ksh.js | 8 ++++---- lib/OpenLayers/Lang/lt.js | 10 +++++----- lib/OpenLayers/Lang/nb.js | 8 ++++---- lib/OpenLayers/Lang/nds.js | 8 ++++---- lib/OpenLayers/Lang/nl.js | 8 ++++---- lib/OpenLayers/Lang/nn.js | 2 +- lib/OpenLayers/Lang/oc.js | 8 ++++---- lib/OpenLayers/Lang/pt-BR.js | 8 ++++---- lib/OpenLayers/Lang/pt.js | 8 ++++---- lib/OpenLayers/Lang/ru.js | 8 ++++---- lib/OpenLayers/Lang/sk.js | 8 ++++---- lib/OpenLayers/Lang/sv-SE.js | 8 ++++---- lib/OpenLayers/Lang/te.js | 2 +- lib/OpenLayers/Lang/vi.js | 8 ++++---- lib/OpenLayers/Lang/zh-CN.js | 8 ++++---- lib/OpenLayers/Lang/zh-TW.js | 8 ++++---- tests/Lang.html | 12 ++++++------ 47 files changed, 167 insertions(+), 167 deletions(-) diff --git a/lib/OpenLayers/Control/Graticule.js b/lib/OpenLayers/Control/Graticule.js index cf49e82092..a3af87ffec 100644 --- a/lib/OpenLayers/Control/Graticule.js +++ b/lib/OpenLayers/Control/Graticule.js @@ -113,7 +113,7 @@ OpenLayers.Control.Graticule = OpenLayers.Class(OpenLayers.Control, { */ initialize: function(options) { options = options || {}; - options.layerName = options.layerName || OpenLayers.i18n("graticule"); + options.layerName = options.layerName || OpenLayers.i18n("Graticule"); OpenLayers.Control.prototype.initialize.apply(this, [options]); this.labelSymbolizer.stroke = false; diff --git a/lib/OpenLayers/Control/LayerSwitcher.js b/lib/OpenLayers/Control/LayerSwitcher.js index 2fbbf1908b..4186445688 100644 --- a/lib/OpenLayers/Control/LayerSwitcher.js +++ b/lib/OpenLayers/Control/LayerSwitcher.js @@ -505,14 +505,14 @@ OpenLayers.Control.LayerSwitcher = OpenLayers.Element.addClass(this.layersDiv, "layersDiv"); this.baseLbl = document.createElement("div"); - this.baseLbl.innerHTML = OpenLayers.i18n("baseLayer"); + this.baseLbl.innerHTML = OpenLayers.i18n("Base Layer"); OpenLayers.Element.addClass(this.baseLbl, "baseLbl"); this.baseLayersDiv = document.createElement("div"); OpenLayers.Element.addClass(this.baseLayersDiv, "baseLayersDiv"); this.dataLbl = document.createElement("div"); - this.dataLbl.innerHTML = OpenLayers.i18n("overlays"); + this.dataLbl.innerHTML = OpenLayers.i18n("Overlays"); OpenLayers.Element.addClass(this.dataLbl, "dataLbl"); this.dataLayersDiv = document.createElement("div"); diff --git a/lib/OpenLayers/Control/Permalink.js b/lib/OpenLayers/Control/Permalink.js index bb5bac54a4..ed4f2488ef 100644 --- a/lib/OpenLayers/Control/Permalink.js +++ b/lib/OpenLayers/Control/Permalink.js @@ -147,7 +147,7 @@ OpenLayers.Control.Permalink = OpenLayers.Class(OpenLayers.Control, { if (!this.element && !this.anchor) { this.element = document.createElement("a"); - this.element.innerHTML = OpenLayers.i18n("permalink"); + this.element.innerHTML = OpenLayers.i18n("Permalink"); this.element.href=""; this.div.appendChild(this.element); } diff --git a/lib/OpenLayers/Control/Scale.js b/lib/OpenLayers/Control/Scale.js index 7e3717f758..9eae15fa5a 100644 --- a/lib/OpenLayers/Control/Scale.js +++ b/lib/OpenLayers/Control/Scale.js @@ -92,7 +92,7 @@ OpenLayers.Control.Scale = OpenLayers.Class(OpenLayers.Control, { scale = Math.round(scale); } - this.element.innerHTML = OpenLayers.i18n("scale", {'scaleDenom':scale}); + this.element.innerHTML = OpenLayers.i18n("Scale = 1 : ${scaleDenom}", {'scaleDenom':scale}); }, CLASS_NAME: "OpenLayers.Control.Scale" diff --git a/lib/OpenLayers/Lang/ar.js b/lib/OpenLayers/Lang/ar.js index 17d9befd5b..6317d06ec4 100644 --- a/lib/OpenLayers/Lang/ar.js +++ b/lib/OpenLayers/Lang/ar.js @@ -15,9 +15,9 @@ */ OpenLayers.Lang["ar"] = OpenLayers.Util.applyDefaults({ - 'permalink': "وصلة دائمة", + 'Permalink': "وصلة دائمة", - 'baseLayer': "الطبقة الاساسية", + 'Base Layer': "الطبقة الاساسية", 'readNotImplemented': "القراءة غير محققة.", @@ -25,7 +25,7 @@ OpenLayers.Lang["ar"] = OpenLayers.Util.applyDefaults({ 'errorLoadingGML': "خطأ عند تحميل الملف جي ام ال ${url}", - 'scale': "النسبة = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "النسبة = 1 : ${scaleDenom}", 'W': "غ", diff --git a/lib/OpenLayers/Lang/be-tarask.js b/lib/OpenLayers/Lang/be-tarask.js index f0db8a0e51..b8d3dc118c 100644 --- a/lib/OpenLayers/Lang/be-tarask.js +++ b/lib/OpenLayers/Lang/be-tarask.js @@ -17,11 +17,11 @@ OpenLayers.Lang["be-tarask"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Неапрацаваны вынік запыту ${statusText}", - 'permalink': "Сталая спасылка", + 'Permalink': "Сталая спасылка", - 'overlays': "Слаі", + 'Overlays': "Слаі", - 'baseLayer': "Базавы слой", + 'Base Layer': "Базавы слой", 'sameProjection': "Аглядная мапа працуе толькі калі яна мае тую ж праекцыю, што і асноўная мапа", @@ -49,7 +49,7 @@ OpenLayers.Lang["be-tarask"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "Немагчыма загрузіць слой ${layerType}.\x3cbr\x3e\x3cbr\x3eКаб пазбавіцца гэтага паведамленьня, выберыце новы базавы слой у сьпісе ў верхнім правым куце.\x3cbr\x3e\x3cbr\x3eХутчэй за ўсё, прычына ў тым, што скрыпт бібліятэкі ${layerLib} ня быў слушна ўключаны.\x3cbr\x3e\x3cbr\x3eРаспрацоўшчыкам: Для таго, каб даведацца як зрабіць так, каб усё працавала, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3eнацісьніце тут\x3c/a\x3e", - 'scale': "Маштаб = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Маштаб = 1 : ${scaleDenom}", 'W': "З", diff --git a/lib/OpenLayers/Lang/bg.js b/lib/OpenLayers/Lang/bg.js index 97a1ae6383..17044d8890 100644 --- a/lib/OpenLayers/Lang/bg.js +++ b/lib/OpenLayers/Lang/bg.js @@ -14,13 +14,13 @@ */ OpenLayers.Lang["bg"] = OpenLayers.Util.applyDefaults({ - 'permalink': "Постоянна препратка", + 'Permalink': "Постоянна препратка", - 'baseLayer': "Основен слой", + 'Base Layer': "Основен слой", 'errorLoadingGML': "Грешка при зареждане на GML файл ${url}", - 'scale': "Мащаб = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Мащаб = 1 : ${scaleDenom}", 'layerAlreadyAdded': "Опитахте да добавите слой ${layerName} в картата, но той вече е добавен", diff --git a/lib/OpenLayers/Lang/br.js b/lib/OpenLayers/Lang/br.js index 59feb345e2..23d55776d9 100644 --- a/lib/OpenLayers/Lang/br.js +++ b/lib/OpenLayers/Lang/br.js @@ -16,11 +16,11 @@ OpenLayers.Lang["br"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Distro evel reked anveret ${statusText}", - 'permalink': "Peurliamm", + 'Permalink': "Peurliamm", - 'overlays': "Gwiskadoù", + 'Overlays': "Gwiskadoù", - 'baseLayer': "Gwiskad diazez", + 'Base Layer': "Gwiskad diazez", 'sameProjection': "Ne\'z ar gartenn lec\'hiañ en-dro nemet pa vez heñvel ar banndres anezhi ha hini ar gartenn bennañ", @@ -48,7 +48,7 @@ OpenLayers.Lang["br"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "N\'haller ket kargañ ar gwiskad ${layerType} ent reizh.\x3cbr\x3e\x3cbr\x3eEvit en em zizober eus ar c\'hemenn-mañ, dibabit ur BaseLayer nevez en diuzer gwiskadoù er c\'horn dehoù el laez.\x3cbr\x3e\x3cbr\x3eSur a-walc\'h eo peogwir n\'eo ket bet ensoc\'het mat al levraoueg ${layerLib}.\x3cbr\x3e\x3cbr\x3eDiorroerien : Evit gouzout penaos reizhañ an dra-se, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3eclick here\x3c/a\x3e", - 'scale': "Skeul = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Skeul = 1 : ${scaleDenom}", 'W': "K", diff --git a/lib/OpenLayers/Lang/ca.js b/lib/OpenLayers/Lang/ca.js index 96a4794e8b..cb9d03bb0e 100644 --- a/lib/OpenLayers/Lang/ca.js +++ b/lib/OpenLayers/Lang/ca.js @@ -12,11 +12,11 @@ OpenLayers.Lang.ca = { 'unhandledRequest': "Resposta a petició no gestionada ${statusText}", - 'permalink': "Enllaç permanent", + 'Permalink': "Enllaç permanent", - 'overlays': "Capes addicionals", + 'Overlays': "Capes addicionals", - 'baseLayer': "Capa Base", + 'Base Layer': "Capa Base", 'sameProjection': "El mapa de referència només funciona si té la mateixa projecció que el mapa principal", @@ -76,14 +76,14 @@ OpenLayers.Lang.ca = { "féu clic aquí", - 'scale': "Escala = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Escala = 1 : ${scaleDenom}", //labels for the graticule control 'W': 'O', 'E': 'E', 'N': 'N', 'S': 'S', - 'graticule': 'Retícula', + 'Graticule': 'Retícula', // console message 'layerAlreadyAdded': diff --git a/lib/OpenLayers/Lang/cs-CZ.js b/lib/OpenLayers/Lang/cs-CZ.js index 945e24c35f..cc26c832ce 100644 --- a/lib/OpenLayers/Lang/cs-CZ.js +++ b/lib/OpenLayers/Lang/cs-CZ.js @@ -16,11 +16,11 @@ OpenLayers.Lang["cs-CZ"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Nezpracovaná návratová hodnota ${statusText}", - 'permalink': "Trvalý odkaz", + 'Permalink': "Trvalý odkaz", - 'overlays': "Překryvné vrstvy", + 'Overlays': "Překryvné vrstvy", - 'baseLayer': "Podkladové vrstvy", + 'Base Layer': "Podkladové vrstvy", 'sameProjection': "Přehledka pracuje správně pouze tehdy, pokud je ve stejné projekci jako hlavní mapa", @@ -48,7 +48,7 @@ OpenLayers.Lang["cs-CZ"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "The ${layerType} Layer was unable to load correctly.\x3cbr\x3e\x3cbr\x3eTo get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.\x3cbr\x3e\x3cbr\x3eMost likely, this is because the ${layerLib} library script was either not correctly included.\x3cbr\x3e\x3cbr\x3eDevelopers: For help getting this working correctly, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3eclick here\x3c/a\x3e", - 'scale': "Měřítko = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Měřítko = 1 : ${scaleDenom}", 'layerAlreadyAdded': "Pokusili jste se přidat vrstvu: ${layerName} do mapy, ale tato vrstva je již v mapě přítomna.", diff --git a/lib/OpenLayers/Lang/da-DK.js b/lib/OpenLayers/Lang/da-DK.js index 680c21202b..d7b8d978fb 100644 --- a/lib/OpenLayers/Lang/da-DK.js +++ b/lib/OpenLayers/Lang/da-DK.js @@ -12,11 +12,11 @@ OpenLayers.Lang['da-DK'] = { 'unhandledRequest': "En ikke håndteret forespørgsel returnerede ${statusText}", - 'permalink': "Permalink", + 'Permalink': "Permalink", - 'overlays': "Kortlag", + 'Overlays': "Kortlag", - 'baseLayer': "Baggrundslag", + 'Base Layer': "Baggrundslag", 'sameProjection': "Oversigtskortet fungerer kun når det har samme projektion som hovedkortet", @@ -78,7 +78,7 @@ OpenLayers.Lang['da-DK'] = { "klik her", - 'scale': "Målforhold = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Målforhold = 1 : ${scaleDenom}", // console message 'layerAlreadyAdded': diff --git a/lib/OpenLayers/Lang/de.js b/lib/OpenLayers/Lang/de.js index dc8155787f..c82cd9c06e 100644 --- a/lib/OpenLayers/Lang/de.js +++ b/lib/OpenLayers/Lang/de.js @@ -18,11 +18,11 @@ OpenLayers.Lang["de"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Unbehandelte Anfragerückmeldung ${statusText}", - 'permalink': "Permalink", + 'Permalink': "Permalink", - 'overlays': "Overlays", + 'Overlays': "Overlays", - 'baseLayer': "Grundkarte", + 'Base Layer': "Grundkarte", 'sameProjection': "Die Übersichtskarte funktioniert nur, wenn sie dieselbe Projektion wie die Hauptkarte verwendet", @@ -50,7 +50,7 @@ OpenLayers.Lang["de"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "Der ${layerType}-Layer konnte nicht korrekt geladen werden.\x3cbr\x3e\x3cbr\x3eUm diese Meldung nicht mehr zu erhalten, wählen Sie einen anderen Hintergrundlayer aus dem LayerSwitcher in der rechten oberen Ecke.\x3cbr\x3e\x3cbr\x3eSehr wahrscheinlich tritt dieser Fehler auf, weil das Skript der \'${layerLib}\'-Bibliothek nicht eingebunden wurde.\x3cbr\x3e\x3cbr\x3eEntwickler: Besuche \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3edas Wiki\x3c/a\x3e für Hilfe zum korrekten Einbinden von Layern", - 'scale': "Maßstab = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Maßstab = 1 : ${scaleDenom}", 'W': "W", diff --git a/lib/OpenLayers/Lang/el.js b/lib/OpenLayers/Lang/el.js index deedf7f474..0b3d067ba4 100644 --- a/lib/OpenLayers/Lang/el.js +++ b/lib/OpenLayers/Lang/el.js @@ -14,6 +14,6 @@ */ OpenLayers.Lang["el"] = OpenLayers.Util.applyDefaults({ - 'scale': "Κλίμακα ~ 1 : ${scaleDenom}" + 'Scale = 1 : ${scaleDenom}': "Κλίμακα ~ 1 : ${scaleDenom}" }); diff --git a/lib/OpenLayers/Lang/en.js b/lib/OpenLayers/Lang/en.js index 5d42de5aee..9107222e96 100644 --- a/lib/OpenLayers/Lang/en.js +++ b/lib/OpenLayers/Lang/en.js @@ -12,11 +12,11 @@ OpenLayers.Lang.en = { 'unhandledRequest': "Unhandled request return ${statusText}", - 'permalink': "Permalink", + 'Permalink': "Permalink", - 'overlays': "Overlays", + 'Overlays': "Overlays", - 'baseLayer': "Base Layer", + 'Base Layer': "Base Layer", 'sameProjection': "The overview map only works when it is in the same projection as the main map", @@ -76,14 +76,14 @@ OpenLayers.Lang.en = { "click here", - 'scale': "Scale = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Scale = 1 : ${scaleDenom}", //labels for the graticule control 'W': 'W', 'E': 'E', 'N': 'N', 'S': 'S', - 'graticule': 'Graticule', + 'Graticule': 'Graticule', // console message 'layerAlreadyAdded': diff --git a/lib/OpenLayers/Lang/es.js b/lib/OpenLayers/Lang/es.js index ff6d3dc5f5..6f9bef229f 100644 --- a/lib/OpenLayers/Lang/es.js +++ b/lib/OpenLayers/Lang/es.js @@ -12,11 +12,11 @@ OpenLayers.Lang.es = { 'unhandledRequest': "Respuesta a petición no gestionada ${statusText}", - 'permalink': "Enlace permanente", + 'Permalink': "Enlace permanente", - 'overlays': "Capas superpuestas", + 'Overlays': "Capas superpuestas", - 'baseLayer': "Capa Base", + 'Base Layer': "Capa Base", 'sameProjection': "El mapa de vista general sólo funciona si está en la misma proyección que el mapa principal", @@ -77,14 +77,14 @@ OpenLayers.Lang.es = { "haga clic aquí", - 'scale': "Escala = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Escala = 1 : ${scaleDenom}", //labels for the graticule control 'W': 'O', 'E': 'E', 'N': 'N', 'S': 'S', - 'graticule': 'Retícula', + 'Graticule': 'Retícula', // console message 'layerAlreadyAdded': diff --git a/lib/OpenLayers/Lang/fi.js b/lib/OpenLayers/Lang/fi.js index 1cfd626362..3d4f9ea97f 100644 --- a/lib/OpenLayers/Lang/fi.js +++ b/lib/OpenLayers/Lang/fi.js @@ -15,11 +15,11 @@ */ OpenLayers.Lang["fi"] = OpenLayers.Util.applyDefaults({ - 'permalink': "Ikilinkki", + 'Permalink': "Ikilinkki", - 'overlays': "Kerrokset", + 'Overlays': "Kerrokset", - 'baseLayer': "Peruskerros", + 'Base Layer': "Peruskerros", 'sameProjection': "Yleiskuvakarttaa voi käyttää vain, kun sillä on sama projektio kuin pääkartalla.", diff --git a/lib/OpenLayers/Lang/fr.js b/lib/OpenLayers/Lang/fr.js index 2f1f6a508f..2feb19d4a5 100644 --- a/lib/OpenLayers/Lang/fr.js +++ b/lib/OpenLayers/Lang/fr.js @@ -17,11 +17,11 @@ OpenLayers.Lang["fr"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Requête non gérée, retournant ${statusText}", - 'permalink': "Permalien", + 'Permalink': "Permalien", - 'overlays': "Calques", + 'Overlays': "Calques", - 'baseLayer': "Calque de base", + 'Base Layer': "Calque de base", 'sameProjection': "La carte de situation ne fonctionne que lorsque sa projection est la même que celle de la carte principale", @@ -49,7 +49,7 @@ OpenLayers.Lang["fr"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "La couche ${layerType} n\'est pas en mesure de se charger correctement.\x3cbr\x3e\x3cbr\x3ePour supprimer ce message, choisissez une nouvelle BaseLayer dans le sélecteur de couche en haut à droite.\x3cbr\x3e\x3cbr\x3eCela est possiblement causé par la non-inclusion de la librairie ${layerLib}.\x3cbr\x3e\x3cbr\x3eDéveloppeurs : pour savoir comment corriger ceci, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3ecliquez ici\x3c/a\x3e", - 'scale': "Echelle ~ 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Echelle ~ 1 : ${scaleDenom}", 'W': "O", diff --git a/lib/OpenLayers/Lang/fur.js b/lib/OpenLayers/Lang/fur.js index b274986f75..4e99f32ec0 100644 --- a/lib/OpenLayers/Lang/fur.js +++ b/lib/OpenLayers/Lang/fur.js @@ -14,15 +14,15 @@ */ OpenLayers.Lang["fur"] = OpenLayers.Util.applyDefaults({ - 'permalink': "Leam Permanent", + 'Permalink': "Leam Permanent", - 'overlays': "Livei parsore", + 'Overlays': "Livei parsore", - 'baseLayer': "Livel di base", + 'Base Layer': "Livel di base", 'browserNotSupported': "Il to sgarfadôr nol supuarte la renderizazion vetoriâl. Al moment a son supuartâts:\n${renderers}", - 'scale': "Scjale = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Scjale = 1 : ${scaleDenom}", 'W': "O", diff --git a/lib/OpenLayers/Lang/gl.js b/lib/OpenLayers/Lang/gl.js index 4d6ab29e0e..3f21a59d66 100644 --- a/lib/OpenLayers/Lang/gl.js +++ b/lib/OpenLayers/Lang/gl.js @@ -16,11 +16,11 @@ OpenLayers.Lang["gl"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Solicitude non xerada; a resposta foi: ${statusText}", - 'permalink': "Ligazón permanente", + 'Permalink': "Ligazón permanente", - 'overlays': "Capas superpostas", + 'Overlays': "Capas superpostas", - 'baseLayer': "Capa base", + 'Base Layer': "Capa base", 'sameProjection': "A vista xeral do mapa só funciona cando está na mesma proxección có mapa principal", @@ -48,7 +48,7 @@ OpenLayers.Lang["gl"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "A capa ${layerType} foi incapaz de cargarse correctamente.\x3cbr\x3e\x3cbr\x3ePara evitar esta mensaxe, escolla unha nova capa base no seleccionador de capas na marxe superior dereita.\x3cbr\x3e\x3cbr\x3eProbablemente, isto acontece porque a escritura da libraría ${layerLib} non foi ben incluída.\x3cbr\x3e\x3cbr\x3eDesenvolvedores: para axudar a facer funcionar isto correctamente, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3epremede aquí\x3c/a\x3e", - 'scale': "Escala = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Escala = 1 : ${scaleDenom}", 'W': "O", diff --git a/lib/OpenLayers/Lang/gsw.js b/lib/OpenLayers/Lang/gsw.js index 68c052bd16..8b11507bf1 100644 --- a/lib/OpenLayers/Lang/gsw.js +++ b/lib/OpenLayers/Lang/gsw.js @@ -16,11 +16,11 @@ OpenLayers.Lang["gsw"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Nit behandleti Aafrogsruckmäldig ${statusText}", - 'permalink': "Permalink", + 'Permalink': "Permalink", - 'overlays': "Iberlagerige", + 'Overlays': "Iberlagerige", - 'baseLayer': "Grundcharte", + 'Base Layer': "Grundcharte", 'sameProjection': "D Ibersichts-Charte funktioniert nume, wänn si di glych Projäktion brucht wie d Hauptcharte", @@ -48,7 +48,7 @@ OpenLayers.Lang["gsw"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "Dr ${layerType}-Layer het nit korräkt chenne glade wäre.\x3cbr\x3e\x3cbr\x3eGo die Mäldig nimi z kriege, wehl e andere Hintergrundlayer us em LayerSwitcher im rächte obere Ecke.\x3cbr\x3e\x3cbr\x3eDää Fähler git s seli hyfig, wel s Skript vu dr \'${layerLib}\'-Bibliothek nit yybunde woren isch oder wel s kei giltige API-Schlissel fir Dyy URL din het.\x3cbr\x3e\x3cbr\x3eEntwickler: Fir Hilf zum korräkte Yybinde vu Layer \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3edoo drucke\x3c/a\x3e", - 'scale': "Maßstab = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Maßstab = 1 : ${scaleDenom}", 'W': "W", diff --git a/lib/OpenLayers/Lang/hr.js b/lib/OpenLayers/Lang/hr.js index c3f2bd8d58..f9694c013c 100644 --- a/lib/OpenLayers/Lang/hr.js +++ b/lib/OpenLayers/Lang/hr.js @@ -16,11 +16,11 @@ OpenLayers.Lang["hr"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Nepodržani zahtjev ${statusText}", - 'permalink': "Permalink", + 'Permalink': "Permalink", - 'overlays': "Overlays", + 'Overlays': "Overlays", - 'baseLayer': "Osnovna karta", + 'Base Layer': "Osnovna karta", 'sameProjection': "Pregledna karta radi jedino kao je u istoj projekciji kao i glava karta", @@ -42,7 +42,7 @@ OpenLayers.Lang["hr"] = OpenLayers.Util.applyDefaults({ 'commitFailed': "WFS Transakcija: NEUSPJEŠNA ${response}", - 'scale': "Mjerilo = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Mjerilo = 1 : ${scaleDenom}", 'layerAlreadyAdded': "Pokušali ste dodati layer: ${layerName} na kartu, ali je već dodan", diff --git a/lib/OpenLayers/Lang/hsb.js b/lib/OpenLayers/Lang/hsb.js index 5cbf48e196..33ad8053f3 100644 --- a/lib/OpenLayers/Lang/hsb.js +++ b/lib/OpenLayers/Lang/hsb.js @@ -16,11 +16,11 @@ OpenLayers.Lang["hsb"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Wotmołwa njewobdźěłaneho naprašowanja ${statusText}", - 'permalink': "Trajny wotkaz", + 'Permalink': "Trajny wotkaz", - 'overlays': "Naworštowanja", + 'Overlays': "Naworštowanja", - 'baseLayer': "Zakładna runina", + 'Base Layer': "Zakładna runina", 'sameProjection': "Přehladowa karta jenož funguje, hdyž je w samsnej projekciji kaž hłowna karta", @@ -48,7 +48,7 @@ OpenLayers.Lang["hsb"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "Woršta ${layerType} njemóžeše so korektnje začitać.\x3cbr\x3e\x3cbr\x3eZo by tutu zdźělenku wotbył, wubjer nowy BaseLayer z wuběra worštow horjeka naprawo.\x3cbr\x3e\x3cbr\x3eNajskerje so to stawa, dokelž skript biblioteki ${layerLib} njebu korektnje zapřijaty.\x3cbr\x3e\x3cbr\x3eWuwiwarjo: Za pomoc ke korektnemu fungowanju worštow\n\x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3etu kliknyć\x3c/a\x3e", - 'scale': "Měritko = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Měritko = 1 : ${scaleDenom}", 'W': "Z", diff --git a/lib/OpenLayers/Lang/hu.js b/lib/OpenLayers/Lang/hu.js index d7278a8066..53544847a0 100644 --- a/lib/OpenLayers/Lang/hu.js +++ b/lib/OpenLayers/Lang/hu.js @@ -17,11 +17,11 @@ OpenLayers.Lang["hu"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Nem kezelt kérés visszatérése ${statusText}", - 'permalink': "Permalink", + 'Permalink': "Permalink", - 'overlays': "Rávetítések", + 'Overlays': "Rávetítések", - 'baseLayer': "Alapréteg", + 'Base Layer': "Alapréteg", 'sameProjection': "Az áttekintő térkép csak abban az esetben működik, ha ugyanazon a vetületen van, mint a fő térkép.", @@ -49,7 +49,7 @@ OpenLayers.Lang["hu"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "A(z) ${layerType} fólia nem töltődött be helyesen.\x3cbr\x3e\x3cbr\x3eAhhoz, hogy ez az üzenet eltűnjön, válasszon egy új BaseLayer fóliát a jobb felső sarokban található fóliakapcsoló segítségével.\x3cbr\x3e\x3cbr\x3eNagy valószínűséggel ez azért van, mert a(z) ${layerLib} könyvtár parancsfájlja helytelen.\x3cbr\x3e\x3cbr\x3eFejlesztőknek: A helyes működtetésre vonatkozó segítség az alábbi helyen érhető el, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3ekattintson ide\x3c/a\x3e", - 'scale': "Lépték = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Lépték = 1 : ${scaleDenom}", 'W': "Ny", diff --git a/lib/OpenLayers/Lang/ia.js b/lib/OpenLayers/Lang/ia.js index 4fe9a030ea..4d87729731 100644 --- a/lib/OpenLayers/Lang/ia.js +++ b/lib/OpenLayers/Lang/ia.js @@ -16,11 +16,11 @@ OpenLayers.Lang["ia"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Le responsa a un requesta non esseva maneate: ${statusText}", - 'permalink': "Permaligamine", + 'Permalink': "Permaligamine", - 'overlays': "Superpositiones", + 'Overlays': "Superpositiones", - 'baseLayer': "Strato de base", + 'Base Layer': "Strato de base", 'sameProjection': "Le mini-carta functiona solmente si illo es in le mesme projection que le carta principal", @@ -48,7 +48,7 @@ OpenLayers.Lang["ia"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "Le strato ${layerType} non poteva esser cargate correctemente.\x3cbr\x3e\x3cbr\x3ePro disfacer te de iste message, selige un nove BaseLayer in le selector de strato in alto a dextra.\x3cbr\x3e\x3cbr\x3eMulto probabilemente, isto es proque le script del libreria de ${layerLib} non esseva correctemente includite.\x3cbr\x3e\x3cbr\x3eDisveloppatores: Pro adjuta de corriger isto, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3eclicca hic\x3c/a\x3e", - 'scale': "Scala = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Scala = 1 : ${scaleDenom}", 'W': "W", diff --git a/lib/OpenLayers/Lang/id.js b/lib/OpenLayers/Lang/id.js index 3d714c92ae..4bfd149c60 100644 --- a/lib/OpenLayers/Lang/id.js +++ b/lib/OpenLayers/Lang/id.js @@ -17,11 +17,11 @@ OpenLayers.Lang["id"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Permintaan yang tak tertangani menghasilkan ${statusText}", - 'permalink': "Pranala permanen", + 'Permalink': "Pranala permanen", - 'overlays': "Hamparan", + 'Overlays': "Hamparan", - 'baseLayer': "Lapisan Dasar", + 'Base Layer': "Lapisan Dasar", 'sameProjection': "Peta tinjauan hanya bekerja bila dalam proyeksi yang sama dengan peta utama", @@ -49,7 +49,7 @@ OpenLayers.Lang["id"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "Lapisan ${layerType} tidak dapat dimuat dengan benar.\x3cbr\x3e\x3cbr\x3eUntuk menghilangkan pesan ini, pilih suatu BaseLayer baru melalui penukar lapisan (layer switcher) di ujung kanan atas.\x3cbr\x3e\x3cbr\x3eKemungkinan besar ini karena pustaka skrip Google Maps tidak disertakan dengan benar.\x3cbr\x3e\x3cbr\x3ePengembang: Untuk bantuan mengatasi masalah ini, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3eklik di sini\x3c/a\x3e", - 'scale': "Sekala = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Sekala = 1 : ${scaleDenom}", 'W': "B", diff --git a/lib/OpenLayers/Lang/io.js b/lib/OpenLayers/Lang/io.js index 773a52fadf..6f2263abf8 100644 --- a/lib/OpenLayers/Lang/io.js +++ b/lib/OpenLayers/Lang/io.js @@ -14,6 +14,6 @@ */ OpenLayers.Lang["io"] = OpenLayers.Util.applyDefaults({ - 'scale': "Skalo = 1 : ${scaleDenom}" + 'Scale = 1 : ${scaleDenom}': "Skalo = 1 : ${scaleDenom}" }); diff --git a/lib/OpenLayers/Lang/is.js b/lib/OpenLayers/Lang/is.js index 6dffaea359..d4ab7e1258 100644 --- a/lib/OpenLayers/Lang/is.js +++ b/lib/OpenLayers/Lang/is.js @@ -14,11 +14,11 @@ */ OpenLayers.Lang["is"] = OpenLayers.Util.applyDefaults({ - 'permalink': "Varanlegur tengill", + 'Permalink': "Varanlegur tengill", - 'overlays': "Þekjur", + 'Overlays': "Þekjur", - 'baseLayer': "Grunnlag", + 'Base Layer': "Grunnlag", 'sameProjection': "Yfirlitskortið virkar aðeins ef það er í sömu vörpun og aðalkortið", @@ -28,7 +28,7 @@ OpenLayers.Lang["is"] = OpenLayers.Util.applyDefaults({ 'errorLoadingGML': "Villa kom upp við að hlaða inn GML skránni ${url}", - 'scale': "Skali = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Skali = 1 : ${scaleDenom}", 'layerAlreadyAdded': "Þú reyndir að bæta laginu ${layerName} á kortið en það er þegar búið að bæta því við", diff --git a/lib/OpenLayers/Lang/it.js b/lib/OpenLayers/Lang/it.js index 201d4e0d6c..44d486b316 100644 --- a/lib/OpenLayers/Lang/it.js +++ b/lib/OpenLayers/Lang/it.js @@ -12,11 +12,11 @@ OpenLayers.Lang.it = { 'unhandledRequest': "Codice di ritorno della richiesta ${statusText}", - 'permalink': "Permalink", + 'Permalink': "Permalink", - 'overlays': "Overlays", + 'Overlays': "Overlays", - 'baseLayer': "Livello base", + 'Base Layer': "Livello base", 'sameProjection': "La mini mappa funziona solamente se ha la stessa proiezione della mappa principale", @@ -76,7 +76,7 @@ OpenLayers.Lang.it = { "clicca qui", - 'scale': "Scala = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Scala = 1 : ${scaleDenom}", // console message 'layerAlreadyAdded': diff --git a/lib/OpenLayers/Lang/ja.js b/lib/OpenLayers/Lang/ja.js index 590422a0ff..0de37d457e 100644 --- a/lib/OpenLayers/Lang/ja.js +++ b/lib/OpenLayers/Lang/ja.js @@ -17,11 +17,11 @@ OpenLayers.Lang["ja"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "未処理の要求は ${statusText} を返します", - 'permalink': "パーマリンク", + 'Permalink': "パーマリンク", - 'overlays': "オーバーレイ", + 'Overlays': "オーバーレイ", - 'baseLayer': "基底レイヤー", + 'Base Layer': "基底レイヤー", 'sameProjection': "概観地図はメインの地図と同じ投影法をとる場合のみ機能します", @@ -49,7 +49,7 @@ OpenLayers.Lang["ja"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "${layerType} レイヤーが正しく読み込みを行えませんでした。\x3cbr\x3e\x3cbr\x3eこのメッセージを消すには、右上の隅にあるレイヤー切り替え部分で新しい基底レイヤーを選んでください。\x3cbr\x3e\x3cbr\x3eおそらく、これは ${layerLib} ライブラリのスクリプトが正しく組み込まれていないためです。\x3cbr\x3e\x3cbr\x3e開発者の方へ: 正しい動作をさせるために\x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3eこちらのウィキ\x3c/a\x3eを参照してください。", - 'scale': "縮尺 = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "縮尺 = 1 : ${scaleDenom}", 'W': "西", diff --git a/lib/OpenLayers/Lang/km.js b/lib/OpenLayers/Lang/km.js index a8ebd0db33..70907f5e67 100644 --- a/lib/OpenLayers/Lang/km.js +++ b/lib/OpenLayers/Lang/km.js @@ -14,12 +14,12 @@ */ OpenLayers.Lang["km"] = OpenLayers.Util.applyDefaults({ - 'permalink': "តំណភ្ជាប់អចិន្ត្រៃយ៍", + 'Permalink': "តំណភ្ជាប់អចិន្ត្រៃយ៍", - 'baseLayer': "ស្រទាប់បាត​", + 'Base Layer': "ស្រទាប់បាត​", 'errorLoadingGML': "កំហុសកំឡុងពេលផ្ទុកឯកសារ GML ${url}", - 'scale': "មាត្រដ្ឋាន = ១ ៖ ${scaleDenom}" + 'Scale = 1 : ${scaleDenom}': "មាត្រដ្ឋាន = ១ ៖ ${scaleDenom}" }); diff --git a/lib/OpenLayers/Lang/ksh.js b/lib/OpenLayers/Lang/ksh.js index 45e504bbf6..1a0b7cc130 100644 --- a/lib/OpenLayers/Lang/ksh.js +++ b/lib/OpenLayers/Lang/ksh.js @@ -16,11 +16,11 @@ OpenLayers.Lang["ksh"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Met dä Antwoot op en Aanfrooch ham_mer nix aanjefange: ${statusText}", - 'permalink': "Lengk op Duuer", + 'Permalink': "Lengk op Duuer", - 'overlays': "Drövver jelaat", + 'Overlays': "Drövver jelaat", - 'baseLayer': "Jrund-Nivoh", + 'Base Layer': "Jrund-Nivoh", 'sameProjection': "De Övverseeschs_Kaat deiht et bloß, wann se de sälve Projäxjuhn bruche deiht, wi de Houp_Kaat", @@ -48,7 +48,7 @@ OpenLayers.Lang["ksh"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "Dat Nivvoh \x3ccode\x3e${layerType}\x3c/code\x3e kunnt nit reschtesch jelaade wääde.\x3cbr /\x3e\x3cbr /\x3eÖm hee di Nohreesch loß ze krijje, donn en ander Jrund-Nivvoh ußsöhkre, rähß bovve en de Äk.\x3cbr /\x3e\x3cbr /\x3eWascheinlesch es dat, wiel dat Skrepp \x3ccode\x3e${layerLib}\x3c/code\x3e nit reschtesch enjebonge wood.\x3cbr /\x3e\x3cbr /\x3eFör Projrammierer jidd_Et Hölp do_drövver, \x3ca href=\"http://trac.openlayers.org/wiki/${layerLib}\" target=\"_blank\"\x3ewi mer dat aan et Loufe brengk\x3c/a\x3e.", - 'scale': "Mohßshtaab = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Mohßshtaab = 1 : ${scaleDenom}", 'W': "W", diff --git a/lib/OpenLayers/Lang/lt.js b/lib/OpenLayers/Lang/lt.js index 464a35de14..9b73d9bb65 100644 --- a/lib/OpenLayers/Lang/lt.js +++ b/lib/OpenLayers/Lang/lt.js @@ -12,11 +12,11 @@ OpenLayers.Lang['lt'] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Neapdorota užklausa gražino ${statusText}", - 'permalink': "Pastovi nuoroda", + 'Permalink': "Pastovi nuoroda", - 'overlays': "Papildomi sluoksniai", + 'Overlays': "Papildomi sluoksniai", - 'baseLayer': "Pagrindinis sluoksnis", + 'Base Layer': "Pagrindinis sluoksnis", 'sameProjection': "Apžvalginis žemėlapis veikia tik tada, kai jis yra tos pačios projekcijos kaip ir pagrindinis", @@ -42,14 +42,14 @@ OpenLayers.Lang['lt'] = OpenLayers.Util.applyDefaults({ 'commitFailed': "WFS Tranzakcija: ŽLUGO ${response}", - 'scale': "Mastelis = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Mastelis = 1 : ${scaleDenom}", //labels for the graticule control 'W': 'V', 'E': 'R', 'N': 'Š', 'S': 'P', - 'graticule': 'Tinklelis', + 'Graticule': 'Tinklelis', // console message 'layerAlreadyAdded': diff --git a/lib/OpenLayers/Lang/nb.js b/lib/OpenLayers/Lang/nb.js index 2e9d140fd6..e75b334dc6 100644 --- a/lib/OpenLayers/Lang/nb.js +++ b/lib/OpenLayers/Lang/nb.js @@ -12,11 +12,11 @@ OpenLayers.Lang["nb"] = { 'unhandledRequest': "Ubehandlet forespørsel returnerte ${statusText}", - 'permalink': "Kobling til denne siden", + 'Permalink': "Kobling til denne siden", - 'overlays': "Kartlag", + 'Overlays': "Kartlag", - 'baseLayer': "Bakgrunnskart", + 'Base Layer': "Bakgrunnskart", 'sameProjection': "Oversiktskartet fungerer bare når det har samme projeksjon som hovedkartet", @@ -77,7 +77,7 @@ OpenLayers.Lang["nb"] = { "her.", - 'scale': "Skala 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Skala 1 : ${scaleDenom}", // console message 'layerAlreadyAdded': diff --git a/lib/OpenLayers/Lang/nds.js b/lib/OpenLayers/Lang/nds.js index a28ce6ff13..9b1d6f2b2c 100644 --- a/lib/OpenLayers/Lang/nds.js +++ b/lib/OpenLayers/Lang/nds.js @@ -16,11 +16,11 @@ OpenLayers.Lang["nds"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Unbehannelt Trüchmellels för de Anfraag ${statusText}", - 'permalink': "Permalink", + 'Permalink': "Permalink", - 'overlays': "Overlays", + 'Overlays': "Overlays", - 'baseLayer': "Achtergrundkoort", + 'Base Layer': "Achtergrundkoort", 'sameProjection': "De Översichtskoort geiht blot, wenn de sülve Projekschoon as bi de Hööftkoort bruukt warrt", @@ -42,7 +42,7 @@ OpenLayers.Lang["nds"] = OpenLayers.Util.applyDefaults({ 'commitFailed': "WFS-Transakschoon: hett nich klappt ${response}", - 'scale': "Skaal = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Skaal = 1 : ${scaleDenom}", 'layerAlreadyAdded': "Du versöchst de Laag „${layerName}“ to de Koort totofögen, man de is al toföögt", diff --git a/lib/OpenLayers/Lang/nl.js b/lib/OpenLayers/Lang/nl.js index 968a0fb8d5..d94756c6a1 100644 --- a/lib/OpenLayers/Lang/nl.js +++ b/lib/OpenLayers/Lang/nl.js @@ -16,11 +16,11 @@ OpenLayers.Lang["nl"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Het verzoek is niet afgehandeld met de volgende melding: ${statusText}", - 'permalink': "Permanente verwijzing", + 'Permalink': "Permanente verwijzing", - 'overlays': "Overlays", + 'Overlays': "Overlays", - 'baseLayer': "Achtergrondkaart", + 'Base Layer': "Achtergrondkaart", 'sameProjection': "De overzichtskaart werkt alleen als de projectie gelijk is aan de projectie van de hoofdkaart", @@ -48,7 +48,7 @@ OpenLayers.Lang["nl"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "De laag ${layerType} kon niet goed geladen worden.\x3cbr /\x3e\x3cbr /\x3e\nOm deze melding niet meer te krijgen, moet u een andere achtergrondkaart kiezen in de laagwisselaar in de rechterbovenhoek.\x3cbr /\x3e\x3cbr /\x3e\nDit komt waarschijnlijk doordat de bibliotheek ${layerLib} niet correct is ingevoegd.\x3cbr /\x3e\x3cbr /\x3e\nOntwikkelaars: \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3eklik hier\x3c/a\x3e om dit werkend te krijgen.", - 'scale': "Schaal = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Schaal = 1 : ${scaleDenom}", 'W': "W", diff --git a/lib/OpenLayers/Lang/nn.js b/lib/OpenLayers/Lang/nn.js index 46c0be6fd1..b794df2fab 100644 --- a/lib/OpenLayers/Lang/nn.js +++ b/lib/OpenLayers/Lang/nn.js @@ -14,7 +14,7 @@ */ OpenLayers.Lang["nn"] = OpenLayers.Util.applyDefaults({ - 'scale': "Skala = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Skala = 1 : ${scaleDenom}", 'layerAlreadyAdded': "Du freista å leggja til laget «${layerName}» på kartet, men det har alt vorte lagt til.", diff --git a/lib/OpenLayers/Lang/oc.js b/lib/OpenLayers/Lang/oc.js index 4956fb513a..017cbf50b7 100644 --- a/lib/OpenLayers/Lang/oc.js +++ b/lib/OpenLayers/Lang/oc.js @@ -16,11 +16,11 @@ OpenLayers.Lang["oc"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Requèsta pas gerida, retorna ${statusText}", - 'permalink': "Permaligam", + 'Permalink': "Permaligam", - 'overlays': "Calques", + 'Overlays': "Calques", - 'baseLayer': "Calc de basa", + 'Base Layer': "Calc de basa", 'sameProjection': "La carta de situacion fonciona pas que quora sa projeccion es la meteissa que la de la carta principala", @@ -48,7 +48,7 @@ OpenLayers.Lang["oc"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "Lo jaç ${layerType} es pas en mesura de se cargar corrèctament.\x3cbr\x3e\x3cbr\x3ePer suprimir aqueste messatge, causissètz una BaseLayer novèla dins lo selector de jaç en naut a drecha.\x3cbr\x3e\x3cbr\x3eAquò es possiblament causat per la non-inclusion de la librariá ${layerLib}.\x3cbr\x3e\x3cbr\x3eDesvolopaires : per saber cossí corregir aquí, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3eclicatz aicí\x3c/a\x3e", - 'scale': "Escala ~ 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Escala ~ 1 : ${scaleDenom}", 'W': "O", diff --git a/lib/OpenLayers/Lang/pt-BR.js b/lib/OpenLayers/Lang/pt-BR.js index 9f413ed2ba..8e945f6a70 100644 --- a/lib/OpenLayers/Lang/pt-BR.js +++ b/lib/OpenLayers/Lang/pt-BR.js @@ -17,11 +17,11 @@ OpenLayers.Lang["pt-br"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "A requisição retornou um erro não tratado: ${statusText}", - 'permalink': "Link para essa página", + 'Permalink': "Link para essa página", - 'overlays': "Camadas de Sobreposição", + 'Overlays': "Camadas de Sobreposição", - 'baseLayer': "Camada Base", + 'Base Layer': "Camada Base", 'sameProjection': "O mapa de referência só funciona quando ele está na mesma projeção do mapa principal", @@ -49,7 +49,7 @@ OpenLayers.Lang["pt-br"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "Não foi possível carregar a camada ${layerType} corretamente.\x3cbr\x3e\x3cbr\x3ePara se livrar dessa mensagem, selecione uma nova Camada Base, na ferramenta de alternação de camadas localização do canto superior direito.\x3cbr\x3e\x3cbr\x3eMuito provavelmente, isso foi causado porque o script da biblioteca ${layerLib} não foi incluído corretamente.\x3cbr\x3e\x3cbr\x3eDesenvolvedores: Para obter ajuda em solucionar esse problema \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3ecliquem aqui\x3c/a\x3e", - 'scale': "Escala = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Escala = 1 : ${scaleDenom}", 'W': "O", diff --git a/lib/OpenLayers/Lang/pt.js b/lib/OpenLayers/Lang/pt.js index 15485127bd..af31230475 100644 --- a/lib/OpenLayers/Lang/pt.js +++ b/lib/OpenLayers/Lang/pt.js @@ -18,11 +18,11 @@ OpenLayers.Lang["pt"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Servidor devolveu erro não contemplado ${statusText}", - 'permalink': "Ligação permanente", + 'Permalink': "Ligação permanente", - 'overlays': "Sobreposições", + 'Overlays': "Sobreposições", - 'baseLayer': "Camada Base", + 'Base Layer': "Camada Base", 'sameProjection': "O mapa panorâmico só funciona quando está na mesma projeção que o mapa principal", @@ -50,7 +50,7 @@ OpenLayers.Lang["pt"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "A camada ${layerType} não foi correctamente carregada.\x3cbr\x3e\x3cbr\x3ePara desactivar esta mensagem, seleccione uma nova Camada-Base no \'\'switcher\'\' de camadas no canto superior direito.\x3cbr\x3e\x3cbr\x3eProvavelmente, isto acontece porque o \'\'script\'\' da biblioteca ${layerLib} não foi incluído correctamente.\x3cbr\x3e\x3cbr\x3eProgramadores: Para ajuda sobre como solucionar o problema \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3eclique aqui\x3c/a\x3e .", - 'scale': "Escala = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Escala = 1 : ${scaleDenom}", 'W': "O", diff --git a/lib/OpenLayers/Lang/ru.js b/lib/OpenLayers/Lang/ru.js index ace815160e..466dee90fc 100644 --- a/lib/OpenLayers/Lang/ru.js +++ b/lib/OpenLayers/Lang/ru.js @@ -19,11 +19,11 @@ OpenLayers.Lang["ru"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Необработанный запрос вернул ${statusText}", - 'permalink': "Постоянная ссылка", + 'Permalink': "Постоянная ссылка", - 'overlays': "Слои", + 'Overlays': "Слои", - 'baseLayer': "Основной слой", + 'Base Layer': "Основной слой", 'sameProjection': "Обзорная карта работает только тогда, когда имеет ту же проекцию, что и основная", @@ -51,7 +51,7 @@ OpenLayers.Lang["ru"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "Слой ${layerType} не удалось нормально загрузить. \x3cbr\x3e\x3cbr\x3eЧтобы избавиться от этого сообщения, выбите другой основной слой в переключателе в правом верхнем углу.\x3cbr\x3e\x3cbr\x3eСкорее всего, причина в том, что библиотека ${layerLib} не была включена или была включена некорректно.\x3cbr\x3e\x3cbr\x3eРазработчикам: чтобы узнать, как сделать, чтобы всё заработало, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3eщёлкните тут\x3c/a\x3e", - 'scale': "Масштаб = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Масштаб = 1 : ${scaleDenom}", 'W': "З", diff --git a/lib/OpenLayers/Lang/sk.js b/lib/OpenLayers/Lang/sk.js index 6d82d9949c..9c7126599e 100644 --- a/lib/OpenLayers/Lang/sk.js +++ b/lib/OpenLayers/Lang/sk.js @@ -16,11 +16,11 @@ OpenLayers.Lang["sk"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Neobslúžené požiadavky vracajú ${statusText}", - 'permalink': "Trvalý odkaz", + 'Permalink': "Trvalý odkaz", - 'overlays': "Prekrytia", + 'Overlays': "Prekrytia", - 'baseLayer': "Základná vrstva", + 'Base Layer': "Základná vrstva", 'sameProjection': "Prehľadová mapka funguje iba vtedy, keď je v rovnakej projekcii ako hlavná mapa", @@ -48,7 +48,7 @@ OpenLayers.Lang["sk"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "Vrstvu ${layerType} nebolo možné správne načítať.\x3cbr\x3e\x3cbr\x3eAby ste sa tejto správy zbavili vyberte novú BaseLayer v prepínači vrstiev v pravom hornom rohu.\x3cbr\x3e\x3cbr\x3eToto sa stalo pravdepodobne preto, že skript knižnice ${layerType} buď nebol načítaný alebo neobsahuje správny kľúč API pre vašu lokalitu.\x3cbr\x3e\x3cbr\x3eVývojári: Tu môžete získať \x3ca href=\'http://trac.openlayers.org/wiki/${layerType}\' target=\'_blank\'\x3epomoc so sfunkčnením\x3c/a\x3e", - 'scale': "Mierka = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Mierka = 1 : ${scaleDenom}", 'layerAlreadyAdded': "Pokúsili ste sa do mapy pridať vrstvu ${layerName}, ale tá už bola pridaná", diff --git a/lib/OpenLayers/Lang/sv-SE.js b/lib/OpenLayers/Lang/sv-SE.js index 0b70e80f57..f03712ea83 100644 --- a/lib/OpenLayers/Lang/sv-SE.js +++ b/lib/OpenLayers/Lang/sv-SE.js @@ -16,11 +16,11 @@ OpenLayers.Lang["sv"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Ej hanterad fråga retur ${statusText}", - 'permalink': "Permalänk", + 'Permalink': "Permalänk", - 'overlays': "Kartlager", + 'Overlays': "Kartlager", - 'baseLayer': "Bakgrundskarta", + 'Base Layer': "Bakgrundskarta", 'sameProjection': "Översiktskartan fungerar endast när den har samma projektion som huvudkartan", @@ -48,7 +48,7 @@ OpenLayers.Lang["sv"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "${layerType}-lagret kunde inte laddas korrekt.\x3cbr\x3e\x3cbr\x3eFör att slippa detta meddelande, välj en annan bakgrundskarta i lagerväljaren i övre högra hörnet.\x3cbr\x3e\x3cbr\x3eSannolikt beror felet på att ${layerLib}-biblioteket inte är inkluderat på webbsidan.\x3cbr\x3e\x3cbr\x3eUtvecklare: hjälp för att åtgärda detta, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3eklicka här\x3c/a\x3e.", - 'scale': "\x3cstrong\x3eSkala\x3c/strong\x3e 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "\x3cstrong\x3eSkala\x3c/strong\x3e 1 : ${scaleDenom}", 'layerAlreadyAdded': "Du försökte lägga till lagret: ${layerName} på kartan, men det har lagts till tidigare", diff --git a/lib/OpenLayers/Lang/te.js b/lib/OpenLayers/Lang/te.js index 6594927454..289eff3d14 100644 --- a/lib/OpenLayers/Lang/te.js +++ b/lib/OpenLayers/Lang/te.js @@ -14,7 +14,7 @@ */ OpenLayers.Lang["te"] = OpenLayers.Util.applyDefaults({ - 'permalink': "స్థిరలింకు", + 'Permalink': "స్థిరలింకు", 'W': "ప", diff --git a/lib/OpenLayers/Lang/vi.js b/lib/OpenLayers/Lang/vi.js index 5452700123..d54a828ee3 100644 --- a/lib/OpenLayers/Lang/vi.js +++ b/lib/OpenLayers/Lang/vi.js @@ -16,11 +16,11 @@ OpenLayers.Lang["vi"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "Không xử lý được phản hồi ${statusText} cho yêu cầu", - 'permalink': "Liên kết thường trực", + 'Permalink': "Liên kết thường trực", - 'overlays': "Lấp bản đồ", + 'Overlays': "Lấp bản đồ", - 'baseLayer': "Lớp nền", + 'Base Layer': "Lớp nền", 'sameProjection': "Bản đồ toàn cảnh chỉ hoạt động khi cùng phép chiếu với bản đồ chính", @@ -48,7 +48,7 @@ OpenLayers.Lang["vi"] = OpenLayers.Util.applyDefaults({ 'getLayerWarning': "Không thể tải lớp ${layerType} đúng đắn.\x3cbr\x3e\x3cbr\x3eĐể tránh thông báo này lần sau, hãy chọn BaseLayer mới dùng điều khiển chọn lớp ở góc trên phải.\x3cbr\x3e\x3cbr\x3eChắc script thư viện ${layerLib} không được bao gồm đúng kiểu.\x3cbr\x3e\x3cbr\x3e\x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3eTrợ giúp về tính năng này\x3c/a\x3e cho người phát triển.", - 'scale': "Tỷ lệ = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Tỷ lệ = 1 : ${scaleDenom}", 'W': "T", diff --git a/lib/OpenLayers/Lang/zh-CN.js b/lib/OpenLayers/Lang/zh-CN.js index 67c084ae05..376816d746 100644 --- a/lib/OpenLayers/Lang/zh-CN.js +++ b/lib/OpenLayers/Lang/zh-CN.js @@ -12,11 +12,11 @@ OpenLayers.Lang["zh-CN"] = { 'unhandledRequest': "未处理的请求,返回值为 ${statusText}", - 'permalink': "永久链接", + 'Permalink': "永久链接", - 'overlays': "叠加层", + 'Overlays': "叠加层", - 'baseLayer': "基础图层", + 'Base Layer': "基础图层", 'sameProjection': "鹰眼地图只有在和主地图使用相同的投影的时候才能正常共工作", @@ -76,7 +76,7 @@ OpenLayers.Lang["zh-CN"] = { "点击这里", - 'scale': "比例尺 = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "比例尺 = 1 : ${scaleDenom}", // console message 'layerAlreadyAdded': diff --git a/lib/OpenLayers/Lang/zh-TW.js b/lib/OpenLayers/Lang/zh-TW.js index 67eea71945..fed53af921 100644 --- a/lib/OpenLayers/Lang/zh-TW.js +++ b/lib/OpenLayers/Lang/zh-TW.js @@ -13,11 +13,11 @@ OpenLayers.Lang["zh-TW"] = { 'unhandledRequest': "未處理的請求,傳回值為 ${statusText}。", - 'permalink': "永久連結", + 'Permalink': "永久連結", - 'overlays': "額外圖層", + 'Overlays': "額外圖層", - 'baseLayer': "基礎圖層", + 'Base Layer': "基礎圖層", 'sameProjection': "地圖縮覽(OverviewMap)只能在跟主地圖相同投影時起作用。", @@ -77,7 +77,7 @@ OpenLayers.Lang["zh-TW"] = { "請按這裡", - 'scale': "Scale = 1 : ${scaleDenom}", + 'Scale = 1 : ${scaleDenom}': "Scale = 1 : ${scaleDenom}", // console message 'layerAlreadyAdded': diff --git a/tests/Lang.html b/tests/Lang.html index eb50f2e85c..9f4fa9b36d 100644 --- a/tests/Lang.html +++ b/tests/Lang.html @@ -70,19 +70,19 @@ var keys = ['test1', 'test3', 'noKey']; var codes = ['en', 'en-CA', 'fr', 'fr-CA', 'sw']; var result = { - 'en': {'overlays':'Overlays', + 'en': {'Overlays':'Overlays', 'unhandledRequest':'Unhandled request return foo', 'noKey':'noKey'}, - 'en-CA': {'overlays':'Overlays', + 'en-CA': {'Overlays':'Overlays', 'unhandledRequest':'Unhandled request return foo', 'noKey':'noKey'}, - 'fr': {'overlays':'Calques', + 'fr': {'Overlays':'Calques', 'unhandledRequest':'Requête non gérée, retournant foo', 'noKey':'noKey'}, - 'fr-CA': {'overlays':'Calques', //this should result in 'fr' + 'fr-CA': {'Overlays':'Calques', //this should result in 'fr' 'unhandledRequest':'Requête non gérée, retournant foo', 'noKey':'noKey'}, - 'sw': {'overlays':'Overlays', //this should result in 'en' + 'sw': {'Overlays':'Overlays', //this should result in 'en' 'unhandledRequest':'Unhandled request return foo', 'noKey':'noKey'} }; @@ -92,7 +92,7 @@ for (var i=0; i Date: Mon, 27 Jun 2011 18:12:24 +0000 Subject: [PATCH 065/141] fixing @requires dependencies git-svn-id: http://svn.openlayers.org/trunk/openlayers@12128 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Tile/Google.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/OpenLayers/Tile/Google.js b/lib/OpenLayers/Tile/Google.js index c5fc651baa..e70a1302fc 100644 --- a/lib/OpenLayers/Tile/Google.js +++ b/lib/OpenLayers/Tile/Google.js @@ -7,8 +7,7 @@ /* * @requires OpenLayers/BaseTypes/Class.js * @requires OpenLayers/Util.js - * @requires OpenLayers/Console.js - * @requires OpenLayers/Lang.js + * @requires OpenLayers/Tile.js */ /* From eb7cc04254cc27c33624cf42ce035b9c6ef08ca7 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Wed, 29 Jun 2011 09:53:37 +0000 Subject: [PATCH 066/141] making Protocol.WFS work with just featureType and featurePrefix configured. r=bartvde (closes #3368) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12129 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/Filter/v1_0_0.js | 12 +++++++++++- lib/OpenLayers/Format/Filter/v1_1_0.js | 3 ++- lib/OpenLayers/Format/GML/Base.js | 6 +++++- lib/OpenLayers/Format/WFST/v1_0_0.js | 5 +++-- lib/OpenLayers/Format/WFST/v1_1_0.js | 5 +++-- lib/OpenLayers/Protocol/WFS/v1.js | 25 +++++++++++++++++++++---- tests/Format/Filter/v1_0_0.html | 25 +++++++++++++++++++++++++ tests/Format/Filter/v1_1_0.html | 25 +++++++++++++++++++++++++ tests/Format/GML/v3.html | 13 +++++++++++++ tests/Format/WFST/v1_0_0.html | 11 +++++++++++ tests/Format/WFST/v1_1_0.html | 11 +++++++++++ tests/Protocol/WFS.html | 19 ++++++++++++++++++- 12 files changed, 148 insertions(+), 12 deletions(-) diff --git a/lib/OpenLayers/Format/Filter/v1_0_0.js b/lib/OpenLayers/Format/Filter/v1_0_0.js index 5e1811338d..02e9aeaad6 100644 --- a/lib/OpenLayers/Format/Filter/v1_0_0.js +++ b/lib/OpenLayers/Format/Filter/v1_0_0.js @@ -124,7 +124,17 @@ OpenLayers.Format.Filter.v1_0_0 = OpenLayers.Class( }, "BBOX": function(filter) { var node = this.createElementNSPlus("ogc:BBOX"); - this.writeNode("PropertyName", filter, node); + // PropertyName is mandatory in 1.0.0, but e.g. GeoServer also + // accepts filters without it. When this is used with + // OpenLayers.Protocol.WFS, OpenLayers.Format.WFST will set a + // missing filter.property to the geometryName that is + // configured with the protocol, which defaults to "the_geom". + // So the only way to omit this mandatory property is to not + // set the property on the filter and to set the geometryName + // on the WFS protocol to null. The latter also happens when + // the protocol is configured without a geometryName and a + // featureNS. + filter.property && this.writeNode("PropertyName", filter, node); var box = this.writeNode("gml:Box", filter.value, node); if(filter.projection) { box.setAttribute("srsName", filter.projection); diff --git a/lib/OpenLayers/Format/Filter/v1_1_0.js b/lib/OpenLayers/Format/Filter/v1_1_0.js index 0bec38d4a9..9c50b4395a 100644 --- a/lib/OpenLayers/Format/Filter/v1_1_0.js +++ b/lib/OpenLayers/Format/Filter/v1_1_0.js @@ -139,7 +139,8 @@ OpenLayers.Format.Filter.v1_1_0 = OpenLayers.Class( }, "BBOX": function(filter) { var node = this.createElementNSPlus("ogc:BBOX"); - this.writeNode("PropertyName", filter, node); + // PropertyName is optional in 1.1.0 + filter.property && this.writeNode("PropertyName", filter, node); var box = this.writeNode("gml:Envelope", filter.value); if(filter.projection) { box.setAttribute("srsName", filter.projection); diff --git a/lib/OpenLayers/Format/GML/Base.js b/lib/OpenLayers/Format/GML/Base.js index b05b3fd2ee..3ec078f8a8 100644 --- a/lib/OpenLayers/Format/GML/Base.js +++ b/lib/OpenLayers/Format/GML/Base.js @@ -62,7 +62,8 @@ OpenLayers.Format.GML.Base = OpenLayers.Class(OpenLayers.Format.XML, { /** * APIProperty: geometry - * {String} Name of geometry element. Defaults to "geometry". + * {String} Name of geometry element. Defaults to "geometry". If null, it + * will be set on when the first geometry is parsed. */ geometryName: "geometry", @@ -440,6 +441,9 @@ OpenLayers.Format.GML.Base = OpenLayers.Class(OpenLayers.Format.XML, { obj.features.push(feature); }, "_geometry": function(node, obj) { + if (!this.geometryName) { + this.geometryName = node.nodeName.split(":").pop(); + } this.readChildNodes(node, obj); }, "_attribute": function(node, obj) { diff --git a/lib/OpenLayers/Format/WFST/v1_0_0.js b/lib/OpenLayers/Format/WFST/v1_0_0.js index d82810a36c..a89d930f59 100644 --- a/lib/OpenLayers/Format/WFST/v1_0_0.js +++ b/lib/OpenLayers/Format/WFST/v1_0_0.js @@ -136,9 +136,10 @@ OpenLayers.Format.WFST.v1_0_0 = OpenLayers.Class( srsName: this.srsName, srsNameInQuery: this.srsNameInQuery }, options); + var prefix = options.featurePrefix; var node = this.createElementNSPlus("wfs:Query", { attributes: { - typeName: (options.featureNS ? options.featurePrefix + ":" : "") + + typeName: (prefix ? prefix + ":" : "") + options.featureType } }); @@ -146,7 +147,7 @@ OpenLayers.Format.WFST.v1_0_0 = OpenLayers.Class( node.setAttribute("srsName", options.srsName); } if(options.featureNS) { - node.setAttribute("xmlns:" + options.featurePrefix, options.featureNS); + node.setAttribute("xmlns:" + prefix, options.featureNS); } if(options.propertyNames) { for(var i=0,len = options.propertyNames.length; i. Otherwise, the default is 'the_geom'. */ initialize: function(options) { OpenLayers.Protocol.prototype.initialize.apply(this, [options]); + if (!options.geometryName && !options.featureNS) { + // poorly configured protocol - try to not fail on BBOX filters + this.geometryName = null; + } if(!options.format) { this.format = OpenLayers.Format.WFST(OpenLayers.Util.extend({ version: this.version, @@ -281,8 +288,18 @@ OpenLayers.Protocol.WFS.v1 = OpenLayers.Class(OpenLayers.Protocol, { if(!doc || doc.length <= 0) { return null; } - return (this.readFormat !== null) ? this.readFormat.read(doc) : + var result = (this.readFormat !== null) ? this.readFormat.read(doc) : this.format.read(doc, options); + if (!this.featureNS) { + var format = this.readFormat || this.format; + this.featureNS = format.featureNS; + // no need to auto-configure again on subsequent reads + format.autoConfig = false; + if (!this.geometryName) { + this.setGeometryName(format.geometryName); + } + } + return result; }, /** diff --git a/tests/Format/Filter/v1_0_0.html b/tests/Format/Filter/v1_0_0.html index 493008be97..876723f23f 100644 --- a/tests/Format/Filter/v1_0_0.html +++ b/tests/Format/Filter/v1_0_0.html @@ -78,6 +78,31 @@ t.xml_eq(node, out, "bbox correctly written"); } + function test_BBOX_noGeometryName(t) { + t.plan(1); + // WFS 1.0.0 does not allow BBOX filters without property, but + // GeoServer accepts them. + var filter = new OpenLayers.Filter.Spatial({ + type: OpenLayers.Filter.Spatial.BBOX, + value: new OpenLayers.Bounds(-180, -90, 180, 90), + projection: "EPSG:4326" + }); + + var out = + '' + + '' + + '' + + '-180,-90 180,90' + + '' + + '' + + ''; + + var parser = new OpenLayers.Format.Filter.v1_0_0(); + var node = parser.write(filter); + + t.xml_eq(node, out, "bbox correctly written"); + } + function test_DWithin(t) { t.plan(6); diff --git a/tests/Format/Filter/v1_1_0.html b/tests/Format/Filter/v1_1_0.html index 8e73e01b30..68d1ec114d 100644 --- a/tests/Format/Filter/v1_1_0.html +++ b/tests/Format/Filter/v1_1_0.html @@ -167,6 +167,31 @@ t.xml_eq(node, out, "bbox correctly written"); } + function test_BBOX_noGeometryName(t) { + t.plan(1); + var filter = new OpenLayers.Filter.Spatial({ + type: OpenLayers.Filter.Spatial.BBOX, + value: new OpenLayers.Bounds(-180, -90, 180, 90), + projection: "EPSG:4326" + }); + + var out = + '' + + '' + + '' + + '-180 -90' + + '180 90' + + '' + + '' + + ''; + + var parser = new OpenLayers.Format.Filter.v1_1_0(); + var node = parser.write(filter); + + t.xml_eq(node, out, "bbox correctly written"); + } + + function test_Intersects(t) { t.plan(4); diff --git a/tests/Format/GML/v3.html b/tests/Format/GML/v3.html index 49b4905106..9e6c5b8482 100644 --- a/tests/Format/GML/v3.html +++ b/tests/Format/GML/v3.html @@ -50,6 +50,19 @@ } + function test_read_setGeometryName(t) { + t.plan(1); + var doc = readXML("v3/topp-states-gml.xml"); + var format = new OpenLayers.Format.GML.v3({ + featureType: "states", + featureNS: "http://www.openplans.org/topp", + geometryName: null + }); + var features = format.read(doc.documentElement); + + t.eq(format.geometryName, "the_geom", "geometryName set when parsing features"); + } + function test_readNode_bounds(t) { var files = ["v3/envelope.xml"]; diff --git a/tests/Format/WFST/v1_0_0.html b/tests/Format/WFST/v1_0_0.html index bd67071ceb..89d810e85e 100644 --- a/tests/Format/WFST/v1_0_0.html +++ b/tests/Format/WFST/v1_0_0.html @@ -67,6 +67,17 @@ } } + + function test_write_poorconfig(t) { + t.plan(1); + var format = new OpenLayers.Format.WFST.v1_0_0({ + featureType: "states", + featurePrefix: "topp" + }); + var exp = "topp:states"; + var got = format.writeNode("wfs:Query").getAttribute("typeName"); + t.eq(got, exp, "Query without featureNS but with featurePrefix queries for the correct featureType"); + } var xmlFormat = new OpenLayers.Format.XML(); function readXML(id) { diff --git a/tests/Format/WFST/v1_1_0.html b/tests/Format/WFST/v1_1_0.html index d6fdd50ed8..6fd024a669 100644 --- a/tests/Format/WFST/v1_1_0.html +++ b/tests/Format/WFST/v1_1_0.html @@ -95,6 +95,17 @@ } } + function test_write_poorconfig(t) { + t.plan(1); + var format = new OpenLayers.Format.WFST.v1_1_0({ + featureType: "states", + featurePrefix: "topp" + }); + var exp = "topp:states"; + var got = format.writeNode("wfs:Query").getAttribute("typeName"); + t.eq(got, exp, "Query without featureNS but with featurePrefix queries for the correct featureType"); + } + var xmlFormat = new OpenLayers.Format.XML(); function readXML(id) { var xml = document.getElementById(id).firstChild.nodeValue; diff --git a/tests/Protocol/WFS.html b/tests/Protocol/WFS.html index ec4afcf02a..b142b1d34d 100644 --- a/tests/Protocol/WFS.html +++ b/tests/Protocol/WFS.html @@ -104,6 +104,20 @@ OpenLayers.Request.POST = _POST; } + + function test_parseResponse_poorconfig(t) { + t.plan(2); + + var protocol = new OpenLayers.Protocol.WFS({ + url: "http://some.url.org", + featurePrefix: "topp", + featureType: "tasmania_roads" + }); + + protocol.parseResponse({responseText: document.getElementById("query_response").firstChild.nodeValue}); + t.eq(protocol.geometryName, "geom", "geometryName configured correctly"); + t.eq(protocol.featureNS, "http://www.openplans.org/topp", "featureNS configured correctly"); + } function test_exception(t) { t.plan(8); @@ -439,7 +453,6 @@ - -5,-5 5,5 @@ -448,5 +461,9 @@ --> +
    From 46899f8ba33ad11632ce3a7b57a1c616041567da Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 29 Jun 2011 22:56:58 +0000 Subject: [PATCH 067/141] Updating the TMS API docs. git-svn-id: http://svn.openlayers.org/trunk/openlayers@12131 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/TMS.js | 66 ++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/lib/OpenLayers/Layer/TMS.js b/lib/OpenLayers/Layer/TMS.js index a596f5b957..a28490f563 100644 --- a/lib/OpenLayers/Layer/TMS.js +++ b/lib/OpenLayers/Layer/TMS.js @@ -11,6 +11,18 @@ /** * Class: OpenLayers.Layer.TMS + * Create a layer for accessing tiles from services that conform with the + * Tile Map Service Specification + * (http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification). + * + * Example: + * (code) + * var layer = OpenLayers.Layer.TMS( + * "My Layer", // name for display in LayerSwitcher + * "http://tilecache.osgeo.org/wms-c/Basic.py/", // service endpoint + * {layername: "basic", type: "png"} // required properties + * ); + * (end) * * Inherits from: * - @@ -19,13 +31,33 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { /** * APIProperty: serviceVersion - * {String} + * {String} Service version for tile requests. Default is "1.0.0". */ serviceVersion: "1.0.0", + /** + * APIProperty: layername + * {String} The identifier for the as advertised by the service. + * For example, if the service advertises a with + * 'href="http://tms.osgeo.org/1.0.0/vmap0"', the property + * would be set to "vmap0". + */ + layername: null, + + /** + * APIProperty: type + * {String} The format extension corresponding to the requested tile image + * type. This is advertised in a element as the + * "extension" attribute. For example, if the service advertises a + * with , + * the property would be set to "jpg". + */ + type: null, + /** * APIProperty: isBaseLayer - * {Boolean} + * {Boolean} Make this layer a base layer. Default is true. Set false to + * use the layer as an overlay. */ isBaseLayer: true, @@ -36,6 +68,20 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * with this location (no tiles shall overlap this location). If * not provided, the grid of tiles will be aligned with the map's * . Default is ``null``. + * + * Example: + * (code) + * var layer = OpenLayers.Layer.TMS( + * "My Layer", + * "http://tilecache.osgeo.org/wms-c/Basic.py/", + * { + * layername: "basic", + * type: "png", + * // set if different than the bottom left of map.maxExtent + * tileOrigin: new OpenLayers.LonLat(-180, -90) + * } + * ); + * (end) */ tileOrigin: null, @@ -64,9 +110,11 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * Constructor: OpenLayers.Layer.TMS * * Parameters: - * name - {String} - * url - {String} - * options - {Object} Hashtable of extra options to tag onto the layer + * name - {String} Title to be displayed in a + * url - {String} Service endpoint (without the version number). E.g. + * "http://tms.osgeo.org/". + * options - {Object} Additional properties to be set on the layer. The + * and properties must be set here. */ initialize: function(name, url, options) { var newArguments = []; @@ -85,9 +133,11 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { /** * APIMethod: clone - * + * Create a complete copy of this layer. + * * Parameters: - * obj - {Object} + * obj - {Object} Should only be provided by subclasses that call this + * method. * * Returns: * {} An exact clone of this @@ -136,7 +186,7 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { }, /** - * APIMethod: setMap + * Method: setMap * When the layer is added to a map, then we can fetch our origin * (if we don't have one.) * From ffbb3a942abdbe26919a149e061a1231d9f48928 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 29 Jun 2011 23:30:24 +0000 Subject: [PATCH 068/141] Clarifying that it is the bottom-left corner of the map.maxExtent property that determines the tileOrigin if not explicitly provided. git-svn-id: http://svn.openlayers.org/trunk/openlayers@12132 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/TMS.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Layer/TMS.js b/lib/OpenLayers/Layer/TMS.js index a28490f563..930a80ad12 100644 --- a/lib/OpenLayers/Layer/TMS.js +++ b/lib/OpenLayers/Layer/TMS.js @@ -66,8 +66,8 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * {} Optional origin for aligning the grid of tiles. * If provided, requests for tiles at all resolutions will be aligned * with this location (no tiles shall overlap this location). If - * not provided, the grid of tiles will be aligned with the map's - * . Default is ``null``. + * not provided, the grid of tiles will be aligned with the bottom-left + * corner of the map's . Default is ``null``. * * Example: * (code) From bf42fd5f90f7b71da4e26aad8a93283d1f3f7816 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 30 Jun 2011 05:15:02 +0000 Subject: [PATCH 069/141] Redundant namespaces (doc change). git-svn-id: http://svn.openlayers.org/trunk/openlayers@12133 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/BaseTypes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/OpenLayers/BaseTypes.js b/lib/OpenLayers/BaseTypes.js index 0b6f3aa939..c49f5767fd 100644 --- a/lib/OpenLayers/BaseTypes.js +++ b/lib/OpenLayers/BaseTypes.js @@ -153,20 +153,20 @@ OpenLayers.String = { }, /** - * Property: OpenLayers.String.tokenRegEx + * Property: tokenRegEx * Used to find tokens in a string. * Examples: ${a}, ${a.b.c}, ${a-b}, ${5} */ tokenRegEx: /\$\{([\w.]+?)\}/g, /** - * Property: OpenLayers.String.numberRegEx + * Property: numberRegEx * Used to test strings as numbers. */ numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/, /** - * APIFunction: OpenLayers.String.isNumeric + * APIFunction: isNumeric * Determine whether a string contains only a numeric value. * * Examples: From 366fd75d97b1a20e20eab61c234c082e8fbed99b Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 30 Jun 2011 05:18:00 +0000 Subject: [PATCH 070/141] Syntax highlighting with (code)blocks(end). git-svn-id: http://svn.openlayers.org/trunk/openlayers@12134 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/BaseTypes/Bounds.js | 10 ++++++---- lib/OpenLayers/BaseTypes/Class.js | 12 ++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/OpenLayers/BaseTypes/Bounds.js b/lib/OpenLayers/BaseTypes/Bounds.js index 2924de31dc..a86e8293dd 100644 --- a/lib/OpenLayers/BaseTypes/Bounds.js +++ b/lib/OpenLayers/BaseTypes/Bounds.js @@ -16,10 +16,12 @@ * you should make sure you set them before using the bounds for anything. * * Possible use case: - * > bounds = new OpenLayers.Bounds(); - * > bounds.extend(new OpenLayers.LonLat(4,5)); - * > bounds.extend(new OpenLayers.LonLat(5,6)); - * > bounds.toBBOX(); // returns 4,5,5,6 + * (code) + * bounds = new OpenLayers.Bounds(); + * bounds.extend(new OpenLayers.LonLat(4,5)); + * bounds.extend(new OpenLayers.LonLat(5,6)); + * bounds.toBBOX(); // returns 4,5,5,6 + * (end) */ OpenLayers.Bounds = OpenLayers.Class({ diff --git a/lib/OpenLayers/BaseTypes/Class.js b/lib/OpenLayers/BaseTypes/Class.js index c6c5ffca11..23c7a6278f 100644 --- a/lib/OpenLayers/BaseTypes/Class.js +++ b/lib/OpenLayers/BaseTypes/Class.js @@ -17,13 +17,17 @@ * will be removed. * * To create a new OpenLayers-style class, use the following syntax: - * > var MyClass = OpenLayers.Class(prototype); + * (code) + * var MyClass = OpenLayers.Class(prototype); + * (end) * * To create a new OpenLayers-style class with multiple inheritance, use the * following syntax: - * > var MyClass = OpenLayers.Class(Class1, Class2, prototype); - * Note that instanceof reflection will only reveil Class1 as superclass. - * Class2 ff are mixins. + * (code) + * var MyClass = OpenLayers.Class(Class1, Class2, prototype); + * (end) + * + * Note that instanceof reflection will only reveal Class1 as superclass. * */ OpenLayers.Class = function() { From e8fa5bd719367a38006beff9928650f356040588 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 30 Jun 2011 05:22:39 +0000 Subject: [PATCH 071/141] Playing along with the class game (for docs' sake). git-svn-id: http://svn.openlayers.org/trunk/openlayers@12135 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/CSWGetDomain.js | 6 +++--- lib/OpenLayers/Format/CSWGetRecords.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/OpenLayers/Format/CSWGetDomain.js b/lib/OpenLayers/Format/CSWGetDomain.js index 238264d13e..9dee01eee8 100644 --- a/lib/OpenLayers/Format/CSWGetDomain.js +++ b/lib/OpenLayers/Format/CSWGetDomain.js @@ -8,8 +8,8 @@ */ /** - * Function: OpenLayers.Format.CSWGetDomain. - * Default version is 2.0.2. + * Class: OpenLayers.Format.CSWGetDomain + * Default version is 2.0.2. * * Returns: * {} A CSWGetDomain format of the given version. @@ -26,7 +26,7 @@ OpenLayers.Format.CSWGetDomain = function(options) { }; /** - * Constant: OpenLayers.Format.CSWGetDomain.DEFAULTS + * Constant: DEFAULTS * {Object} Default properties for the CSWGetDomain format. */ OpenLayers.Format.CSWGetDomain.DEFAULTS = { diff --git a/lib/OpenLayers/Format/CSWGetRecords.js b/lib/OpenLayers/Format/CSWGetRecords.js index e2cecc67ba..1aadcfb964 100644 --- a/lib/OpenLayers/Format/CSWGetRecords.js +++ b/lib/OpenLayers/Format/CSWGetRecords.js @@ -8,8 +8,8 @@ */ /** - * Function: OpenLayers.Format.CSWGetRecords. - * Default version is 2.0.2. + * Class: OpenLayers.Format.CSWGetRecords + * Default version is 2.0.2. * * Returns: * {} A CSWGetRecords format of the given version. @@ -26,7 +26,7 @@ OpenLayers.Format.CSWGetRecords = function(options) { }; /** - * Constant: OpenLayers.Format.CSWGetRecords.DEFAULTS + * Constant: DEFAULTS * {Object} Default properties for the CSWGetRecords format. */ OpenLayers.Format.CSWGetRecords.DEFAULTS = { From b327ede5c6efb6c1d0c17e7bfd40aaa4329b8108 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 30 Jun 2011 05:31:41 +0000 Subject: [PATCH 072/141] Correct formatting issues with map example (doc change). git-svn-id: http://svn.openlayers.org/trunk/openlayers@12136 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Map.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 38ff104258..6ffddc33c6 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -443,7 +443,7 @@ OpenLayers.Map = OpenLayers.Class({ * provided or if you intend to call the method later. * options - {Object} Optional object with properties to tag onto the map. * - * Examples (method one): + * Examples: * (code) * // create a map with default options in an element with the id "map1" * var map = new OpenLayers.Map("map1"); @@ -456,11 +456,8 @@ OpenLayers.Map = OpenLayers.Class({ * projection: "EPSG:41001" * }; * var map = new OpenLayers.Map("map2", options); - * (end) * - * Examples (method two - single argument): - * (code) - * // create a map with non-default options + * // map with non-default options - same as above but with a single argument * var map = new OpenLayers.Map({ * div: "map_id", * maxExtent: new OpenLayers.Bounds(-200000, -200000, 200000, 200000), @@ -476,6 +473,7 @@ OpenLayers.Map = OpenLayers.Class({ * units: 'm', * projection: "EPSG:41001" * }); + * (end) */ initialize: function (div, options) { From 5b19e3a00dd07e5002569d0252f3075ae9593e32 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 30 Jun 2011 05:34:00 +0000 Subject: [PATCH 073/141] Doc menu wrangling. Version upgrade for NaturalDocs. git-svn-id: http://svn.openlayers.org/trunk/openlayers@12137 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- apidoc_config/Languages.txt | 2 +- apidoc_config/Menu.txt | 98 ++++++++++++++++++++++++++++++------- apidoc_config/Topics.txt | 2 +- doc_config/Languages.txt | 2 +- doc_config/Menu.txt | 98 ++++++++++++++++++++++++++++++------- doc_config/Topics.txt | 2 +- 6 files changed, 164 insertions(+), 40 deletions(-) diff --git a/apidoc_config/Languages.txt b/apidoc_config/Languages.txt index ce0f1075cb..42b197c21b 100644 --- a/apidoc_config/Languages.txt +++ b/apidoc_config/Languages.txt @@ -1,4 +1,4 @@ -Format: Development Release 12-07-2007 (1.35 base) +Format: 1.52 # This is the Natural Docs languages file for this project. If you change # anything here, it will apply to THIS PROJECT ONLY. If you'd like to change diff --git a/apidoc_config/Menu.txt b/apidoc_config/Menu.txt index 5db992430e..d5329301d7 100644 --- a/apidoc_config/Menu.txt +++ b/apidoc_config/Menu.txt @@ -1,4 +1,4 @@ -Format: Development Release 12-07-2007 (1.35 base) +Format: 1.52 Title: OpenLayers @@ -73,8 +73,9 @@ Group: OpenLayers { File: DragPan (no auto-title, OpenLayers/Control/DragPan.js) File: DrawFeature (no auto-title, OpenLayers/Control/DrawFeature.js) File: EditingToolbar (no auto-title, OpenLayers/Control/EditingToolbar.js) + File: Geolocate (no auto-title, OpenLayers/Control/Geolocate.js) File: GetFeature (no auto-title, OpenLayers/Control/GetFeature.js) - File: Graticule (OpenLayers/Control/Graticule.js) + File: Graticule (no auto-title, OpenLayers/Control/Graticule.js) File: KeyboardDefaults (no auto-title, OpenLayers/Control/KeyboardDefaults.js) File: LayerSwitcher (no auto-title, OpenLayers/Control/LayerSwitcher.js) File: Measure (no auto-title, OpenLayers/Control/Measure.js) @@ -92,12 +93,17 @@ Group: OpenLayers { File: PanZoom (no auto-title, OpenLayers/Control/PanZoom.js) File: PanZoomBar (no auto-title, OpenLayers/Control/PanZoomBar.js) File: Permalink (no auto-title, OpenLayers/Control/Permalink.js) + File: PinchZoom (no auto-title, OpenLayers/Control/PinchZoom.js) File: Scale (no auto-title, OpenLayers/Control/Scale.js) File: ScaleLine (no auto-title, OpenLayers/Control/ScaleLine.js) File: SelectFeature (no auto-title, OpenLayers/Control/SelectFeature.js) + File: SLDSelect (no auto-title, OpenLayers/Control/SLDSelect.js) File: Snapping (no auto-title, OpenLayers/Control/Snapping.js) File: Split (no auto-title, OpenLayers/Control/Split.js) - File: WMSGetFeatureInfo (OpenLayers/Control/WMSGetFeatureInfo.js) + File: TouchNavigation (no auto-title, OpenLayers/Control/TouchNavigation.js) + File: TransformFeature (no auto-title, OpenLayers/Control/TransformFeature.js) + File: WMSGetFeatureInfo (no auto-title, OpenLayers/Control/WMSGetFeatureInfo.js) + File: WMTSGetFeatureInfo (no auto-title, OpenLayers/Control/WMTSGetFeatureInfo.js) File: ZoomBox (no auto-title, OpenLayers/Control/ZoomBox.js) File: ZoomIn (no auto-title, OpenLayers/Control/ZoomIn.js) File: ZoomOut (no auto-title, OpenLayers/Control/ZoomOut.js) @@ -119,6 +125,7 @@ Group: OpenLayers { File: Filter (no auto-title, OpenLayers/Filter.js) File: Comparison (no auto-title, OpenLayers/Filter/Comparison.js) File: FeatureId (no auto-title, OpenLayers/Filter/FeatureId.js) + File: Function (no auto-title, OpenLayers/Filter/Function.js) File: Logical (no auto-title, OpenLayers/Filter/Logical.js) File: Spatial (no auto-title, OpenLayers/Filter/Spatial.js) } # Group: Filter @@ -129,9 +136,11 @@ Group: OpenLayers { File: ArcXML (no auto-title, OpenLayers/Format/ArcXML.js) File: ArcXML.Features (no auto-title, OpenLayers/Format/ArcXML/Features.js) File: Atom (no auto-title, OpenLayers/Format/Atom.js) - File: CSWGetDomain.DEFAULTS (no auto-title, OpenLayers/Format/CSWGetDomain.js) + File: Context (no auto-title, OpenLayers/Format/Context.js) + File: CQL (no auto-title, OpenLayers/Format/CQL.js) + File: CSWGetDomain (no auto-title, OpenLayers/Format/CSWGetDomain.js) File: CSWGetDomain.v2_0_2 (no auto-title, OpenLayers/Format/CSWGetDomain/v2_0_2.js) - File: CSWGetRecords.DEFAULTS (no auto-title, OpenLayers/Format/CSWGetRecords.js) + File: CSWGetRecords (no auto-title, OpenLayers/Format/CSWGetRecords.js) File: CSWGetRecords.v2_0_2 (no auto-title, OpenLayers/Format/CSWGetRecords/v2_0_2.js) Group: Filter { @@ -139,7 +148,7 @@ Group: OpenLayers { File: Filter (no auto-title, OpenLayers/Format/Filter.js) File: v1 (no auto-title, OpenLayers/Format/Filter/v1.js) File: v1_0_0 (no auto-title, OpenLayers/Format/Filter/v1_0_0.js) - File: v1_1_0 (OpenLayers/Format/Filter/v1_1_0.js) + File: v1_1_0 (no auto-title, OpenLayers/Format/Filter/v1_1_0.js) } # Group: Filter File: GeoJSON (no auto-title, OpenLayers/Format/GeoJSON.js) @@ -156,8 +165,20 @@ Group: OpenLayers { File: GPX (no auto-title, OpenLayers/Format/GPX.js) File: JSON (no auto-title, OpenLayers/Format/JSON.js) File: KML (no auto-title, OpenLayers/Format/KML.js) + File: OGCExceptionReport (no auto-title, OpenLayers/Format/OGCExceptionReport.js) File: OSM (no auto-title, OpenLayers/Format/OSM.js) - File: OWSCommon.v1_1_0 (OpenLayers/Format/OWSCommon/v1_1_0.js) + File: OWSCommon (no auto-title, OpenLayers/Format/OWSCommon.js) + + Group: OWSCommon { + + File: v1 (no auto-title, OpenLayers/Format/OWSCommon/v1.js) + File: v1_0_0 (no auto-title, OpenLayers/Format/OWSCommon/v1_0_0.js) + File: v1_1_0 (no auto-title, OpenLayers/Format/OWSCommon/v1_1_0.js) + } # Group: OWSCommon + + File: OWSContext (no auto-title, OpenLayers/Format/OWSContext.js) + File: OWSContext.v0_3_1 (no auto-title, OpenLayers/Format/OWSContext/v0_3_1.js) + File: QueryStringFilter (no auto-title, OpenLayers/Format/QueryStringFilter.js) Group: SLD { @@ -166,10 +187,12 @@ Group: OpenLayers { File: v1_0_0 (no auto-title, OpenLayers/Format/SLD/v1_0_0.js) } # Group: SLD - File: SOSCapabilities (OpenLayers/Format/SOSCapabilities.js) - File: SOSCapabilities.v1_0_0 (OpenLayers/Format/SOSCapabilities/v1_0_0.js) - File: SOSGetObservation (OpenLayers/Format/SOSGetObservation.js) + File: SOSCapabilities (no auto-title, OpenLayers/Format/SOSCapabilities.js) + File: SOSCapabilities.v1_0_0 (no auto-title, OpenLayers/Format/SOSCapabilities/v1_0_0.js) + File: SOSGetFeatureOfInterest (no auto-title, OpenLayers/Format/SOSGetFeatureOfInterest.js) + File: SOSGetObservation (no auto-title, OpenLayers/Format/SOSGetObservation.js) File: Text (no auto-title, OpenLayers/Format/Text.js) + File: WCSGetCoverage version 1.1.0 (no auto-title, OpenLayers/Format/WCSGetCoverage.js) File: WFS (no auto-title, OpenLayers/Format/WFS.js) Group: WFSCapabilities { @@ -185,9 +208,9 @@ Group: OpenLayers { Group: WFST { File: WFST (no auto-title, OpenLayers/Format/WFST.js) - File: v1 (OpenLayers/Format/WFST/v1.js) - File: v1_0_0 (OpenLayers/Format/WFST/v1_0_0.js) - File: v1_1_0 (OpenLayers/Format/WFST/v1_1_0.js) + File: v1 (no auto-title, OpenLayers/Format/WFST/v1.js) + File: v1_0_0 (no auto-title, OpenLayers/Format/WFST/v1_0_0.js) + File: v1_1_0 (no auto-title, OpenLayers/Format/WFST/v1_1_0.js) } # Group: WFST File: WKT (no auto-title, OpenLayers/Format/WKT.js) @@ -209,6 +232,7 @@ Group: OpenLayers { File: v1_1_1 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_1_1.js) File: v1_3 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_3.js) File: v1_3_0 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_3_0.js) + File: WMSCapabilities/v1_1_1_WMSC (no auto-title, OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js) } # Group: WMSCapabilities Group: WMSDescribeLayer { @@ -218,6 +242,15 @@ Group: OpenLayers { } # Group: WMSDescribeLayer File: WMSGetFeatureInfo (no auto-title, OpenLayers/Format/WMSGetFeatureInfo.js) + File: WMTSCapabilities (no auto-title, OpenLayers/Format/WMTSCapabilities.js) + File: WMTSCapabilities.v1_0_0 (no auto-title, OpenLayers/Format/WMTSCapabilities/v1_0_0.js) + File: WPSCapabilities (no auto-title, OpenLayers/Format/WPSCapabilities.js) + File: WPSCapabilities.v1_0_0 (no auto-title, OpenLayers/Format/WPSCapabilities/v1_0_0.js) + File: WPSDescribeProcess (no auto-title, OpenLayers/Format/WPSDescribeProcess.js) + File: WPSExecute version 1.0.0 (no auto-title, OpenLayers/Format/WPSExecute.js) + File: XLS (no auto-title, OpenLayers/Format/XLS.js) + File: XLS.v1 (no auto-title, OpenLayers/Format/XLS/v1.js) + File: XLS.v1_1_0 (no auto-title, OpenLayers/Format/XLS/v1_1_0.js) File: XML (no auto-title, OpenLayers/Format/XML.js) } # Group: Format @@ -247,12 +280,14 @@ Group: OpenLayers { File: Keyboard (no auto-title, OpenLayers/Handler/Keyboard.js) File: MouseWheel (no auto-title, OpenLayers/Handler/MouseWheel.js) File: Path (no auto-title, OpenLayers/Handler/Path.js) + File: Pinch (no auto-title, OpenLayers/Handler/Pinch.js) File: Point (no auto-title, OpenLayers/Handler/Point.js) File: Polygon (no auto-title, OpenLayers/Handler/Polygon.js) File: RegularPolygon (no auto-title, OpenLayers/Handler/RegularPolygon.js) } # Group: Handler File: Icon (no auto-title, OpenLayers/Icon.js) + File: Kinetic (no auto-title, OpenLayers/Kinetic.js) Group: Lang { @@ -285,6 +320,7 @@ Group: OpenLayers { File: ja (no auto-title, OpenLayers/Lang/ja.js) File: km (no auto-title, OpenLayers/Lang/km.js) File: ksh (no auto-title, OpenLayers/Lang/ksh.js) + File: lt (no auto-title, OpenLayers/Lang/lt.js) File: nds (no auto-title, OpenLayers/Lang/nds.js) File: nb (no auto-title, OpenLayers/Lang/nb.js) File: nl (no auto-title, OpenLayers/Lang/nl.js) @@ -304,14 +340,18 @@ Group: OpenLayers { Group: Layer { File: Layer (no auto-title, OpenLayers/Layer.js) + File: ArcGISCache.js (no auto-title, OpenLayers/Layer/ArcGISCache.js) File: ArcGIS93Rest (no auto-title, OpenLayers/Layer/ArcGIS93Rest.js) File: ArcIMS (no auto-title, OpenLayers/Layer/ArcIMS.js) + File: Bing (no auto-title, OpenLayers/Layer/Bing.js) File: Boxes (no auto-title, OpenLayers/Layer/Boxes.js) File: EventPane (no auto-title, OpenLayers/Layer/EventPane.js) File: FixedZoomLevels (no auto-title, OpenLayers/Layer/FixedZoomLevels.js) File: GeoRSS (no auto-title, OpenLayers/Layer/GeoRSS.js) File: GML (no auto-title, OpenLayers/Layer/GML.js) File: Google (no auto-title, OpenLayers/Layer/Google.js) + File: Google/v3.js (no auto-title, OpenLayers/Layer/Google/v3.js) + File: GoogleNG (no auto-title, OpenLayers/Layer/GoogleNG.js) File: Grid (no auto-title, OpenLayers/Layer/Grid.js) File: HTTPRequest (no auto-title, OpenLayers/Layer/HTTPRequest.js) File: Image (no auto-title, OpenLayers/Layer/Image.js) @@ -322,6 +362,7 @@ Group: OpenLayers { File: MapServer.Untiled (no auto-title, OpenLayers/Layer/MapServer/Untiled.js) File: Markers (no auto-title, OpenLayers/Layer/Markers.js) File: MultiMap (no auto-title, OpenLayers/Layer/MultiMap.js) + File: PointGrid (no auto-title, OpenLayers/Layer/PointGrid.js) File: PointTrack (no auto-title, OpenLayers/Layer/PointTrack.js) File: SphericalMercator (no auto-title, OpenLayers/Layer/SphericalMercator.js) File: Text (no auto-title, OpenLayers/Layer/Text.js) @@ -334,9 +375,11 @@ Group: OpenLayers { File: WMS (no auto-title, OpenLayers/Layer/WMS.js) File: WMS.Untiled (no auto-title, OpenLayers/Layer/WMS/Untiled.js) File: WMS.Post (no auto-title, OpenLayers/Layer/WMS/Post.js) + File: WMTS (no auto-title, OpenLayers/Layer/WMTS.js) File: WorldWind (no auto-title, OpenLayers/Layer/WorldWind.js) - File: Yahoo (no auto-title, OpenLayers/Layer/Yahoo.js) File: XYZ (no auto-title, OpenLayers/Layer/XYZ.js) + File: Yahoo (no auto-title, OpenLayers/Layer/Yahoo.js) + File: Zoomify (no auto-title, OpenLayers/Layer/Zoomify.js) } # Group: Layer File: Map (no auto-title, OpenLayers/Map.js) @@ -377,14 +420,19 @@ Group: OpenLayers { File: v1_1_0 (no auto-title, OpenLayers/Protocol/WFS/v1_1_0.js) } # Group: WFS + File: Script (no auto-title, OpenLayers/Protocol/Script.js) + File: SOS.DEFAULTS (no auto-title, OpenLayers/Protocol/SOS.js) + File: SOS.v1_0_0 (no auto-title, OpenLayers/Protocol/SOS/v1_0_0.js) } # Group: Protocol Group: Renderer { File: Renderer (no auto-title, OpenLayers/Renderer.js) File: Canvas (no auto-title, OpenLayers/Renderer/Canvas.js) - File: Elements (no auto-title, OpenLayers/Renderer/Elements.js) + File: ElementsIndexer (no auto-title, OpenLayers/Renderer/Elements.js) + File: NG (no auto-title, OpenLayers/Renderer/NG.js) File: SVG (no auto-title, OpenLayers/Renderer/SVG.js) + File: SVG2 (no auto-title, OpenLayers/Renderer/SVG2.js) File: VML (no auto-title, OpenLayers/Renderer/VML.js) } # Group: Renderer @@ -394,6 +442,7 @@ Group: OpenLayers { File: XMLHttpRequest (no auto-title, OpenLayers/Request/XMLHttpRequest.js) } # Group: Request + File: SingleFile.js (no auto-title, OpenLayers/SingleFile.js) File: Rule (no auto-title, OpenLayers/Rule.js) Group: Strategy { @@ -401,21 +450,34 @@ Group: OpenLayers { File: Strategy (no auto-title, OpenLayers/Strategy.js) File: BBOX (no auto-title, OpenLayers/Strategy/BBOX.js) File: Cluster (no auto-title, OpenLayers/Strategy/Cluster.js) + File: Filter (no auto-title, OpenLayers/Strategy/Filter.js) File: Fixed (no auto-title, OpenLayers/Strategy/Fixed.js) File: Paging (no auto-title, OpenLayers/Strategy/Paging.js) - File: Refresh (OpenLayers/Strategy/Refresh.js) - File: Save (OpenLayers/Strategy/Save.js) + File: Refresh (no auto-title, OpenLayers/Strategy/Refresh.js) + File: Save (no auto-title, OpenLayers/Strategy/Save.js) } # Group: Strategy File: Style (no auto-title, OpenLayers/Style.js) + File: Style2 (no auto-title, OpenLayers/Style2.js) File: StyleMap (no auto-title, OpenLayers/StyleMap.js) + Group: Symbolizer { + + File: Symbolizer (no auto-title, OpenLayers/Symbolizer.js) + File: Line (no auto-title, OpenLayers/Symbolizer/Line.js) + File: Point (no auto-title, OpenLayers/Symbolizer/Point.js) + File: Polygon (no auto-title, OpenLayers/Symbolizer/Polygon.js) + File: Raster (no auto-title, OpenLayers/Symbolizer/Raster.js) + File: Text (no auto-title, OpenLayers/Symbolizer/Text.js) + } # Group: Symbolizer + Group: Tile { File: Tile (no auto-title, OpenLayers/Tile.js) + File: Google (no auto-title, OpenLayers/Tile/Google.js) File: Image (no auto-title, OpenLayers/Tile/Image.js) + File: Image.IFrame (no auto-title, OpenLayers/Tile/Image/IFrame.js) File: WFS (no auto-title, OpenLayers/Tile/WFS.js) - File: IFrame (OpenLayers/Tile/Image/IFrame.js) } # Group: Tile File: Tween (no auto-title, OpenLayers/Tween.js) diff --git a/apidoc_config/Topics.txt b/apidoc_config/Topics.txt index 9c8580c879..125abab726 100644 --- a/apidoc_config/Topics.txt +++ b/apidoc_config/Topics.txt @@ -1,4 +1,4 @@ -Format: Development Release 12-07-2007 (1.35 base) +Format: 1.52 # This is the Natural Docs topics file for this project. If you change anything # here, it will apply to THIS PROJECT ONLY. If you'd like to change something diff --git a/doc_config/Languages.txt b/doc_config/Languages.txt index ce0f1075cb..42b197c21b 100644 --- a/doc_config/Languages.txt +++ b/doc_config/Languages.txt @@ -1,4 +1,4 @@ -Format: Development Release 12-07-2007 (1.35 base) +Format: 1.52 # This is the Natural Docs languages file for this project. If you change # anything here, it will apply to THIS PROJECT ONLY. If you'd like to change diff --git a/doc_config/Menu.txt b/doc_config/Menu.txt index 5db992430e..d5329301d7 100644 --- a/doc_config/Menu.txt +++ b/doc_config/Menu.txt @@ -1,4 +1,4 @@ -Format: Development Release 12-07-2007 (1.35 base) +Format: 1.52 Title: OpenLayers @@ -73,8 +73,9 @@ Group: OpenLayers { File: DragPan (no auto-title, OpenLayers/Control/DragPan.js) File: DrawFeature (no auto-title, OpenLayers/Control/DrawFeature.js) File: EditingToolbar (no auto-title, OpenLayers/Control/EditingToolbar.js) + File: Geolocate (no auto-title, OpenLayers/Control/Geolocate.js) File: GetFeature (no auto-title, OpenLayers/Control/GetFeature.js) - File: Graticule (OpenLayers/Control/Graticule.js) + File: Graticule (no auto-title, OpenLayers/Control/Graticule.js) File: KeyboardDefaults (no auto-title, OpenLayers/Control/KeyboardDefaults.js) File: LayerSwitcher (no auto-title, OpenLayers/Control/LayerSwitcher.js) File: Measure (no auto-title, OpenLayers/Control/Measure.js) @@ -92,12 +93,17 @@ Group: OpenLayers { File: PanZoom (no auto-title, OpenLayers/Control/PanZoom.js) File: PanZoomBar (no auto-title, OpenLayers/Control/PanZoomBar.js) File: Permalink (no auto-title, OpenLayers/Control/Permalink.js) + File: PinchZoom (no auto-title, OpenLayers/Control/PinchZoom.js) File: Scale (no auto-title, OpenLayers/Control/Scale.js) File: ScaleLine (no auto-title, OpenLayers/Control/ScaleLine.js) File: SelectFeature (no auto-title, OpenLayers/Control/SelectFeature.js) + File: SLDSelect (no auto-title, OpenLayers/Control/SLDSelect.js) File: Snapping (no auto-title, OpenLayers/Control/Snapping.js) File: Split (no auto-title, OpenLayers/Control/Split.js) - File: WMSGetFeatureInfo (OpenLayers/Control/WMSGetFeatureInfo.js) + File: TouchNavigation (no auto-title, OpenLayers/Control/TouchNavigation.js) + File: TransformFeature (no auto-title, OpenLayers/Control/TransformFeature.js) + File: WMSGetFeatureInfo (no auto-title, OpenLayers/Control/WMSGetFeatureInfo.js) + File: WMTSGetFeatureInfo (no auto-title, OpenLayers/Control/WMTSGetFeatureInfo.js) File: ZoomBox (no auto-title, OpenLayers/Control/ZoomBox.js) File: ZoomIn (no auto-title, OpenLayers/Control/ZoomIn.js) File: ZoomOut (no auto-title, OpenLayers/Control/ZoomOut.js) @@ -119,6 +125,7 @@ Group: OpenLayers { File: Filter (no auto-title, OpenLayers/Filter.js) File: Comparison (no auto-title, OpenLayers/Filter/Comparison.js) File: FeatureId (no auto-title, OpenLayers/Filter/FeatureId.js) + File: Function (no auto-title, OpenLayers/Filter/Function.js) File: Logical (no auto-title, OpenLayers/Filter/Logical.js) File: Spatial (no auto-title, OpenLayers/Filter/Spatial.js) } # Group: Filter @@ -129,9 +136,11 @@ Group: OpenLayers { File: ArcXML (no auto-title, OpenLayers/Format/ArcXML.js) File: ArcXML.Features (no auto-title, OpenLayers/Format/ArcXML/Features.js) File: Atom (no auto-title, OpenLayers/Format/Atom.js) - File: CSWGetDomain.DEFAULTS (no auto-title, OpenLayers/Format/CSWGetDomain.js) + File: Context (no auto-title, OpenLayers/Format/Context.js) + File: CQL (no auto-title, OpenLayers/Format/CQL.js) + File: CSWGetDomain (no auto-title, OpenLayers/Format/CSWGetDomain.js) File: CSWGetDomain.v2_0_2 (no auto-title, OpenLayers/Format/CSWGetDomain/v2_0_2.js) - File: CSWGetRecords.DEFAULTS (no auto-title, OpenLayers/Format/CSWGetRecords.js) + File: CSWGetRecords (no auto-title, OpenLayers/Format/CSWGetRecords.js) File: CSWGetRecords.v2_0_2 (no auto-title, OpenLayers/Format/CSWGetRecords/v2_0_2.js) Group: Filter { @@ -139,7 +148,7 @@ Group: OpenLayers { File: Filter (no auto-title, OpenLayers/Format/Filter.js) File: v1 (no auto-title, OpenLayers/Format/Filter/v1.js) File: v1_0_0 (no auto-title, OpenLayers/Format/Filter/v1_0_0.js) - File: v1_1_0 (OpenLayers/Format/Filter/v1_1_0.js) + File: v1_1_0 (no auto-title, OpenLayers/Format/Filter/v1_1_0.js) } # Group: Filter File: GeoJSON (no auto-title, OpenLayers/Format/GeoJSON.js) @@ -156,8 +165,20 @@ Group: OpenLayers { File: GPX (no auto-title, OpenLayers/Format/GPX.js) File: JSON (no auto-title, OpenLayers/Format/JSON.js) File: KML (no auto-title, OpenLayers/Format/KML.js) + File: OGCExceptionReport (no auto-title, OpenLayers/Format/OGCExceptionReport.js) File: OSM (no auto-title, OpenLayers/Format/OSM.js) - File: OWSCommon.v1_1_0 (OpenLayers/Format/OWSCommon/v1_1_0.js) + File: OWSCommon (no auto-title, OpenLayers/Format/OWSCommon.js) + + Group: OWSCommon { + + File: v1 (no auto-title, OpenLayers/Format/OWSCommon/v1.js) + File: v1_0_0 (no auto-title, OpenLayers/Format/OWSCommon/v1_0_0.js) + File: v1_1_0 (no auto-title, OpenLayers/Format/OWSCommon/v1_1_0.js) + } # Group: OWSCommon + + File: OWSContext (no auto-title, OpenLayers/Format/OWSContext.js) + File: OWSContext.v0_3_1 (no auto-title, OpenLayers/Format/OWSContext/v0_3_1.js) + File: QueryStringFilter (no auto-title, OpenLayers/Format/QueryStringFilter.js) Group: SLD { @@ -166,10 +187,12 @@ Group: OpenLayers { File: v1_0_0 (no auto-title, OpenLayers/Format/SLD/v1_0_0.js) } # Group: SLD - File: SOSCapabilities (OpenLayers/Format/SOSCapabilities.js) - File: SOSCapabilities.v1_0_0 (OpenLayers/Format/SOSCapabilities/v1_0_0.js) - File: SOSGetObservation (OpenLayers/Format/SOSGetObservation.js) + File: SOSCapabilities (no auto-title, OpenLayers/Format/SOSCapabilities.js) + File: SOSCapabilities.v1_0_0 (no auto-title, OpenLayers/Format/SOSCapabilities/v1_0_0.js) + File: SOSGetFeatureOfInterest (no auto-title, OpenLayers/Format/SOSGetFeatureOfInterest.js) + File: SOSGetObservation (no auto-title, OpenLayers/Format/SOSGetObservation.js) File: Text (no auto-title, OpenLayers/Format/Text.js) + File: WCSGetCoverage version 1.1.0 (no auto-title, OpenLayers/Format/WCSGetCoverage.js) File: WFS (no auto-title, OpenLayers/Format/WFS.js) Group: WFSCapabilities { @@ -185,9 +208,9 @@ Group: OpenLayers { Group: WFST { File: WFST (no auto-title, OpenLayers/Format/WFST.js) - File: v1 (OpenLayers/Format/WFST/v1.js) - File: v1_0_0 (OpenLayers/Format/WFST/v1_0_0.js) - File: v1_1_0 (OpenLayers/Format/WFST/v1_1_0.js) + File: v1 (no auto-title, OpenLayers/Format/WFST/v1.js) + File: v1_0_0 (no auto-title, OpenLayers/Format/WFST/v1_0_0.js) + File: v1_1_0 (no auto-title, OpenLayers/Format/WFST/v1_1_0.js) } # Group: WFST File: WKT (no auto-title, OpenLayers/Format/WKT.js) @@ -209,6 +232,7 @@ Group: OpenLayers { File: v1_1_1 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_1_1.js) File: v1_3 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_3.js) File: v1_3_0 (no auto-title, OpenLayers/Format/WMSCapabilities/v1_3_0.js) + File: WMSCapabilities/v1_1_1_WMSC (no auto-title, OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js) } # Group: WMSCapabilities Group: WMSDescribeLayer { @@ -218,6 +242,15 @@ Group: OpenLayers { } # Group: WMSDescribeLayer File: WMSGetFeatureInfo (no auto-title, OpenLayers/Format/WMSGetFeatureInfo.js) + File: WMTSCapabilities (no auto-title, OpenLayers/Format/WMTSCapabilities.js) + File: WMTSCapabilities.v1_0_0 (no auto-title, OpenLayers/Format/WMTSCapabilities/v1_0_0.js) + File: WPSCapabilities (no auto-title, OpenLayers/Format/WPSCapabilities.js) + File: WPSCapabilities.v1_0_0 (no auto-title, OpenLayers/Format/WPSCapabilities/v1_0_0.js) + File: WPSDescribeProcess (no auto-title, OpenLayers/Format/WPSDescribeProcess.js) + File: WPSExecute version 1.0.0 (no auto-title, OpenLayers/Format/WPSExecute.js) + File: XLS (no auto-title, OpenLayers/Format/XLS.js) + File: XLS.v1 (no auto-title, OpenLayers/Format/XLS/v1.js) + File: XLS.v1_1_0 (no auto-title, OpenLayers/Format/XLS/v1_1_0.js) File: XML (no auto-title, OpenLayers/Format/XML.js) } # Group: Format @@ -247,12 +280,14 @@ Group: OpenLayers { File: Keyboard (no auto-title, OpenLayers/Handler/Keyboard.js) File: MouseWheel (no auto-title, OpenLayers/Handler/MouseWheel.js) File: Path (no auto-title, OpenLayers/Handler/Path.js) + File: Pinch (no auto-title, OpenLayers/Handler/Pinch.js) File: Point (no auto-title, OpenLayers/Handler/Point.js) File: Polygon (no auto-title, OpenLayers/Handler/Polygon.js) File: RegularPolygon (no auto-title, OpenLayers/Handler/RegularPolygon.js) } # Group: Handler File: Icon (no auto-title, OpenLayers/Icon.js) + File: Kinetic (no auto-title, OpenLayers/Kinetic.js) Group: Lang { @@ -285,6 +320,7 @@ Group: OpenLayers { File: ja (no auto-title, OpenLayers/Lang/ja.js) File: km (no auto-title, OpenLayers/Lang/km.js) File: ksh (no auto-title, OpenLayers/Lang/ksh.js) + File: lt (no auto-title, OpenLayers/Lang/lt.js) File: nds (no auto-title, OpenLayers/Lang/nds.js) File: nb (no auto-title, OpenLayers/Lang/nb.js) File: nl (no auto-title, OpenLayers/Lang/nl.js) @@ -304,14 +340,18 @@ Group: OpenLayers { Group: Layer { File: Layer (no auto-title, OpenLayers/Layer.js) + File: ArcGISCache.js (no auto-title, OpenLayers/Layer/ArcGISCache.js) File: ArcGIS93Rest (no auto-title, OpenLayers/Layer/ArcGIS93Rest.js) File: ArcIMS (no auto-title, OpenLayers/Layer/ArcIMS.js) + File: Bing (no auto-title, OpenLayers/Layer/Bing.js) File: Boxes (no auto-title, OpenLayers/Layer/Boxes.js) File: EventPane (no auto-title, OpenLayers/Layer/EventPane.js) File: FixedZoomLevels (no auto-title, OpenLayers/Layer/FixedZoomLevels.js) File: GeoRSS (no auto-title, OpenLayers/Layer/GeoRSS.js) File: GML (no auto-title, OpenLayers/Layer/GML.js) File: Google (no auto-title, OpenLayers/Layer/Google.js) + File: Google/v3.js (no auto-title, OpenLayers/Layer/Google/v3.js) + File: GoogleNG (no auto-title, OpenLayers/Layer/GoogleNG.js) File: Grid (no auto-title, OpenLayers/Layer/Grid.js) File: HTTPRequest (no auto-title, OpenLayers/Layer/HTTPRequest.js) File: Image (no auto-title, OpenLayers/Layer/Image.js) @@ -322,6 +362,7 @@ Group: OpenLayers { File: MapServer.Untiled (no auto-title, OpenLayers/Layer/MapServer/Untiled.js) File: Markers (no auto-title, OpenLayers/Layer/Markers.js) File: MultiMap (no auto-title, OpenLayers/Layer/MultiMap.js) + File: PointGrid (no auto-title, OpenLayers/Layer/PointGrid.js) File: PointTrack (no auto-title, OpenLayers/Layer/PointTrack.js) File: SphericalMercator (no auto-title, OpenLayers/Layer/SphericalMercator.js) File: Text (no auto-title, OpenLayers/Layer/Text.js) @@ -334,9 +375,11 @@ Group: OpenLayers { File: WMS (no auto-title, OpenLayers/Layer/WMS.js) File: WMS.Untiled (no auto-title, OpenLayers/Layer/WMS/Untiled.js) File: WMS.Post (no auto-title, OpenLayers/Layer/WMS/Post.js) + File: WMTS (no auto-title, OpenLayers/Layer/WMTS.js) File: WorldWind (no auto-title, OpenLayers/Layer/WorldWind.js) - File: Yahoo (no auto-title, OpenLayers/Layer/Yahoo.js) File: XYZ (no auto-title, OpenLayers/Layer/XYZ.js) + File: Yahoo (no auto-title, OpenLayers/Layer/Yahoo.js) + File: Zoomify (no auto-title, OpenLayers/Layer/Zoomify.js) } # Group: Layer File: Map (no auto-title, OpenLayers/Map.js) @@ -377,14 +420,19 @@ Group: OpenLayers { File: v1_1_0 (no auto-title, OpenLayers/Protocol/WFS/v1_1_0.js) } # Group: WFS + File: Script (no auto-title, OpenLayers/Protocol/Script.js) + File: SOS.DEFAULTS (no auto-title, OpenLayers/Protocol/SOS.js) + File: SOS.v1_0_0 (no auto-title, OpenLayers/Protocol/SOS/v1_0_0.js) } # Group: Protocol Group: Renderer { File: Renderer (no auto-title, OpenLayers/Renderer.js) File: Canvas (no auto-title, OpenLayers/Renderer/Canvas.js) - File: Elements (no auto-title, OpenLayers/Renderer/Elements.js) + File: ElementsIndexer (no auto-title, OpenLayers/Renderer/Elements.js) + File: NG (no auto-title, OpenLayers/Renderer/NG.js) File: SVG (no auto-title, OpenLayers/Renderer/SVG.js) + File: SVG2 (no auto-title, OpenLayers/Renderer/SVG2.js) File: VML (no auto-title, OpenLayers/Renderer/VML.js) } # Group: Renderer @@ -394,6 +442,7 @@ Group: OpenLayers { File: XMLHttpRequest (no auto-title, OpenLayers/Request/XMLHttpRequest.js) } # Group: Request + File: SingleFile.js (no auto-title, OpenLayers/SingleFile.js) File: Rule (no auto-title, OpenLayers/Rule.js) Group: Strategy { @@ -401,21 +450,34 @@ Group: OpenLayers { File: Strategy (no auto-title, OpenLayers/Strategy.js) File: BBOX (no auto-title, OpenLayers/Strategy/BBOX.js) File: Cluster (no auto-title, OpenLayers/Strategy/Cluster.js) + File: Filter (no auto-title, OpenLayers/Strategy/Filter.js) File: Fixed (no auto-title, OpenLayers/Strategy/Fixed.js) File: Paging (no auto-title, OpenLayers/Strategy/Paging.js) - File: Refresh (OpenLayers/Strategy/Refresh.js) - File: Save (OpenLayers/Strategy/Save.js) + File: Refresh (no auto-title, OpenLayers/Strategy/Refresh.js) + File: Save (no auto-title, OpenLayers/Strategy/Save.js) } # Group: Strategy File: Style (no auto-title, OpenLayers/Style.js) + File: Style2 (no auto-title, OpenLayers/Style2.js) File: StyleMap (no auto-title, OpenLayers/StyleMap.js) + Group: Symbolizer { + + File: Symbolizer (no auto-title, OpenLayers/Symbolizer.js) + File: Line (no auto-title, OpenLayers/Symbolizer/Line.js) + File: Point (no auto-title, OpenLayers/Symbolizer/Point.js) + File: Polygon (no auto-title, OpenLayers/Symbolizer/Polygon.js) + File: Raster (no auto-title, OpenLayers/Symbolizer/Raster.js) + File: Text (no auto-title, OpenLayers/Symbolizer/Text.js) + } # Group: Symbolizer + Group: Tile { File: Tile (no auto-title, OpenLayers/Tile.js) + File: Google (no auto-title, OpenLayers/Tile/Google.js) File: Image (no auto-title, OpenLayers/Tile/Image.js) + File: Image.IFrame (no auto-title, OpenLayers/Tile/Image/IFrame.js) File: WFS (no auto-title, OpenLayers/Tile/WFS.js) - File: IFrame (OpenLayers/Tile/Image/IFrame.js) } # Group: Tile File: Tween (no auto-title, OpenLayers/Tween.js) diff --git a/doc_config/Topics.txt b/doc_config/Topics.txt index 2823c71795..087d348542 100644 --- a/doc_config/Topics.txt +++ b/doc_config/Topics.txt @@ -1,4 +1,4 @@ -Format: Development Release 12-07-2007 (1.35 base) +Format: 1.52 # This is the Natural Docs topics file for this project. If you change anything # here, it will apply to THIS PROJECT ONLY. If you'd like to change something From 3485c43844daed4129d2280a8e869a5d4504b95e Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 30 Jun 2011 05:40:18 +0000 Subject: [PATCH 074/141] I don't think the addTile method was intentionally set as an API method. Please revert if this was intentional. git-svn-id: http://svn.openlayers.org/trunk/openlayers@12138 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/GoogleNG.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Layer/GoogleNG.js b/lib/OpenLayers/Layer/GoogleNG.js index 94b45324e2..f380b72331 100644 --- a/lib/OpenLayers/Layer/GoogleNG.js +++ b/lib/OpenLayers/Layer/GoogleNG.js @@ -148,7 +148,7 @@ OpenLayers.Layer.GoogleNG = OpenLayers.Class(OpenLayers.Layer.XYZ, { }, /** - * APIMethod: addTile + * Method: addTile * Create a tile, initialize it, and add it to the layer div. * * Parameters From 652fb3930ee54815dcda90ab09fcd1d682f08a9c Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 30 Jun 2011 05:44:44 +0000 Subject: [PATCH 075/141] Consistent naming in doc menus. git-svn-id: http://svn.openlayers.org/trunk/openlayers@12139 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- apidoc_config/Menu.txt | 2 +- doc_config/Menu.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apidoc_config/Menu.txt b/apidoc_config/Menu.txt index d5329301d7..fd23b6a1b6 100644 --- a/apidoc_config/Menu.txt +++ b/apidoc_config/Menu.txt @@ -350,7 +350,7 @@ Group: OpenLayers { File: GeoRSS (no auto-title, OpenLayers/Layer/GeoRSS.js) File: GML (no auto-title, OpenLayers/Layer/GML.js) File: Google (no auto-title, OpenLayers/Layer/Google.js) - File: Google/v3.js (no auto-title, OpenLayers/Layer/Google/v3.js) + File: Google.v3 (no auto-title, OpenLayers/Layer/Google/v3.js) File: GoogleNG (no auto-title, OpenLayers/Layer/GoogleNG.js) File: Grid (no auto-title, OpenLayers/Layer/Grid.js) File: HTTPRequest (no auto-title, OpenLayers/Layer/HTTPRequest.js) diff --git a/doc_config/Menu.txt b/doc_config/Menu.txt index d5329301d7..fd23b6a1b6 100644 --- a/doc_config/Menu.txt +++ b/doc_config/Menu.txt @@ -350,7 +350,7 @@ Group: OpenLayers { File: GeoRSS (no auto-title, OpenLayers/Layer/GeoRSS.js) File: GML (no auto-title, OpenLayers/Layer/GML.js) File: Google (no auto-title, OpenLayers/Layer/Google.js) - File: Google/v3.js (no auto-title, OpenLayers/Layer/Google/v3.js) + File: Google.v3 (no auto-title, OpenLayers/Layer/Google/v3.js) File: GoogleNG (no auto-title, OpenLayers/Layer/GoogleNG.js) File: Grid (no auto-title, OpenLayers/Layer/Grid.js) File: HTTPRequest (no auto-title, OpenLayers/Layer/HTTPRequest.js) From c48f2d1ca34b3c3539c0a92308e3a0c4b74bb377 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 30 Jun 2011 05:55:56 +0000 Subject: [PATCH 076/141] WFS protocol example. git-svn-id: http://svn.openlayers.org/trunk/openlayers@12140 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Protocol/WFS.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Protocol/WFS.js b/lib/OpenLayers/Protocol/WFS.js index fe1da18953..89df923470 100644 --- a/lib/OpenLayers/Protocol/WFS.js +++ b/lib/OpenLayers/Protocol/WFS.js @@ -8,11 +8,24 @@ */ /** - * Function: OpenLayers.Protocol.WFS + * Class: OpenLayers.Protocol.WFS * Used to create a versioned WFS protocol. Default version is 1.0.0. * * Returns: * {} A WFS protocol of the given version. + * + * Example: + * (code) + * var protocol = new OpenLayers.Protocol.WFS({ + * version: "1.1.0", + * url: "http://demo.opengeo.org/geoserver/wfs", + * featureType: "tasmania_roads", + * featureNS: "http://www.openplans.org/topp", + * geometryName: "the_geom" + * }); + * (end) + * + * See the protocols for specific WFS versions for more detail. */ OpenLayers.Protocol.WFS = function(options) { options = OpenLayers.Util.applyDefaults( @@ -26,7 +39,7 @@ OpenLayers.Protocol.WFS = function(options) { }; /** - * Function: OpenLayers.Protocol.WFS.fromWMSLayer + * Function: fromWMSLayer * Convenience function to create a WFS protocol from a WMS layer. This makes * the assumption that a WFS requests can be issued at the same URL as * WMS requests and that a WFS featureType exists with the same name as the From 5490d6781d5d0dabeaac80d4b82c5a657a00721c Mon Sep 17 00:00:00 2001 From: bartvde Date: Thu, 30 Jun 2011 07:17:29 +0000 Subject: [PATCH 077/141] fix up SLD tests which broke after r12129, change is similar to that done by ahocevar in tests/Protocol/WFS.html git-svn-id: http://svn.openlayers.org/trunk/openlayers@12141 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Format/SLD/v1_0_0.html | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Format/SLD/v1_0_0.html b/tests/Format/SLD/v1_0_0.html index 16bf51d509..8e2c0a238a 100644 --- a/tests/Format/SLD/v1_0_0.html +++ b/tests/Format/SLD/v1_0_0.html @@ -402,7 +402,6 @@ 'test' + '' + '' + - '' + '' + '0,0 10,10' + '' + From 7ee7c365c60ac3707fbe6f600de05b44e6eabb6d Mon Sep 17 00:00:00 2001 From: bartvde Date: Thu, 30 Jun 2011 07:40:55 +0000 Subject: [PATCH 078/141] remove trailing comma in tests, see #3393 non-functional change git-svn-id: http://svn.openlayers.org/trunk/openlayers@12142 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Format/WPSExecute.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Format/WPSExecute.html b/tests/Format/WPSExecute.html index fc731e8900..de8539d55b 100644 --- a/tests/Format/WPSExecute.html +++ b/tests/Format/WPSExecute.html @@ -69,7 +69,7 @@ boundingBox: { projection: 'http://www.opengis.net/gml/srs/epsg.xml#404000', bounds: new OpenLayers.Bounds(0.0, -7070.0, 10647.0, 1.0) - }, + } }, output: {format: 'image/tiff'} } From 4d761609b5c0923c150ed2b64d45da60beb85291 Mon Sep 17 00:00:00 2001 From: bartvde Date: Thu, 30 Jun 2011 07:45:55 +0000 Subject: [PATCH 079/141] WPSExecute tests are failing in IE8, the other issue was xsi:schemaLocation values in some of the XML snippets containing a TAB, non-functional change (closes #3393) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12143 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Format/WPSExecute.html | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/Format/WPSExecute.html b/tests/Format/WPSExecute.html index de8539d55b..124bd9722f 100644 --- a/tests/Format/WPSExecute.html +++ b/tests/Format/WPSExecute.html @@ -206,8 +206,7 @@ // example request taken from: http://geoprocessing.info/wpsdoc/1x0ExecutePOST var expected = '' + '' + +'xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">' + ' Buffer' + ' ' + ' ' + @@ -262,8 +261,7 @@ // taken from http://geoprocessing.info/schemas/wps/1.0/examples/51_wpsExecute_request_ResponseDocument.xml var expected = '' + '' + +'xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">' + ' Buffer' + ' ' + ' ' + @@ -328,8 +326,7 @@ // taken from http://geoprocessing.info/schemas/wps/1.0/examples/52_wpsExecute_request_ResponseDocument.xml var expected = '' + '' + +'xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">' + ' Buffer' + ' ' + ' ' + @@ -401,8 +398,7 @@ // taken from http://geoprocessing.info/schemas/wps/1.0/examples/51_wpsExecute_request_ResponseDocument.xml var expected = '' + '' + + 'xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">' + ' Buffer' + ' ' + ' ' + From 92f34a3e83cfff86910dbaf97376eddc94fe09a8 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Thu, 30 Jun 2011 14:51:25 +0000 Subject: [PATCH 080/141] better documentation for Layer.WMS git-svn-id: http://svn.openlayers.org/trunk/openlayers@12144 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/WMS.js | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Layer/WMS.js b/lib/OpenLayers/Layer/WMS.js index 44181cf55a..5eff3bb61f 100644 --- a/lib/OpenLayers/Layer/WMS.js +++ b/lib/OpenLayers/Layer/WMS.js @@ -76,12 +76,37 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * Constructor: OpenLayers.Layer.WMS * Create a new WMS layer object * - * Example: + * Examples: + * + * This code creates a simple WMS layer using the image/jpeg format: * (code) * var wms = new OpenLayers.Layer.WMS("NASA Global Mosaic", * "http://wms.jpl.nasa.gov/wms.cgi", * {layers: "modis,global_mosaic"}); * (end) + * Note the 3rd argument (params). Properties added to this object will be + * added to the WMS GetMap requests used for this layer's tiles. The only + * mandatory parameter is "layers". Other common WMS params include + * "transparent", "styles" and "format". Note that the "srs" param will + * always be ignored. Instead, it will be derived from the baseLayer's or + * map's projection. + * + * This code creates a transparent WMS layer with additional options: + * (code) + * var wms = new OpenLayers.Layer.WMS("NASA Global Mosaic", + * "http://wms.jpl.nasa.gov/wms.cgi", + * { + * layers: "modis,global_mosaic", + * transparent: true + * }, { + * opacity: 0.5, + * singleTile: true + * }); + * (end) + * Note that by default, a WMS layer is configured as baseLayer. Setting + * the "transparent" param to true will apply some magic (see ). + * The default image format changes from image/jpeg to image/png, and the + * layer is not configured as baseLayer. * * Parameters: * name - {String} A name for the layer @@ -89,7 +114,9 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * (e.g. http://wms.jpl.nasa.gov/wms.cgi) * params - {Object} An object with key/value pairs representing the * GetMap query string parameters and parameter values. - * options - {Ojbect} Hashtable of extra options to tag onto the layer + * options - {Ojbect} Hashtable of extra options to tag onto the layer. + * These options include all properties listed above, plus the ones + * inherited from superclasses. */ initialize: function(name, url, params, options) { var newArguments = []; From 7c01aefba08372cb0969af72568bd5680704e33e Mon Sep 17 00:00:00 2001 From: ahocevar Date: Thu, 30 Jun 2011 14:55:28 +0000 Subject: [PATCH 081/141] some NaturalDocs formatting tweaks git-svn-id: http://svn.openlayers.org/trunk/openlayers@12145 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/WMS.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Layer/WMS.js b/lib/OpenLayers/Layer/WMS.js index 5eff3bb61f..477b40dd7b 100644 --- a/lib/OpenLayers/Layer/WMS.js +++ b/lib/OpenLayers/Layer/WMS.js @@ -78,7 +78,7 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * * Examples: * - * This code creates a simple WMS layer using the image/jpeg format: + * The code below creates a simple WMS layer using the image/jpeg format. * (code) * var wms = new OpenLayers.Layer.WMS("NASA Global Mosaic", * "http://wms.jpl.nasa.gov/wms.cgi", @@ -91,7 +91,7 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * always be ignored. Instead, it will be derived from the baseLayer's or * map's projection. * - * This code creates a transparent WMS layer with additional options: + * The code below creates a transparent WMS layer with additional options. * (code) * var wms = new OpenLayers.Layer.WMS("NASA Global Mosaic", * "http://wms.jpl.nasa.gov/wms.cgi", From e4d5fb09f95808b1f25f02024529b46a47239b2a Mon Sep 17 00:00:00 2001 From: ahocevar Date: Thu, 30 Jun 2011 15:15:28 +0000 Subject: [PATCH 082/141] return value for style numbers is different in IE than in other browsers, so using parseInt git-svn-id: http://svn.openlayers.org/trunk/openlayers@12146 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Handler/Feature.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Handler/Feature.html b/tests/Handler/Feature.html index 03d44c7b77..7c768e1a69 100644 --- a/tests/Handler/Feature.html +++ b/tests/Handler/Feature.html @@ -654,9 +654,9 @@ map.addLayers([base, vector]); map.addControl(new OpenLayers.Control.SelectFeature(vector, {autoActivate: true})); map.zoomToMaxExtent(); - t.eq(vector.getZIndex(), "725", "vector layer's zIndex correct"); + t.eq(parseInt(vector.getZIndex(), 10), 725, "vector layer's zIndex correct"); map.events.triggerEvent("changelayer"); - t.eq(vector.getZIndex(), "725", "vector layer's zIndex still correct after changelayer event"); + t.eq(parseInt(vector.getZIndex(), 10), 725, "vector layer's zIndex still correct after changelayer event"); } From 28947e1411c8b727d332eb37c9920c8163babf3f Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sun, 3 Jul 2011 07:33:24 +0000 Subject: [PATCH 083/141] fixing error in comments. Non-functional change (closes #3387) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12147 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/MapGuide.js | 2 +- lib/OpenLayers/Layer/MapServer.js | 2 +- lib/OpenLayers/Layer/WMS.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/OpenLayers/Layer/MapGuide.js b/lib/OpenLayers/Layer/MapGuide.js index 7846f9534d..7b020b5849 100644 --- a/lib/OpenLayers/Layer/MapGuide.js +++ b/lib/OpenLayers/Layer/MapGuide.js @@ -168,7 +168,7 @@ OpenLayers.Layer.MapGuide = OpenLayers.Class(OpenLayers.Layer.Grid, { * groups to hide eg: 'cvc-xcv34,453-345-345sdf' * - selectionXml - {String} A selection xml string Some server plumbing * is required to read such a value. - * options - {Ojbect} Hashtable of extra options to tag onto the layer; + * options - {Object} Hashtable of extra options to tag onto the layer; * will vary depending if tiled or untiled maps are being requested */ initialize: function(name, url, params, options) { diff --git a/lib/OpenLayers/Layer/MapServer.js b/lib/OpenLayers/Layer/MapServer.js index e08aa74913..e009be8b4e 100644 --- a/lib/OpenLayers/Layer/MapServer.js +++ b/lib/OpenLayers/Layer/MapServer.js @@ -36,7 +36,7 @@ OpenLayers.Layer.MapServer = OpenLayers.Class(OpenLayers.Layer.Grid, { * (e.g. http://www2.dmsolutions.ca/cgi-bin/mapserv) * params - {Object} An object with key/value pairs representing the * GetMap query string parameters and parameter values. - * options - {Ojbect} Hashtable of extra options to tag onto the layer + * options - {Object} Hashtable of extra options to tag onto the layer */ initialize: function(name, url, params, options) { var newArguments = []; diff --git a/lib/OpenLayers/Layer/WMS.js b/lib/OpenLayers/Layer/WMS.js index 477b40dd7b..60bf8cc1c9 100644 --- a/lib/OpenLayers/Layer/WMS.js +++ b/lib/OpenLayers/Layer/WMS.js @@ -36,7 +36,7 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * *Deprecated*. See http://trac.openlayers.org/wiki/SphericalMercator * for information on the replacement for this functionality. * {Boolean} Try to reproject this layer if its coordinate reference system - * is different than that of the base layer. Default is true. + * is different than that of the base layer. Default is false. * Set this in the layer options. Should be set to false in * most cases. */ @@ -114,7 +114,7 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * (e.g. http://wms.jpl.nasa.gov/wms.cgi) * params - {Object} An object with key/value pairs representing the * GetMap query string parameters and parameter values. - * options - {Ojbect} Hashtable of extra options to tag onto the layer. + * options - {Object} Hashtable of extra options to tag onto the layer. * These options include all properties listed above, plus the ones * inherited from superclasses. */ @@ -143,7 +143,7 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, { } // jpegs can never be transparent, so intelligently switch the - // format, depending on teh browser's capabilities + // format, depending on the browser's capabilities if (this.params.FORMAT == "image/jpeg") { this.params.FORMAT = OpenLayers.Util.alphaHack() ? "image/gif" : "image/png"; From 3f2bd6ddc2117eabcbbbdfe37fb9afd7057530f1 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sun, 3 Jul 2011 09:20:47 +0000 Subject: [PATCH 084/141] using correct units for the map style git-svn-id: http://svn.openlayers.org/trunk/openlayers@12148 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/SLDSelect.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/SLDSelect.html b/examples/SLDSelect.html index 6c75e72106..ff07e319d1 100644 --- a/examples/SLDSelect.html +++ b/examples/SLDSelect.html @@ -140,7 +140,7 @@
    Using Styled Layer Descriptors to make a selection on WMS layers
    -
    +
    This example uses the OpenLayers.Control.SLDSelect to select features in a WMS From 2293987d57427436d31a92f6345088208a06d016 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 4 Jul 2011 08:37:55 +0000 Subject: [PATCH 085/141] adding a feature.modified property, making the ModifyFeature control set it and the WFST format check for it so only modified attributes and a modified geometry need to be included in an Update transaction. r=bartvde (closes #3400) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12149 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/ModifyFeature.js | 12 +++++++ lib/OpenLayers/Feature/Vector.js | 36 +++++++++++++++++++ lib/OpenLayers/Format/WFST/v1.js | 24 +++++++++++-- tests/Control/ModifyFeature.html | 26 ++++++++++++-- tests/Format/WFST/v1.html | 48 ++++++++++++++++++++++++- 5 files changed, 140 insertions(+), 6 deletions(-) diff --git a/lib/OpenLayers/Control/ModifyFeature.js b/lib/OpenLayers/Control/ModifyFeature.js index dbf2348271..31d968cbb5 100644 --- a/lib/OpenLayers/Control/ModifyFeature.js +++ b/lib/OpenLayers/Control/ModifyFeature.js @@ -368,6 +368,11 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { this.dragControl.activate(); this.onModificationStart(this.feature); } + // keep track of geometry modifications + var modified = feature.modified; + if (feature.geometry && !(modified && modified.geometry)) { + this._originalGeometry = feature.geometry.clone(); + } }, /** @@ -539,6 +544,13 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { if(this.feature.state != OpenLayers.State.INSERT && this.feature.state != OpenLayers.State.DELETE) { this.feature.state = OpenLayers.State.UPDATE; + if (this.modified && this._originalGeometry) { + var feature = this.feature; + feature.modified = OpenLayers.Util.extend(feature.modified, { + geometry: this._originalGeometry + }); + delete this._originalGeometry; + } } }, diff --git a/lib/OpenLayers/Feature/Vector.js b/lib/OpenLayers/Feature/Vector.js index d7bbc6ba8f..905e146f40 100644 --- a/lib/OpenLayers/Feature/Vector.js +++ b/lib/OpenLayers/Feature/Vector.js @@ -81,6 +81,42 @@ OpenLayers.Feature.Vector = OpenLayers.Class(OpenLayers.Feature, { * {String} rendering intent currently being used */ renderIntent: "default", + + /** + * APIProperty: modified + * {Object} An object with the originals of the geometry and attributes of + * the feature, if they were changed. Currently this property is only read + * by , and written by + * , which sets the geometry property. + * Applications can set the originals of modified attributes in the + * attributes property. Note that applications have to check if this + * object and the attributes property is already created before using it. + * After a change made with ModifyFeature, this object could look like + * + * (code) + * { + * geometry: >Object + * } + * (end) + * + * When an application has made changes to feature attributes, it could + * have set the attributes to something like this: + * + * (code) + * { + * attributes: { + * myAttribute: "original" + * } + * } + * (end) + * + * Note that only checks for truthy values in + * *modified.geometry* and the attribute names in *modified.attributes*, + * but it is recommended to set the original values (and not just true) as + * attribute value, so applications could use this information to undo + * changes. + */ + modified: null, /** * Constructor: OpenLayers.Feature.Vector diff --git a/lib/OpenLayers/Format/WFST/v1.js b/lib/OpenLayers/Format/WFST/v1.js index f810cc03d6..118888b463 100644 --- a/lib/OpenLayers/Format/WFST/v1.js +++ b/lib/OpenLayers/Format/WFST/v1.js @@ -172,9 +172,24 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, { * type - insert, update, or delete. * * Parameters: - * features - {Array()} A list of features. + * features - {Array()} A list of features. See + * below for a more detailed description of the influence of the + * feature's *modified* property. * options - {Object} * + * feature.modified rules: + * If a feature has a modified property set, the following checks will be + * made before a feature's geometry or attribute is included in an Update + * transaction: + * - *modified* is not set at all: The geometry and all attributes will be + * included. + * - *modified.geometry* is truthy: The geometry will be + * included. If *modified.attributes* is not set, all attributes will + * be included. + * - *modified.attributes* is set: Only the attributes with a truthy value + * in *modified.attributes* will be included. If *modified.geometry* + * is not set, the geometry will not be included. + * * Returns: * {String} A serialized WFS transaction. */ @@ -276,7 +291,8 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, { } // add in geometry - if (this.geometryName !== null) { + var modified = feature.modified; + if (this.geometryName !== null && (!modified || modified.geometry)) { this.srsName = this.getSrsName(feature); this.writeNode( "Property", {name: this.geometryName, value: feature.geometry}, node @@ -285,7 +301,9 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, { // add in attributes for(var key in feature.attributes) { - if(feature.attributes[key] !== undefined) { + if(feature.attributes[key] !== undefined && + (!modified || !modified.attributes || + (modified.attributes && modified.attributes[key]))) { this.writeNode( "Property", {name: key, value: feature.attributes[key]}, node ); diff --git a/tests/Control/ModifyFeature.html b/tests/Control/ModifyFeature.html index a3259dd023..940e1b7799 100644 --- a/tests/Control/ModifyFeature.html +++ b/tests/Control/ModifyFeature.html @@ -736,8 +736,30 @@ map.destroy(); } - - + + function test_setFeatureState(t) { + t.plan(4); + var map = new OpenLayers.Map("map"); + var layer = new OpenLayers.Layer.Vector("vector", {isBaseLayer: true}); + map.addLayer(layer); + var feature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(1,2)); + layer.addFeatures([feature]); + var control = new OpenLayers.Control.ModifyFeature(layer, {standalone: true}); + map.addControl(control); + + control.selectFeature(feature); + var originalGeometry = feature.geometry; + + t.ok(control._originalGeometry, "original geometry stored for later use in setFeatureState"); + + feature.geometry = new OpenLayers.Geometry.Point(2,3); + control.modified = true; + control.setFeatureState(); + + t.eq(feature.state, OpenLayers.State.UPDATE, "feature state set to UPDATE"); + t.geom_eq(feature.modified.geometry, originalGeometry, "original geometry stored on the modified property"); + t.eq(control._originalGeometry, undefined, "original geometry deleted once it is set on the modified property"); + } diff --git a/tests/Format/WFST/v1.html b/tests/Format/WFST/v1.html index a65d795e53..6833a2b7ca 100644 --- a/tests/Format/WFST/v1.html +++ b/tests/Format/WFST/v1.html @@ -45,7 +45,7 @@ deleteFeature.state = OpenLayers.State.DELETE; deleteFeature.fid = "fid.37"; - t.plan(5); + t.plan(7); var snippets = { "GetFeature": {maxFeatures: 1, outputFormat: 'json'}, "Transaction": null, @@ -61,6 +61,19 @@ var got = format.writers["wfs"][snippet].apply(format, [arg]); t.xml_eq(got, expected, snippet + " request created correctly"); } + + updateFeature.modified = {geometry: updateFeature.geometry.clone()}; + updateFeature.geometry = new OpenLayers.Geometry.Point(2,3); + var expected = readXML("UpdateModified"); + var got = format.writers["wfs"]["Update"].apply(format, [updateFeature]); + t.xml_eq(got, expected, "Update request for feature with modified geometry created correctly"); + + updateFeature.modified.attributes = {foo: "bar"}; + updateFeature.attributes.foo = "baz"; + delete updateFeature.modified.geometry; + var expected = readXML("UpdateModifiedNoGeometry"); + var got = format.writers["wfs"]["Update"].apply(format, [updateFeature]); + t.xml_eq(got, expected, "Update request for feature with no modified geometry but modified attributes created correctly"); } function test_writeNative(t) { @@ -264,6 +277,39 @@ -->
    +
    +
    +
    @@ -321,7 +321,7 @@ -->
    - +

    Styled Layer Descriptor (SLD) Example

    @@ -105,19 +22,10 @@

    This example uses a SLD file to style the vector features. To construct layers that use styles from SLD, create a StyleMap for the layer that uses one of the userStyles in the - namedLayers object of the return from format.read().

    + namedLayers object of the return from format.read(). Look at the sld.js source + to see how this is done.

    Select a new style for the WaterBodies layer below:

    -
    - Default Styler (zoom in to see more features)
    - Styler Test PropertyIsEqualTo
    - Styler Test WATER_TYPE
    - Styler Test PropertyIsGreaterThanOrEqualTo
    - Styler Test PropertyIsLessThanOrEqualTo
    - Styler Test PropertyIsGreaterThan
    - Styler Test PropertyIsLessThan
    - Styler Test PropertyIsLike
    - Styler Test PropertyIsBetween
    - Styler Test FeatureId
    -
    +
      +
    diff --git a/examples/sld.js b/examples/sld.js new file mode 100644 index 0000000000..21cb295a5d --- /dev/null +++ b/examples/sld.js @@ -0,0 +1,99 @@ +var map, sld, waterBodies; +var format = new OpenLayers.Format.SLD(); +function init() { + + map = new OpenLayers.Map('map', {allOverlays: true}); + var layers = createLayers(); + map.addLayers(layers); + + waterBodies = layers[2]; + map.addControl(new OpenLayers.Control.SelectFeature( + waterBodies, {hover: true, autoActivate: true} + )); + map.addControl(new OpenLayers.Control.LayerSwitcher()); + + OpenLayers.loadURL("tasmania/sld-tasmania.xml", null, null, complete); +} + +// handler for the loadURL function in the init method +function complete(req) { + sld = format.read(req.responseXML || req.responseText); + buildStyleChooser(); + setLayerStyles(); + + map.zoomToExtent(new OpenLayers.Bounds(143,-39,150,-45)); +} + +function createLayers() { + // the name of each layer matches a NamedLayer name in the SLD document + var layerData = [{ + name: "Land", + url: "tasmania/TasmaniaStateBoundaries.xml" + }, { + name: "Roads", + url: "tasmania/TasmaniaRoads.xml" + }, { + name: "WaterBodies", + url: "tasmania/TasmaniaWaterBodies.xml" + }, { + name: "Cities", + url: "tasmania/TasmaniaCities.xml" + }]; + + var layers = []; + for (var i=0,ii=layerData.length; iWaterBodies Default Styler - Default Styler + Default Styler (zoom in to see more objects) 1 From 912c1d5c1bc51ebce640b48479922b5d91d32364 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sat, 23 Jul 2011 20:12:02 +0000 Subject: [PATCH 107/141] click handling in the DragFeature control only for touch devices. p=jorix, r=me (closes #3428) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12181 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/DragFeature.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Control/DragFeature.js b/lib/OpenLayers/Control/DragFeature.js index ff8084d336..012ac76142 100644 --- a/lib/OpenLayers/Control/DragFeature.js +++ b/lib/OpenLayers/Control/DragFeature.js @@ -171,7 +171,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, { * feature - {} */ clickFeature: function(feature) { - if (!this.over && this.overFeature(feature)) { + if (this.handlers.feature.touch && !this.over && this.overFeature(feature)) { this.handlers.drag.dragstart(this.handlers.feature.evt); // to let the events propagate to the feature handler (click callback) this.handlers.drag.stopDown = false; @@ -186,7 +186,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, { * feature - {} */ clickoutFeature: function(feature) { - if (this.over) { + if (this.handlers.feature.touch && this.over) { this.outFeature(feature); this.handlers.drag.stopDown = true; } From 6d968d648dae40e66c3ec3b76069f36fcb383b53 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Sat, 23 Jul 2011 21:24:31 +0000 Subject: [PATCH 108/141] Correct message of unit test. No functional change. git-svn-id: http://svn.openlayers.org/trunk/openlayers@12182 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/BaseTypes/LonLat.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/BaseTypes/LonLat.html b/tests/BaseTypes/LonLat.html index cc1cd5675c..c9d790fb7c 100644 --- a/tests/BaseTypes/LonLat.html +++ b/tests/BaseTypes/LonLat.html @@ -107,7 +107,7 @@ function test_LonLat_fromString(t) { t.plan( 2 ); lonlat = OpenLayers.LonLat.fromString("6,5"); - t.ok( lonlat instanceof OpenLayers.LonLat, "new OpenLayers.LonLat returns LonLat object" ); + t.ok( lonlat instanceof OpenLayers.LonLat, "OpenLayers.LonLat.fromString() returns LonLat object" ); var ll = new OpenLayers.LonLat(6, 5); t.ok( lonlat.equals(ll), "lonlat is set correctly"); From e1c08446cbdb5f47bc544f003f168354790cc9ea Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 25 Jul 2011 08:46:04 +0000 Subject: [PATCH 109/141] Popups can now be cloused on touch devices. p=jorix (closes #3403) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12183 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Popup.js | 24 +++++++++++++++++++++++- tests/Popup.html | 18 ++++++++++++------ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/lib/OpenLayers/Popup.js b/lib/OpenLayers/Popup.js index c342434552..5ba9c9b10f 100644 --- a/lib/OpenLayers/Popup.js +++ b/lib/OpenLayers/Popup.js @@ -888,6 +888,8 @@ OpenLayers.Popup = OpenLayers.Class({ this.hide(); OpenLayers.Event.stop(e); }; + OpenLayers.Event.observe(this.closeDiv, "touchend", + OpenLayers.Function.bindAsEventListener(closePopup, this)); OpenLayers.Event.observe(this.closeDiv, "click", OpenLayers.Function.bindAsEventListener(closePopup, this)); }, @@ -944,7 +946,8 @@ OpenLayers.Popup = OpenLayers.Class({ * Because the user might select the zoom-rectangle option and * then drag it over a popup, we need a safe way to allow the * mousemove and mouseup events to pass through the popup when - * they are initiated from outside. + * they are initiated from outside. The same procedure is needed for + * touchmove and touchend events. * * Otherwise, we want to essentially kill the event propagation * for all other events, though we have to do so carefully, @@ -954,6 +957,22 @@ OpenLayers.Popup = OpenLayers.Class({ registerEvents:function() { this.events = new OpenLayers.Events(this, this.div, null, true); + var touchStarted = false; + function onTouchstart(evt) { + touchStarted = true; + OpenLayers.Event.stop(evt, true); + } + function onTouchmove(evt) { + if (touchStarted === true) { + OpenLayers.Event.stop(evt, true); + } + } + function onTouchend(evt) { + if (touchStarted === true) { + touchStarted = false; + OpenLayers.Event.stop(evt, true); + } + } this.events.on({ "mousedown": this.onmousedown, "mousemove": this.onmousemove, @@ -961,6 +980,9 @@ OpenLayers.Popup = OpenLayers.Class({ "click": this.onclick, "mouseout": this.onmouseout, "dblclick": this.ondblclick, + "touchstart": onTouchstart, + "touchmove": onTouchmove, + "touchsend": onTouchend, scope: this }); diff --git a/tests/Popup.html b/tests/Popup.html index 9d22f6a147..10245a0199 100644 --- a/tests/Popup.html +++ b/tests/Popup.html @@ -29,7 +29,7 @@ } function test_Popup_constructor (t) { - t.plan( 8 ); + t.plan(9); var id = "chicken"; var w = 500; @@ -63,11 +63,17 @@ for (var i = 0; i < OpenLayers.Event.observers[cacheID].length; i++) { var observer = OpenLayers.Event.observers[cacheID][i]; if (observer.element == closeImgDiv) { - t.ok(true, "An event was registered for the close box element"); - t.eq(observer.name, "click", "A click event was registered for the close box element"); - //call the registered observer to make sure it's the right one - observer.observer(); - break; + if (observer.name == "click") { + t.ok(true, "A click event was registered for the close box element"); + //call the registered observer to make sure it's the right one + observer.observer(); + } else if (observer.name == "touchend") { + t.ok(true, "A touchend event was registered for the close box element"); + //call the registered observer to make sure it's the right one + observer.observer(); + } else { + t.fail("A " + observer.name + " event was registered for the close box element"); + } } } } From c3850a9fb9d0131a74120acd85b865df8986d829 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 25 Jul 2011 08:52:15 +0000 Subject: [PATCH 110/141] fixing map height in sundials examples git-svn-id: http://svn.openlayers.org/trunk/openlayers@12184 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/sundials-spherical-mercator.html | 3 +++ examples/sundials.html | 3 +++ 2 files changed, 6 insertions(+) diff --git a/examples/sundials-spherical-mercator.html b/examples/sundials-spherical-mercator.html index d94b59fdb2..38f7b9321f 100644 --- a/examples/sundials-spherical-mercator.html +++ b/examples/sundials-spherical-mercator.html @@ -10,6 +10,9 @@