Changeset 2731
- Timestamp:
- 07/23/09 21:47:41 (3 years ago)
- Location:
- trunk/MapFish
- Files:
-
- 4 modified
-
client/mfbase/mapfish/core/Protocol/MapFish.js (modified) (2 diffs)
-
client/mfbase/mapfish/tests/core/Protocol/MapFish.html (modified) (2 diffs)
-
server/python/mapfish/lib/protocol.py (modified) (1 diff)
-
server/python/mapfish/tests/test_protocol.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/MapFish/client/mfbase/mapfish/core/Protocol/MapFish.js
r2729 r2731 182 182 switch (type) { 183 183 case OpenLayers.Filter.Spatial.BBOX: 184 if (params["b ox"]) {184 if (params["bbox"]) { 185 185 OpenLayers.Console.error('Filter contains multiple ' + 186 186 'Spatial BBOX entries'); … … 189 189 return false; 190 190 } 191 params["b ox"] = filter.value.toBBOX();191 params["bbox"] = filter.value.toBBOX(); 192 192 break; 193 193 case OpenLayers.Filter.Spatial.DWITHIN: -
trunk/MapFish/client/mfbase/mapfish/tests/core/Protocol/MapFish.html
r2729 r2731 107 107 }; 108 108 protocol.filterAdapter(options); 109 t.eq(options.params.b ox, bbox,110 "filterAdapter sets correct b ox param if passed a BBOX filter");109 t.eq(options.params.bbox, bbox, 110 "filterAdapter sets correct bbox param if passed a BBOX filter"); 111 111 t.eq(options.filter, undefined, 112 112 "filterAdapter deletes filter if passed a BBOX filter"); … … 197 197 198 198 protocol.filterAdapter(options); 199 t.eq(options.params.b ox, "0,0,10,10",200 "filterAdapter sets correct b ox param if passed a Logical filter containing a BBOX");199 t.eq(options.params.bbox, "0,0,10,10", 200 "filterAdapter sets correct bbox param if passed a Logical filter containing a BBOX"); 201 201 t.eq(options.filter, undefined, 202 202 "filterAdapter deletes filter"); -
trunk/MapFish/server/python/mapfish/lib/protocol.py
r2711 r2731 80 80 epsg = int(request.params['epsg']) 81 81 82 if 'box' in request.params: 82 # "box" is an alias to "bbox" 83 box = None 84 if 'bbox' in request.params: 85 box = request.params['bbox'] 86 elif 'box' in request.params: 87 box = request.params['box'] 88 89 if box is not None: 83 90 # box spatial filter 84 91 filter = Spatial( 85 92 Spatial.BOX, 86 93 geom_column, 87 box= request.params['box'].split(','),94 box=box.split(','), 88 95 tolerance=tolerance, 89 96 epsg=epsg -
trunk/MapFish/server/python/mapfish/tests/test_protocol.py
r2705 r2731 57 57 request = FakeRequest( 58 58 {"box": "-45,-5,40,0", "tolerance": "1", "epsg": "900913"} 59 ) 60 filter = create_geom_filter(request, MappedClass) 61 assert isinstance(filter, spatial.Spatial) 62 assert filter.type == spatial.Spatial.BOX 63 assert filter.values["tolerance"] == 1 64 assert filter.values["epsg"] == 900913 65 66 request = FakeRequest( 67 {"bbox": "-45,-5,40,0", "tolerance": "1", "epsg": "900913"} 59 68 ) 60 69 filter = create_geom_filter(request, MappedClass)
