Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
prodige
bdl_visualiseur_core
Commits
545efe0c
Commit
545efe0c
authored
Dec 16, 2021
by
Valentin VASSEUR
Browse files
Ajout de la possibilité de visualiser plusieurs objets en surbrillance
parent
25f52691
Changes
1
Hide whitespace changes
Inline
Side-by-side
Controllers/Traits/ContextTrait.php
View file @
545efe0c
...
...
@@ -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
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment