[OpenLayers-Commits] r11039 - in sandbox/elemoine/draw-feature: .
examples lib lib/OpenLayers/BaseTypes
lib/OpenLayers/Format/WFST lib/OpenLayers/Layer
tests/BaseTypes tests/Format/WFST tests/Layer
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Tue Jan 18 07:16:22 EST 2011
Author: erilem
Date: 2011-01-18 04:16:21 -0800 (Tue, 18 Jan 2011)
New Revision: 11039
Added:
sandbox/elemoine/draw-feature/examples/tile-origin.html
sandbox/elemoine/draw-feature/examples/tile-origin.js
Removed:
sandbox/elemoine/draw-feature/examples/tile-extent.html
sandbox/elemoine/draw-feature/examples/tile-extent.js
Modified:
sandbox/elemoine/draw-feature/
sandbox/elemoine/draw-feature/examples/bing-tiles.js
sandbox/elemoine/draw-feature/lib/OpenLayers.js
sandbox/elemoine/draw-feature/lib/OpenLayers/BaseTypes/Bounds.js
sandbox/elemoine/draw-feature/lib/OpenLayers/Format/WFST/v1.js
sandbox/elemoine/draw-feature/lib/OpenLayers/Layer/Bing.js
sandbox/elemoine/draw-feature/lib/OpenLayers/Layer/Grid.js
sandbox/elemoine/draw-feature/tests/BaseTypes/Bounds.html
sandbox/elemoine/draw-feature/tests/Format/WFST/v1.html
sandbox/elemoine/draw-feature/tests/Layer/Bing.html
sandbox/elemoine/draw-feature/tests/Layer/WMS.html
Log:
svn merge -r 11026:HEAD http://svn.openlayers.org/trunk/openlayers/.
Property changes on: sandbox/elemoine/draw-feature
___________________________________________________________________
Modified: svn:mergeinfo
- /sandbox/roberthl/openlayers:9745-9748
+ /sandbox/roberthl/openlayers:9745-9748
/trunk/openlayers:11027-11037
Modified: sandbox/elemoine/draw-feature/examples/bing-tiles.js
===================================================================
--- sandbox/elemoine/draw-feature/examples/bing-tiles.js 2011-01-18 00:13:35 UTC (rev 11038)
+++ sandbox/elemoine/draw-feature/examples/bing-tiles.js 2011-01-18 12:16:21 UTC (rev 11039)
@@ -6,7 +6,10 @@
var road = new OpenLayers.Layer.Bing({
key: apiKey,
- type: "Road"
+ type: "Road",
+ // custom metadata parameter to request the new map style - only useful
+ // before May 1st, 2011
+ metadataParams: {mapVersion: "v1"}
});
var aerial = new OpenLayers.Layer.Bing({
key: apiKey,
Deleted: sandbox/elemoine/draw-feature/examples/tile-extent.html
===================================================================
--- sandbox/elemoine/draw-feature/examples/tile-extent.html 2011-01-18 00:13:35 UTC (rev 11038)
+++ sandbox/elemoine/draw-feature/examples/tile-extent.html 2011-01-18 12:16:21 UTC (rev 11039)
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>OpenLayers Tile Extent Example</title>
- <link rel="stylesheet" href="../theme/default/style.css" type="text/css">
- <link rel="stylesheet" href="../theme/default/google.css" type="text/css">
- <link rel="stylesheet" href="style.css" type="text/css">
- </head>
- <body>
- <h1 id="title">Tile Extent</h1>
- <div id="tags">
- grid, tileExtent
- </div>
- <p id="shortdesc">
- Demonstrates the use of the tileExtent property to differentiate
- between the maximum extent and the tile extent for a layer.
- </p>
- <div id="map" class="smallmap"></div>
- <div id="docs">
- <p>
- This example uses a layer that requests map tiles from a WMS
- that only generates image responses for requests that align with
- a particular tile lattice. In this case, the layer's
- <code>maxExtent</code> does not align with that tile lattice.
- To configure the layer with a tile extent that conforms to the
- tile extent configured on the server, use the layer's
- <code>tileExtent</code> property.
- </p><p>
- View the <a href="tile-extent.js" target="_blank">tile-extent.js</a>
- source to see how this is done
- </p>
- </div>
- <script src="../lib/OpenLayers.js"></script>
- <script src="tile-extent.js"></script>
- </body>
-</html>
Deleted: sandbox/elemoine/draw-feature/examples/tile-extent.js
===================================================================
--- sandbox/elemoine/draw-feature/examples/tile-extent.js 2011-01-18 00:13:35 UTC (rev 11038)
+++ sandbox/elemoine/draw-feature/examples/tile-extent.js 2011-01-18 12:16:21 UTC (rev 11039)
@@ -1,16 +0,0 @@
-var map = new OpenLayers.Map({
- div: "map",
- maxExtent: new OpenLayers.Bounds(-130, 30, -80, 55),
- maxResolution: 360 / 256 / Math.pow(2, 4),
- numZoomLevels: 12,
- layers: [
- new OpenLayers.Layer.WMS(
- "Global Imagery",
- "http://maps.opengeo.org/geowebcache/service/wms",
- {layers: "bluemarble"},
- {tileExtent: new OpenLayers.Bounds(-180, -90, 180, 90)}
- )
- ],
- center: new OpenLayers.LonLat(-110, 45),
- zoom: 0
-});
Copied: sandbox/elemoine/draw-feature/examples/tile-origin.html (from rev 11037, trunk/openlayers/examples/tile-origin.html)
===================================================================
--- sandbox/elemoine/draw-feature/examples/tile-origin.html (rev 0)
+++ sandbox/elemoine/draw-feature/examples/tile-origin.html 2011-01-18 12:16:21 UTC (rev 11039)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>OpenLayers Tile Origin Example</title>
+ <link rel="stylesheet" href="../theme/default/style.css" type="text/css">
+ <link rel="stylesheet" href="../theme/default/google.css" type="text/css">
+ <link rel="stylesheet" href="style.css" type="text/css">
+ </head>
+ <body>
+ <h1 id="title">Tile Origin</h1>
+ <div id="tags">
+ grid, tileOrigin
+ </div>
+ <p id="shortdesc">
+ Demonstrates the use of the tileExtent property to differentiate
+ between the maximum extent and the tile extent for a layer.
+ </p>
+ <div id="map" class="smallmap"></div>
+ <div id="docs">
+ <p>
+ This example uses a layer that requests map tiles from a WMS
+ that only generates image responses for requests that align with
+ a particular tile lattice. In this case, the layer's
+ <code>maxExtent</code> does not align with that tile lattice.
+ To configure the layer with a tile extent that conforms to the
+ tile origin configured on the server, use the layer's
+ <code>tileOrigin</code> property.
+ </p><p>
+ View the <a href="tile-origin.js" target="_blank">tile-origin.js</a>
+ source to see how this is done
+ </p>
+ </div>
+ <script src="../lib/OpenLayers.js"></script>
+ <script src="tile-origin.js"></script>
+ </body>
+</html>
Copied: sandbox/elemoine/draw-feature/examples/tile-origin.js (from rev 11037, trunk/openlayers/examples/tile-origin.js)
===================================================================
--- sandbox/elemoine/draw-feature/examples/tile-origin.js (rev 0)
+++ sandbox/elemoine/draw-feature/examples/tile-origin.js 2011-01-18 12:16:21 UTC (rev 11039)
@@ -0,0 +1,16 @@
+var map = new OpenLayers.Map({
+ div: "map",
+ maxExtent: new OpenLayers.Bounds(-130, 30, -80, 55),
+ maxResolution: 360 / 256 / Math.pow(2, 4),
+ numZoomLevels: 12,
+ layers: [
+ new OpenLayers.Layer.WMS(
+ "Global Imagery",
+ "http://maps.opengeo.org/geowebcache/service/wms",
+ {layers: "bluemarble"},
+ {tileOrigin: new OpenLayers.LonLat(-180, -90)}
+ )
+ ],
+ center: new OpenLayers.LonLat(-110, 45),
+ zoom: 0
+});
Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/BaseTypes/Bounds.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/BaseTypes/Bounds.js 2011-01-18 00:13:35 UTC (rev 11038)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/BaseTypes/Bounds.js 2011-01-18 12:16:21 UTC (rev 11039)
@@ -615,14 +615,15 @@
*
* Parameters:
* str - {String}Comma-separated bounds string. (ex. <i>"5,42,10,45"</i>)
+ * reverseAxisOrder - {Boolean} Does the string use reverse axis order?
*
* Returns:
* {<OpenLayers.Bounds>} New bounds object built from the
* passed-in String.
*/
-OpenLayers.Bounds.fromString = function(str) {
+OpenLayers.Bounds.fromString = function(str, reverseAxisOrder) {
var bounds = str.split(",");
- return OpenLayers.Bounds.fromArray(bounds);
+ return OpenLayers.Bounds.fromArray(bounds, reverseAxisOrder);
};
/**
@@ -632,12 +633,18 @@
*
* Parameters:
* bbox - {Array(Float)} Array of bounds values (ex. <i>[5,42,10,45]</i>)
+ * reverseAxisOrder - {Boolean} Does the array use reverse axis order?
*
* Returns:
* {<OpenLayers.Bounds>} New bounds object built from the passed-in Array.
*/
-OpenLayers.Bounds.fromArray = function(bbox) {
- return new OpenLayers.Bounds(parseFloat(bbox[0]),
+OpenLayers.Bounds.fromArray = function(bbox, reverseAxisOrder) {
+ return reverseAxisOrder === true ?
+ new OpenLayers.Bounds(parseFloat(bbox[1]),
+ parseFloat(bbox[0]),
+ parseFloat(bbox[3]),
+ parseFloat(bbox[2])) :
+ new OpenLayers.Bounds(parseFloat(bbox[0]),
parseFloat(bbox[1]),
parseFloat(bbox[2]),
parseFloat(bbox[3]));
Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/Format/WFST/v1.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/Format/WFST/v1.js 2011-01-18 00:13:35 UTC (rev 11038)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/Format/WFST/v1.js 2011-01-18 12:16:21 UTC (rev 11039)
@@ -253,8 +253,9 @@
// add in geometry
if (this.geometryName !== null) {
+ this.srsName = this.getSrsName(feature);
this.writeNode(
- "Property", {name: this.geometryName, value: feature}, node
+ "Property", {name: this.geometryName, value: feature.geometry}, node
);
}
@@ -287,10 +288,9 @@
},
"Value": function(obj) {
var node;
- if(obj instanceof OpenLayers.Feature.Vector) {
+ if(obj instanceof OpenLayers.Geometry) {
node = this.createElementNSPlus("wfs:Value");
- this.srsName = this.getSrsName(obj);
- var geom = this.writeNode("feature:_geometry", obj.geometry).firstChild;
+ var geom = this.writeNode("feature:_geometry", obj).firstChild;
node.appendChild(geom);
} else {
node = this.createElementNSPlus("wfs:Value", {value: obj});
Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/Layer/Bing.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/Layer/Bing.js 2011-01-18 00:13:35 UTC (rev 11038)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/Layer/Bing.js 2011-01-18 12:16:21 UTC (rev 11039)
@@ -42,6 +42,13 @@
* used. Default is "Road".
*/
type: "Road",
+
+ /**
+ * APIProperty: metadataParams
+ * {Object} Optional url parameters for the Get Imagery Metadata request
+ * as described here: http://msdn.microsoft.com/en-us/library/ff701716.aspx
+ */
+ metadataParams: null,
/**
* Constant: EVENT_TYPES
@@ -106,25 +113,26 @@
var newArgs = [name, null, options];
OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs);
- this.loadMetadata(this.type);
+ this.loadMetadata();
},
/**
* Method: loadMetadata
- *
- * Parameters:
- * imageryType - {String}
*/
- loadMetadata: function(imageryType) {
+ loadMetadata: function() {
this._callbackId = "_callback_" + this.id.replace(/\./g, "_");
// link the processMetadata method to the global scope and bind it
// to this instance
window[this._callbackId] = OpenLayers.Function.bind(
OpenLayers.Layer.Bing.processMetadata, this
);
+ var params = OpenLayers.Util.applyDefaults({
+ key: this.key,
+ jsonp: this._callbackId,
+ include: "ImageryProviders"
+ }, this.metadataParams);
var url = "http://dev.virtualearth.net/REST/v1/Imagery/Metadata/" +
- imageryType + "?key=" + this.key + "&jsonp=" + this._callbackId +
- "&include=ImageryProviders";
+ this.type + "?" + OpenLayers.Util.getParameterString(params);
var script = document.createElement("script");
script.type = "text/javascript";
script.src = url;
Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/Layer/Grid.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/Layer/Grid.js 2011-01-18 00:13:35 UTC (rev 11038)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/Layer/Grid.js 2011-01-18 12:16:21 UTC (rev 11039)
@@ -24,12 +24,26 @@
* {<OpenLayers.Size>}
*/
tileSize: null,
+
+ /**
+ * Property: tileOriginCorner
+ * {String} If the <tileOrigin> property is not provided, the tile origin
+ * will be derived from the layer's <maxExtent>. The corner of the
+ * <maxExtent> used is determined by this property. Acceptable values
+ * are "tl" (top left), "tr" (top right), "bl" (bottom left), and "br"
+ * (bottom right). Default is "bl".
+ */
+ tileOriginCorner: "bl",
/**
- * APIProperty: tileExtent
- * {<OpenLayers.Bounds>}
+ * APIProperty: tileOrigin
+ * {<OpenLayers.LonLat>} 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 layer's
+ * <maxExtent>. Default is ``null``.
*/
- tileExtent: null,
+ tileOrigin: null,
/** APIProperty: tileOptions
* {Object} optional configuration options for <OpenLayers.Tile> instances
@@ -315,32 +329,32 @@
/**
* Method: calculateGridLayout
- * Generate parameters for the grid layout. This
+ * Generate parameters for the grid layout.
*
* Parameters:
* bounds - {<OpenLayers.Bound>}
- * extent - {<OpenLayers.Bounds>}
+ * origin - {<OpenLayers.LonLat>}
* resolution - {Number}
*
* Returns:
* Object containing properties tilelon, tilelat, tileoffsetlat,
* tileoffsetlat, tileoffsetx, tileoffsety
*/
- calculateGridLayout: function(bounds, extent, resolution) {
+ calculateGridLayout: function(bounds, origin, resolution) {
var tilelon = resolution * this.tileSize.w;
var tilelat = resolution * this.tileSize.h;
- var offsetlon = bounds.left - extent.left;
+ var offsetlon = bounds.left - origin.lon;
var tilecol = Math.floor(offsetlon/tilelon) - this.buffer;
var tilecolremain = offsetlon/tilelon - tilecol;
var tileoffsetx = -tilecolremain * this.tileSize.w;
- var tileoffsetlon = extent.left + tilecol * tilelon;
+ var tileoffsetlon = origin.lon + tilecol * tilelon;
- var offsetlat = bounds.top - (extent.bottom + tilelat);
+ var offsetlat = bounds.top - (origin.lat + tilelat);
var tilerow = Math.ceil(offsetlat/tilelat) + this.buffer;
var tilerowremain = tilerow - offsetlat/tilelat;
var tileoffsety = -tilerowremain * this.tileSize.h;
- var tileoffsetlat = extent.bottom + tilerow * tilelat;
+ var tileoffsetlat = origin.lat + tilerow * tilelat;
return {
tilelon: tilelon, tilelat: tilelat,
@@ -349,6 +363,32 @@
};
},
+
+ /**
+ * Method: getTileOrigin
+ * Determine the origin for aligning the grid of tiles. If a <tileOrigin>
+ * property is supplied, that will be returned. Otherwise, the origin
+ * will be derived from the layer's <maxExtent> property. In this case,
+ * the tile origin will be the corner of the <maxExtent> given by the
+ * <tileOriginCorner> property.
+ *
+ * Returns:
+ * {<OpenLayers.LonLat>} The tile origin.
+ */
+ getTileOrigin: function() {
+ var origin = this.tileOrigin;
+ if (!origin) {
+ var extent = this.getMaxExtent();
+ var edges = ({
+ "tl": ["left", "top"],
+ "tr": ["right", "top"],
+ "bl": ["left", "bottom"],
+ "br": ["right", "bottom"]
+ })[this.tileOriginCorner];
+ origin = new OpenLayers.LonLat(extent[edges[0]], extent[edges[1]]);
+ }
+ return origin;
+ },
/**
* Method: initGriddedTiles
@@ -367,10 +407,10 @@
var minCols = Math.ceil(viewSize.w/this.tileSize.w) +
Math.max(1, 2 * this.buffer);
- var extent = this.getMaxExtent();
+ var origin = this.getTileOrigin();
var resolution = this.map.getResolution();
- var tileLayout = this.calculateGridLayout(bounds, extent, resolution);
+ var tileLayout = this.calculateGridLayout(bounds, origin, resolution);
var tileoffsetx = Math.round(tileLayout.tileoffsetx); // heaven help us
var tileoffsety = Math.round(tileLayout.tileoffsety);
@@ -452,7 +492,7 @@
* {OpenLayers.Bounds}
*/
getMaxExtent: function() {
- return this.tileExtent || this.maxExtent;
+ return this.maxExtent;
},
/**
Modified: sandbox/elemoine/draw-feature/lib/OpenLayers.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers.js 2011-01-18 00:13:35 UTC (rev 11038)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers.js 2011-01-18 12:16:21 UTC (rev 11039)
@@ -314,28 +314,15 @@
"OpenLayers/Lang/en.js"
); // etc.
- var agent = navigator.userAgent;
- var docWrite = (agent.match("MSIE") || agent.match("Safari"));
- if(docWrite) {
- var allScriptTags = new Array(jsfiles.length);
- }
+ // use "parser-inserted scripts" for guaranteed execution order
+ // http://hsivonen.iki.fi/script-execution/
+ var allScriptTags = new Array(jsfiles.length);
var host = OpenLayers._getScriptLocation() + "lib/";
for (var i=0, len=jsfiles.length; i<len; i++) {
- if (docWrite) {
- allScriptTags[i] = "<script src='" + host + jsfiles[i] +
+ allScriptTags[i] = "<script src='" + host + jsfiles[i] +
"'></script>";
- } else {
- var s = document.createElement("script");
- s.src = host + jsfiles[i];
- var h = document.getElementsByTagName("head").length ?
- document.getElementsByTagName("head")[0] :
- document.body;
- h.appendChild(s);
- }
}
- if (docWrite) {
- document.write(allScriptTags.join(""));
- }
+ document.write(allScriptTags.join(""));
}
})();
Modified: sandbox/elemoine/draw-feature/tests/BaseTypes/Bounds.html
===================================================================
--- sandbox/elemoine/draw-feature/tests/BaseTypes/Bounds.html 2011-01-18 00:13:35 UTC (rev 11038)
+++ sandbox/elemoine/draw-feature/tests/BaseTypes/Bounds.html 2011-01-18 12:16:21 UTC (rev 11039)
@@ -126,7 +126,7 @@
}
function test_Bounds_fromString(t) {
- t.plan( 10 );
+ t.plan( 12 );
bounds = OpenLayers.Bounds.fromString("1,2,3,4");
t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" );
t.eq( bounds.left, 1, "bounds.left is set correctly" );
@@ -134,13 +134,18 @@
t.eq( bounds.right, 3, "bounds.right is set correctly" );
t.eq( bounds.top, 4, "bounds.top is set correctly" );
+ // reverse axis order
+ var reverseBbox = bounds.toBBOX(null, true);
+ t.eq(reverseBbox, "2,1,4,3", "toBBOX with reverseAxisOrder set to true works as expected");
+ var boundsFromReverse = OpenLayers.Bounds.fromString(reverseBbox, true);
+ t.ok(bounds.equals(boundsFromReverse), "Bounds created from string with reverseAxisOrder are correct");
+
bounds = OpenLayers.Bounds.fromString("1.1,2.2,3.3,4.4");
t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" );
t.eq( bounds.left, 1.1, "bounds.left is set correctly" );
t.eq( bounds.bottom, 2.2, "bounds.bottom is set correctly" );
t.eq( bounds.right, 3.3, "bounds.right is set correctly" );
t.eq( bounds.top, 4.4, "bounds.top is set correctly" );
-
}
function test_Bounds_getSize(t) {
@@ -358,7 +363,7 @@
}
function test_Bounds_fromArray(t) {
- t.plan( 5 );
+ t.plan( 7 );
var bbox = [1,2,3,4];
bounds = OpenLayers.Bounds.fromArray(bbox);
@@ -367,6 +372,12 @@
t.eq( bounds.bottom, 2, "bounds.bottom is set correctly" );
t.eq( bounds.right, 3, "bounds.right is set correctly" );
t.eq( bounds.top, 4, "bounds.top is set correctly" );
+
+ // reverse axis order
+ var reverseBbox = bounds.toArray(true);
+ t.eq(reverseBbox, [2,1,4,3], "toArray with reverseAxisOrder set to true works as expected");
+ var boundsFromReverse = OpenLayers.Bounds.fromArray(reverseBbox, true);
+ t.ok(bounds.equals(boundsFromReverse), "Bounds created from array with reverseAxisOrder are correct");
}
function test_Bounds_fromSize(t) {
Modified: sandbox/elemoine/draw-feature/tests/Format/WFST/v1.html
===================================================================
--- sandbox/elemoine/draw-feature/tests/Format/WFST/v1.html 2011-01-18 00:13:35 UTC (rev 11038)
+++ sandbox/elemoine/draw-feature/tests/Format/WFST/v1.html 2011-01-18 12:16:21 UTC (rev 11039)
@@ -89,6 +89,32 @@
}
}
+ function test_update_null_geometry(t) {
+ var format = new OpenLayers.Format.WFST({
+ featureNS: "http://www.openplans.org/topp",
+ featureType: "states",
+ featurePrefix: "topp",
+ geometryName: "the_geom"
+ });
+
+ var feature = new OpenLayers.Feature.Vector(null, {foo: "bar"});
+ feature.state = OpenLayers.State.UPDATE;
+ feature.fid = "fid.36";
+
+ t.plan(1);
+ var snippets = {
+ "UpdateNullGeometry": feature
+ };
+
+ var arg;
+ for (var snippet in snippets) {
+ arg = snippets[snippet]
+ var expected = readXML(snippet);
+ var got = format.writers["wfs"]["Update"].apply(format, [arg]);
+ t.xml_eq(got, expected, snippet + " request with null geometry created correctly");
+ }
+ }
+
function test_write_multiple(t) {
var format = new OpenLayers.Format.WFST({
@@ -232,5 +258,19 @@
</ogc:Filter>
</wfs:Update>
--></div>
+<div id="UpdateNullGeometry"><!--
+<wfs:Update xmlns:wfs="http://www.opengis.net/wfs" typeName="topp:states" xmlns:topp="http://www.openplans.org/topp">
+ <wfs:Property>
+ <wfs:Name>the_geom</wfs:Name>
+ </wfs:Property>
+ <wfs:Property>
+ <wfs:Name>foo</wfs:Name>
+ <wfs:Value>bar</wfs:Value>
+ </wfs:Property>
+ <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
+ <ogc:FeatureId fid="fid.36"/>
+ </ogc:Filter>
+</wfs:Update>
+--></div>
</body>
</html>
Modified: sandbox/elemoine/draw-feature/tests/Layer/Bing.html
===================================================================
--- sandbox/elemoine/draw-feature/tests/Layer/Bing.html 2011-01-18 00:13:35 UTC (rev 11038)
+++ sandbox/elemoine/draw-feature/tests/Layer/Bing.html 2011-01-18 12:16:21 UTC (rev 11039)
@@ -13,18 +13,20 @@
};
function test_constructor(t) {
- t.plan(2);
+ t.plan(3);
var origProcessMetadata = OpenLayers.Layer.Bing.processMetadata;
var log = [];
OpenLayers.Layer.Bing.processMetadata = function(metadata) {
- log.push(metadata);
+ var script = document.getElementById(this._callbackId);
+ log.push(script.src);
origProcessMetadata.apply(this, arguments);
};
- layer = new OpenLayers.Layer.Bing(options);
+ layer = new OpenLayers.Layer.Bing({metadataParams: {foo: "bar"}});
t.ok(layer instanceof OpenLayers.Layer.Bing, "returns OpenLayers.Layer.Bing object" );
t.delay_call(2, function() {
t.eq(log.length, 1, "processMetadata called");
+ t.eq(OpenLayers.Util.getParameters(log[0]).foo, "bar", "metadataParams passed to url correctly.");
OpenLayers.Layer.Bing.processMetadata = origProcessMetadata;
layer.destroy();
});
Modified: sandbox/elemoine/draw-feature/tests/Layer/WMS.html
===================================================================
--- sandbox/elemoine/draw-feature/tests/Layer/WMS.html 2011-01-18 00:13:35 UTC (rev 11038)
+++ sandbox/elemoine/draw-feature/tests/Layer/WMS.html 2011-01-18 12:16:21 UTC (rev 11039)
@@ -380,7 +380,7 @@
}
- function test_tileExtent(t) {
+ function test_tileOrigin(t) {
t.plan(4);
var dummy = new OpenLayers.Layer(null, {isBaseLayer: true});
@@ -392,7 +392,7 @@
var constrained = new OpenLayers.Layer.WMS(
null, "http://example.com/wms-c",
{layers: "constrained"},
- {buffer: 0, isBaseLayer: false, tileExtent: new OpenLayers.Bounds(-180, -90, 180, 90)}
+ {buffer: 0, isBaseLayer: false, tileOrigin: new OpenLayers.LonLat(-180, -90)}
);
var map = new OpenLayers.Map({
div: "map",
More information about the Commits
mailing list