[OpenLayers-Users] Format WMSGetFeatureInfo response

Max Stephan x.zam at gmx.net
Thu Jul 2 16:20:23 EDT 2009


Hey michogar,

I haven´t seen your method of performing a wmsgetfeatureinfo yet. I only
know the method which is used in the geoserver-mappreviews as well which
looks like this for example:

                map.events.register('click', map, function (e) {
			document.getElementById('ausgabeContainer').innerHTML = "<div
id='einzelcontainer'><div id='headerInfo'>i</div><div id='einzelContent'>Die
Suche l&auml;uft ...</div></div>";
                    var params = {
                        REQUEST: "GetFeatureInfo",
                        EXCEPTIONS: "application/vnd.ogc.se_xml",
                        BBOX: map.getExtent().toBBOX(),
                        X: e.xy.x,
                        Y: e.xy.y,
                        INFO_FORMAT: 'application/vnd.ogc.gml',
			QUERY_LAYERS: 'bam:briefkaesten' + "," + 'bam:briefmarken' + "," +
'bam:paketstation' + "," + 'bam:telzellen',
                        Layers: 'bam:briefkaesten' + "," + 'bam:telzellen',
                        Srs: 'EPSG:900913',
                        WIDTH: map.size.w,
                        HEIGHT: map.size.h};
                   
OpenLayers.loadURL("http://141.13.60.18:8080/geoserver/wms", params, this,
setHTML, setHTML);
                    OpenLayers.Event.stop(e);
                });


In this case the answer from the server is given in GML-Format (INFO_FORMAT:
'application/vnd.ogc.gml'). That´s different to the
standard-GeoServer-method which uses "text/HTML" as answer-format. In the
setHTML-method I´m parsing that gml which gives me access to the seperate
features so that I can create an individual output (for example I can read
URLs from the Attributes and show the associated picture in the output).

How does your way work?

greets
Max Stephan



michogar wrote:
> 
> Hi all,
> 
> I have a wmsgetfeatureinfo control in my map. This is the code I use to
> make
> it:
> 
>     infoControls = {
>             click: new OpenLayers.Control.WMSGetFeatureInfo({
>                 url: 'http://localhost:8080/geoserver/wms',
>                 title: 'Identifica las features por click',
>                 maxFeatures: 10,
>                 layers: [Instancias, Servicios],
>                 queryVisible: true
>             }),
>             hover: new OpenLayers.Control.WMSGetFeatureInfo({
>                 url: 'http://localhost:8080/geoserver/wms',
>                 title: 'Identifica las features por hover',
>                 layers: [Instancias, Servicios],
>                 hover: true,
>                 handlerOptions: {'hover':{delay:500}},
>                 maxFeatures: 10,
>                 queryVisible: true
>             })
> 
> I register the event with:
> 
>     for (var i in infoControls) {
>         infoControls[i].events.register("getfeatureinfo", this, showInfo);
>         map.addControl(infoControls[i]);
>     }
> 
> when I take the response in the showInfo method, I only can access to the
> text, not to the xml. He only have text, not features and is impossible
> for
> me format the response using a format.wmsgetfeatureinfo.
> 
> Thanks to all.
> 
> 
> 
> -- 
> # michogar
> # Analista Programador SIG
> # GNU/Linux Counter 462666
> 
> Una visión personal:
> http://michogar.blogspot.com
> 
> El día a día:
> http://twitter.com/michogar
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://n2.nabble.com/Format-WMSGetFeatureInfo-response-tp3196230p3197582.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list