[mapserver-users] Re: WMSGetFeatureInfo problem (No results, using OL)

stela anders stelaanders at gmail.com
Wed Jan 27 11:02:31 EST 2010


Replied from my husband acc...
My bad

sorry

Stella

2010/1/27 Paul james <pauljame at gmail.com>

> Hi !
>
> I dont think that it is the problem, because WMSGetFeatureInfo is
> generating the "correct" url (I think)...
>
> Anyway I tested querying only 1 single layer and got the same result...
>
> Dammit :(
>
> Thanks anyway
>
> Stella
>
> On Wed, Jan 27, 2010 at 12:24 PM, Eichner, Andreas - SID-NLKM <
> Andreas.Eichner at sid.sachsen.de> wrote:
>
>>
>> Hi Stella,
>>
>> according to
>> http://dev.openlayers.org/docs/files/OpenLayers/Control/WMSGetFeatureInfo-js.htmlthe WMSGetFeatureInfo control's constructor takes an array of
>> OpenLayers.Layer.WMS objects. But you give it the list you used to draw as
>> one layer. So you should create two OpenLayers.Layer.WMS objects, one for
>> layer "Test1" and one for "Test2" and then give the control an array of
>> them.
>> So if I'm correct it should look something like that:
>>
>> var _test1 = new OpenLayers.Layer.WMS(
>>                   "MyLayer 1",
>>                   _mapfilex,
>>                   {
>>                    layers: [ 'Test1'],
>>                    format: "image/png",
>>                    transparent: "true"
>>                   },
>>                   {
>>                    isBaseLayer: false,
>>                    buffer: 0,
>>                    visibility: true
>>                   }
>>                 );
>> var _test2 = new OpenLayers.Layer.WMS(
>>                   "MyLayer 2",
>>                   _mapfilex,
>>                   {
>>                    layers: [ 'Test2'],
>>                    format: "image/png",
>>                    transparent: "true"
>>                   },
>>                   {
>>                    isBaseLayer: false,
>>                    buffer: 0,
>>                    visibility: true
>>                   }
>>                 );
>> var infoCtl = new OpenLayers.Control.WMSGetFeatureInfo({
>>                      layers: Array(_test1, _test2),
>>                      title: 'Click on the map to get information on
>> layers',
>>                      queryVisible: true,
>>                      infoFormat: 'text/html'
>>                  });
>> infoCtl.events.register("getfeatureinfo",map,showInfo);
>>
>> function showInfo(evt) {
>>  alert(evt.text);
>> }
>>
>> Also I don't know how MapServer handles queries to two or more layers if
>> at least one of them declares header or footer - it might happen that a
>> layer without a header is processed before one with. And from what you got
>> back I suggest that MapServer processes each layer if it was queried alone
>> and therefore outputs the HTTP "Content-type" header after processing the
>> first layer.
>>
>>
>> Mit freundlichen Grüßen,
>>
>> Andreas Eichner
>>  _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100127/11fb863a/attachment.html


More information about the mapserver-users mailing list