[OpenLayers-Users] OpenLayers.Control.GetFeature with diffrent layers (typenames) and different servers

Esben Taudorf eta at le34.dk
Thu Jul 8 06:50:43 EDT 2010


Hi everybody.

 

I have been using the OpenLayers.Control.WMSGetFeatureInfo with a
drill-down to get featureinfo from diffrent layers on different servers.


The control which worked fine, was configured like this:

 

var control = new OpenLayers.Control.WMSGetFeatureInfo(

{

    url: 'server1',

    layerUrls: ['server2'],

    layers: [Layer1_on_server1, Layer2_on_server1, Layer1_on_server2,
Layer2_on_server2],

    title: 'Get Feature Info',

    queryVisible: true,

    drillDown: true,

    infoFormat: 'application/vnd.ogc.gml',

    eventListeners:

    {

        getfeatureinfo: function(event) { handleGetFeatureInfo(event); }

    }

});

 

 

But one of the services, that I am using, have suddenly stopped
supporting WMS GetFeatureInfo request. So now I have to use their WFS
service to get featureinfo.

 

My question is then can I use the OpenLayers.Control.GetFeature to get
featureinfo from diffrent layers (typenames) and different servers?

 

Below is my code that works with two layers (typenames) on the same
server:

 

var WFScontrol = new OpenLayers.Control.GetFeature({

                             protocol: 

 
OpenLayers.Protocol.WFS({

                                                           readFormat:
new OpenLayers.Format.GML(),

 
formatOptions: {

 
outputFormat: "application/vnd.ogc.gml"

                                                           },

                                                           featureType:
['pdk:theme_pdk_lokalplan_vedtaget_v',
'pdk:theme_pdk_lokalplandelomraade_vedtaget_v'],

                                                           url:
'http://wfs.plansystem.dk/geoserver/wfs?', 

                                                           version:
'1.0.0', 

                                                           geometryName:
['geometri'],

                                                           srsName:
'EPSG:25832'

                             }), 

                             click: true,

                             box: true

});

 

Is it possible to get the GetFeature control to work like the
WMSGetFeatureInfo?

 

Any help or comment would be appreciated.

 

Regards Esben

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100708/15080d27/attachment.html


More information about the Users mailing list