[OpenLayers-Users] zoomed out view is wms and zoomed in is wfs

Paul Meems (Top-X) p.meems at topx-group.nl
Wed May 16 00:39:59 PDT 2012


Hi Steve,

I'm new to OL as well, but I would handle your situation like this:
Create two layers, the WMS version and the WFS version and use maxscale and
minscale to set when which layer should be visible.

BTW you can click on a WMS-object and create a WFS-object on the fly to
show you've selected it and show it's details.
First create a Vector layer and add the WMSGetFeatureInfo control:

var info = new OpenLayers.Control.WMSGetFeatureInfo({   url: 'your
URL',   title: 'Identify features by clicking',  queryVisible: true,
layers: [your layers],  infoFormat: 'application/vnd.ogc.gml',
eventListeners: {       getfeatureinfo: function(event) {
var myFeature = event.features[0];
selectedFeatureLayer.addFeatures(myFeature);
selectedFeatureLayer.redraw();           var popup = new
OpenLayers.Popup.FramedCloud(              "chicken",
map.getLonLatFromPixel(event.xy),              null,
genPopText(myFeature),              null,              true,
   onPopupClose          );           myFeature.popup = popup;
 popup.feature = myFeature;          map.addPopup(popup);      }
}});


I hope it helps.

Paul Meems
--
Project manager Open Source GIS Conference 2012
http://www.mapwindow.org/conference/2012/




2012/5/16 sdunne <stephen.dunne at lisasoft.com>

> Hi everybody on the OL list.
> I am Steve and I work at LISAsoft in Sydney. Im quite new to OpenLayers,
> but
> am enjoying working in the environment.
>
> Sometimes I read things in the API and don't exactly understand the
> definitions. So I am trying to figure out if this is a posibility.
>
> Basically I have been asked to find out if an application can be created
> that uses a wms for higher levels, therefore limiting the amount of time
> for
> load, then as the user zooms in, the layers change to wfs layers therefore
> allowing features to be clicked and data returned.
>
> I understand there is a function openlayers.protocol.wfs.fromWMSLayer. I am
> a bit confused as to how it works, or even if it is what I am looking for.
>
> Will this functionality, (or is it possible) have a smooth transition from
> wms to wfs as a user zooms in?
>
> Thanks
> Steve
>
> --
> View this message in context:
> http://osgeo-org.1560.n6.nabble.com/zoomed-out-view-is-wms-and-zoomed-in-is-wfs-tp4974909.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120516/75308fcf/attachment.html


More information about the Users mailing list