annalisa
2017-06-12 15:34:03 UTC
Hi guy
anyone can help me?
In my page i have a layer that is connected with a geoserver layer, but i
want that, clicking a point on the map, i want to extract a property (es. in
my layer i have id, city, cap and i want to extract city) but i'm not able
to...
My actual situation is this
<Loading Image...
>
but i want to see not all the proprities but only one (and to modify css
style) like this
<Loading Image...
>
how can i do???
that's my code
map.on('singleclick', function (evt) {
var view = map.getView();
var viewResolution = view.getResolution();
var source = untiled.get('visible') ? untiled.getSource() :
tiled.getSource();
var url = source.getGetFeatureInfoUrl(
evt.coordinate, viewResolution, view.getProjection(),
{ 'INFO_FORMAT': 'text/html', 'FEATURE_COUNT': 50 });
if (url) {
var coordinate = evt.coordinate;
content.innerHTML = 'my test '+'<iframe seamless src="' + url +
'"></iframe>';
overlay.setPosition(coordinate);
}
}
I think my problem is info format and how to read data...
Another question: i have to use wms o wfs?? sorry i'm so confused!
please help me!!
-----
annalisa
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/geoserver-singleclick-tp5323887.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
anyone can help me?
In my page i have a layer that is connected with a geoserver layer, but i
want that, clicking a point on the map, i want to extract a property (es. in
my layer i have id, city, cap and i want to extract city) but i'm not able
to...
My actual situation is this
<Loading Image...
but i want to see not all the proprities but only one (and to modify css
style) like this
<Loading Image...
how can i do???
that's my code
map.on('singleclick', function (evt) {
var view = map.getView();
var viewResolution = view.getResolution();
var source = untiled.get('visible') ? untiled.getSource() :
tiled.getSource();
var url = source.getGetFeatureInfoUrl(
evt.coordinate, viewResolution, view.getProjection(),
{ 'INFO_FORMAT': 'text/html', 'FEATURE_COUNT': 50 });
if (url) {
var coordinate = evt.coordinate;
content.innerHTML = 'my test '+'<iframe seamless src="' + url +
'"></iframe>';
overlay.setPosition(coordinate);
}
}
I think my problem is info format and how to read data...
Another question: i have to use wms o wfs?? sorry i'm so confused!
please help me!!
-----
annalisa
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/geoserver-singleclick-tp5323887.html
Sent from the GeoServer - User mailing list archive at Nabble.com.