Changeset 8000
- Timestamp:
- 09/11/08 13:39:41 (3 months ago)
- Files:
-
- trunk/openlayers/examples/strategy-bbox.html (added)
- trunk/openlayers/lib/OpenLayers.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Protocol/HTTP.js (modified) (2 diffs)
- trunk/openlayers/lib/OpenLayers/Strategy/BBOX.js (added)
- trunk/openlayers/tests/Protocol/HTTP.html (modified) (1 diff)
- trunk/openlayers/tests/Strategy/BBOX.html (added)
- trunk/openlayers/tests/list-tests.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers.js
r7971 r8000 186 186 "OpenLayers/Strategy.js", 187 187 "OpenLayers/Strategy/Fixed.js", 188 "OpenLayers/Strategy/BBOX.js", 188 189 "OpenLayers/Protocol.js", 189 190 "OpenLayers/Protocol/HTTP.js", trunk/openlayers/lib/OpenLayers/Protocol/HTTP.js
r7960 r8000 113 113 * This object is modified and should not be reused. 114 114 * 115 * Valid options: 116 * url - {String} Url for the request. 117 * params - {Object} Parameters to get serialized as a query string. 118 * headers - {Object} Headers to be set on the request. 119 * filter - {<OpenLayers.Filter.BBOX>} If a bbox filter is sent, it will be 120 * serialized according to the OpenSearch Geo extension 121 * (bbox=minx,miny,maxx,maxy). Note that a BBOX filter as the child 122 * of a logical filter will not be serialized. 123 * 115 124 * Returns: 116 125 * {<OpenLayers.Protocol.Response>} A response object, whose "priv" property … … 122 131 options = OpenLayers.Util.applyDefaults(options, this.options); 123 132 var resp = new OpenLayers.Protocol.Response({requestType: "read"}); 133 134 if(options.filter && options.filter instanceof OpenLayers.Filter.Spatial) { 135 if(options.filter.type == OpenLayers.Filter.Spatial.BBOX) { 136 options.params = OpenLayers.Util.extend(options.params, { 137 bbox: options.filter.value.toArray() 138 }); 139 } 140 } 124 141 125 142 resp.priv = OpenLayers.Request.GET({ trunk/openlayers/tests/Protocol/HTTP.html
r7940 r8000 103 103 104 104 var resp = protocol.read(readOptions); 105 } 106 107 function test_read_bbox(t) { 108 t.plan(1); 109 var protocol = new OpenLayers.Protocol.HTTP(); 110 111 // fake XHR request object 112 var request = {'status': 200}; 113 114 var _get = OpenLayers.Request.GET; 115 116 var bounds = new OpenLayers.Bounds(1, 2, 3, 4); 117 var filter = new OpenLayers.Filter.Spatial({ 118 type: OpenLayers.Filter.Spatial.BBOX, 119 value: bounds, 120 projection: "foo" 121 }); 122 123 OpenLayers.Request.GET = function(options) { 124 t.eq(options.params['bbox'].toString(), bounds.toArray().toString(), 125 'GET called with bbox filter in params'); 126 return request; 127 }; 128 129 var resp = protocol.read({filter: filter}); 105 130 } 106 131 trunk/openlayers/tests/list-tests.html
r7952 r8000 126 126 <li>Strategy.html</li> 127 127 <li>Strategy/Fixed.html</li> 128 <li>Strategy/BBOX.html</li> 128 129 <li>Style.html</li> 129 130 <li>StyleMap.html</li>
