[OpenLayers-Users] Query problem
Aypes2
apestgas2 at yahoo.com.hk
Mon Nov 16 20:59:52 EST 2009
Arnd Wippermann wrote:
>
> Hi,
>
> It seems, that your loop creates the window for your first queryable layer
> and then the queryresult of your next queryable layers use the same window
> and overwrite the contents of the window "getfeatureinfo". The last wins.
>
> If you change the window name to "getfeatureinfo" + i, then you should get
> one window for every query.
>
> A second approach is to collect the visibible layers and do only one
> getfeatureinfo request with this layerlist. Then you get back from
> MapServer
> one result html for all the queried layers.
>
> Arnd
>
> -----Ursprüngliche Nachricht-----
> Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
> Auftrag von Aypes2
> Gesendet: Freitag, 13. November 2009 08:24
> An: users at openlayers.org
> Betreff: [OpenLayers-Users] Query problem
>
>
Hi,
Sorry for late reply. I have done what you said with "getfeatureinfo" + i,
when I click each time, there are one window for each query.
But how can I open 1 window only when querying? I have 6 layers, and if I
turn on 6 layers, 6 windows come out when clicking on the map. Only 1
windows contains information but others are useless ("EMPTY" template in
MapServer). I want the required window comes out only and the "EMPTY"
template comes out when clicked coordinates have nothing.
I think I should write some more 'if' statements to make it work, but I have
no idea about how to do this. I tried to compare the layer's
coordinates/pixels with e.xy.x and e.xy.y, so window comes out only when
they are same. But it fails, maybe I get the layer's coordinates wrongly. I
also tried to make mslayers[i] in ("&QUERY_LAYERS=" + mslayers[i]) in which
window comes out when mslayers[i] is not empty template, but fails too.
I got your second approach idea. But is that using WMSfeaturegetinfo or my
method? And it sounds like giving all queryable layers' information within
one window only, right?
Thanks
Aypes2
--
View this message in context: http://n2.nabble.com/Query-problem-tp3997793p4016028.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list