[Geoprisma-dev] QueryOnClick - Highlighting WFS.fromWMSLayer

Yves Moisan yves.moisan at boreal-is.com
Fri Nov 6 09:50:12 EST 2009


New thread = "Highlighting WFS.fromWMSLayer" 

> Yves Moisan wrote:
> > Just saw something interesting on the OL list : 
> >
> > "So I have an OpenLayers map that has a WMS Layer on it, and a
> > GetFeature control that uses the WFS.fromWMSLayer Protocol in
> > conjunction with a Vector Layer to highlight a selected Feature."
> >
> > So it seems like it is possible to highlight what is selected with a
> > queryonclick highlighted in the WMS (or does that return the
> > corresponding features ?).  That would potentially make the marker issue
> > moot.  That could also probably be used in the InitialView widget.
> >
> > I'll put that in Trac when the JIRA history is shoved in.
> >
> > Yves
> >   
> 
> That could be only possible if a vector layer (of the same resource) was 
> added to the map and if the QueryOnClick widget was enhanced with a 
> "AutoResourceActivation" tool, like the Shortcut widget.  Do you see 
> what I mean ?
> 
> Unless there's a vector layer of the same resource, it would be 
> impossible to "highlight" anything with a simple getfeatureinfo request...
> 

Right.  Here's what's in /OpenLayers/Protocol/WFS.js :

"Function: OpenLayers.Protocol.WFS.fromWMSLayer 

Convenience function to create a WFS protocol from a WMS layer. This
makes the assumption that a WFS requests can be issued at the same URL
as WMS requests and that a WFS featureType exists with the same name as
the WMS layer."

If we take the service url, maybe the proxy could issue a WFS request to
the <wms> service url (e.g. MapServer in our case) and get something
back without the need to add another resource ?  I just thought the very
name "WFS.fromWMSLayer" was a hint that one could get some features from
a WMS layer.  I know better how that works now.  

Highlighting a feature after either a query for info (QueryOnClick) or
when one ends up zoomed on a feature (ShortCut, InitialView, the
deprecated QuickZoom) is really one of the most obvious things missing
in the eyes of GeoPrisma users so I figured if someone got a feature
highlighting to work on a WMS layer, that would be worth investigating.

In short, can we get a small number of features (e.g. those
corresponding to the tolerance set e.g. in the mapfile) that could be
used on a "highlight" utility layer that could be used for other things
as a "temp" layer in GeoPrisma much like for example the "Cosmetic
layer" (or whatever its name) is used in MapInfo to store transient
features/annotations, etc. ?

Yves





More information about the Geoprisma-dev mailing list