Download "user manual"

Transcript
Calling Plugins
Two layers are displayed. Resolution attribute is set to null to keep standard
Mapserver resolution.
$request->layersRequest->className = 'LayersRequest';
$request->layersRequest->layerIds = array('swiss_layer_1',
'swiss_layer_2');
$request->layersRequest->resolution = null;
...
In this case, the location request object is of type bbox. Only new bounding box is
required.
$request->locationRequest->className = 'LocationRequest';
$request->locationRequest->locationType = 'bboxLocationRequest';
$request->locationRequest->bboxLocationRequest->bbox->minx = 550000;
$request->locationRequest->bboxLocationRequest->bbox->miny = 100000;
$request->locationRequest->bboxLocationRequest->bbox->maxx = 600000;
$request->locationRequest->bboxLocationRequest->bbox->maxy = 150000;
...
The query will be performed on a rectangle, on all selected layers (ie. layers defined
in layers request object). IDs and attributes will be returned.
$request->queryRequest->className = 'QueryRequest';
$request->queryRequest->shape->className = 'Bbox';
$request->queryRequest->shape->minx = 570000;
$request->queryRequest->shape->miny = 120000;
$request->queryRequest->shape->maxx = 580000;
$request->queryRequest->shape->maxy = 130000;
$request->queryRequest->queryAllLayers = true;
$request->queryRequest->defaultMaskMode = false;
$request->queryRequest->defaultTableFlags->returnAttributes = true;
$request->queryRequest->defaultTableFlags->returnTable = true;
$request->queryRequest->querySelections = array();
...
Now request object is ready, SOAP method is called.
try{
$result = $client->getMap($request);
print_r($result);
} catch (SoapFault $fault) {
print $fault->faultstring;
}
?>
Result is shown below. It includes relative paths to generated images and new scale
computed from requested bounding box.
Query results include one table per layer. No results were found in layer
swiss_layer_1 and two results in swiss_layer_2. As requested, attributes (here
attribute_3 and attribute_4) are returned for each row.
190