Ticket #496: patch-MapFish-496-r2729-A1.diff
| File patch-MapFish-496-r2729-A1.diff, 3.9 kB (added by bbinet, 3 years ago) |
|---|
-
server/python/mapfish/tests/test_protocol.py
64 64 assert filter.values["epsg"] == 900913 65 65 66 66 request = FakeRequest( 67 {"bbox": "-45,-5,40,0", "tolerance": "1", "epsg": "900913"} 68 ) 69 filter = create_geom_filter(request, MappedClass) 70 assert isinstance(filter, spatial.Spatial) 71 assert filter.type == spatial.Spatial.BOX 72 assert filter.values["tolerance"] == 1 73 assert filter.values["epsg"] == 900913 74 75 request = FakeRequest( 67 76 {"lon": "-45", "lat": "5", "tolerance": "1", "epsg": "900913"} 68 77 ) 69 78 filter = create_geom_filter(request, MappedClass) -
server/python/mapfish/lib/protocol.py
79 79 if 'epsg' in request.params: 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 90 97 ) -
client/mfbase/mapfish/tests/core/Protocol/MapFish.html
106 106 } 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"); 113 113 … … 196 196 }; 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"); 203 203 -
client/mfbase/mapfish/core/Protocol/MapFish.js
181 181 var type = filter.type; 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'); 187 187 // We should merge with the old bbox, but OL does not 188 188 // proving geometry merging. 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: 194 194 params["tolerance"] = filter.distance;
