[OpenLayers-Users] extract attributes from a geoserver wms
Giuseppe Naponiello
beppenapo at gmail.com
Wed Jul 28 03:40:40 EDT 2010
Hi all,
my problem is:
I have a map with two wms layers served by GeoServer, and would like
to display in a pop-up some attributes of the second layer.
I would also like to customize the pop-ups.
I tried several ways but the one I work is:
#info = new OpenLayers.Control.
#WMSGetFeatureInfo ((
# url: 'http://10.0.0.161:8080/geoserver/wms',
# title: 'Identify features by clicking',
# queryVisible: true,
# eventListeners: (
# getfeatureinfo: function (event) (
# map.addPopup (new OpenLayers.Popup.FramedCloud (
# "Chicken"
# map.getLonLatFromPixel (event.xy)
# null
# event.text,
# null
# true
# ));
# )
# )
# ));
# map.addControl (info);
# info.activate ();
With this code, however, I see the pop-up with "all" attributes in a table.
There is an alternative way, which doesn't uses GML, KML and other
formats, but uses only wms or wfs?
Another problem:
I tried with wfs but even I can not see nothing on the map!
I've tried with this code:
#var wfslayer = new OpenLayers.Layer.Vector("WFS", {
# strategies: [new OpenLayers.Strategy.BBOX()],
# protocol: new OpenLayers.Protocol.WFS({
# url: "http://10.0.0.161:8080/geoserver/wfs",
# featureType: "aeroporti",
# featureNS: "http://geoserver.org",
# srsName: "EPSG:4326",
# version: "1.0.0"
# })
#});
thanks to all
--
-beppe-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100728/e5264808/attachment.html
More information about the Users
mailing list