[OpenLayers-Users] how to query wms, like wfs?

Phil Scadden p.scadden at gns.cri.nz
Mon Feb 24 15:53:48 PST 2014


> i got a line (via wfs) over a polygon (via wms). when a user clicks on
> the line, i want just the wfs to return. when the user clicks on the
> polygon, i want just the wms to return. right now, when a user clicks
> on the line, both return.
>
> the two functions:
> 1. function fwfs(feature){	... }
> 2. function fwms(evt){ ... }
>
> the two triggers:
> 1. ...callbacks: { 'click' : fwfs }...
> 2. ...query[i].events.register('getfeatureinfo', this, fwms);...
>
Problematic. One way is to have the concept of an active layer so that 
only that layer gets the query. (which is what I do - especially for 
hover events). Even if you use the method of aborting the WMS call or 
swallowing the response, what happens if the WMS post returns first 
despite clicking on the line? I guess with your design, the line data is 
all in local memory? Another approach would be to chain the events - 
fire the WMS if the WFS returns empty response.


Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.



More information about the Users mailing list