Commit 545efe0c authored by Valentin VASSEUR's avatar Valentin VASSEUR
Browse files

Ajout de la possibilité de visualiser plusieurs objets en surbrillance

parent 25f52691
......@@ -229,7 +229,7 @@ Trait ContextTrait
$properties = explode(";", $object);
if(count($properties)!==3){
if(count($properties)<3){
throw new \Exception("invalid number of object arguments");
}
$layerTitle = $properties[0];
......@@ -239,10 +239,25 @@ Trait ContextTrait
$key = $properties[1];
$value = $properties[2];
$data = '<?xml version="1.0" encoding="UTF-8"?> <GetFeature service="WFS" version="2.0.0" count="100" outputformat="geojson" '.
if(count($properties) == 3){
$data = '<?xml version="1.0" encoding="UTF-8"?> <GetFeature service="WFS" version="2.0.0" count="100" outputformat="geojson" '.
'xmlns="http://www.opengis.net/wfs/2.0" xmlns:cw="http://www.someserver.com/cw" xmlns:fes="http://www.opengis.net/ogc/1.1" '.
'xmlns:gml="http://www.opengis.net/gml/3.2" > <Query typeNames="'.$layerName.'" propertyName="'.$key.'" styles="default"><Filter>'.
'<PropertyIsEqualTo><PropertyName>'.$key.'</PropertyName><Literal>'.$value.'</Literal></PropertyIsEqualTo></Filter></Query></GetFeature>';
} else {
$data = '<?xml version="1.0" encoding="UTF-8"?> <GetFeature service="WFS" version="2.0.0" count="100" outputformat="geojson" '.
'xmlns="http://www.opengis.net/wfs/2.0" xmlns:cw="http://www.someserver.com/cw" xmlns:fes="http://www.opengis.net/ogc/1.1" '.
'xmlns:gml="http://www.opengis.net/gml/3.2" > <Query typeNames="'.$layerName.'" propertyName="'.$key.'" styles="default"><Filter><Or>';
$tabWdpaid = $properties;
unset($tabWdpaid[0]);
unset($tabWdpaid[1]);
foreach($tabWdpaid as $wdpaid){
$data .= '<PropertyIsEqualTo><PropertyName>'.$key.'</PropertyName><Literal>'.$wdpaid.'</Literal></PropertyIsEqualTo>';
}
$data .= '</Or></Filter></Query></GetFeature>';
}
$ch = curl_init($url);
$optEnabled = curl_setopt($ch, CURLOPT_URL, $url)
......@@ -487,4 +502,4 @@ Trait ContextTrait
return null;
}
}
\ No newline at end of file
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment