zoomed out view is wms and zoomed in is wfs

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

zoomed out view is wms and zoomed in is wfs

sdunne
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
Reply | Threaded
Open this post in threaded view
|

Re: zoomed out view is wms and zoomed in is wfs

Paul Meems (Top-X)
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 <[hidden email]>
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
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users


_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: zoomed out view is wms and zoomed in is wfs

Phil Scadden
In reply to this post by sdunne
Hi Steve, I wonder why you want to make the transition from WMS to WFS?
My strategy is use WMS for display on map, and use WFS for queries.
http://osgeo-org.1560.n6.nabble.com/Select-WFS-Features-using-intersect-of-polygon-td4467419.html#a4470543 
has example of WFS query. This uses a wfsProtocol object. The
fromWMSLayer is just easy way to create this protocol when you are using
wms for display.

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.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: zoomed out view is wms and zoomed in is wfs

sdunne
In reply to this post by Paul Meems (Top-X)
Paul Meems (Top-X) wrote
Create two layers, the WMS version and the WFS version and use maxscale and
minscale to set when which layer should be visible.
Thanks Paul, with this appraoch, in the layer selector, would this be viewed as 2 different layers.
For example, when I reached a certian zoom level, the layer selector would visually change from the wms to the wfs of the same name, being selected?
Or would only one layer be visible in the layer selector, and the functionality would be performed without the user knowing that the layer had changed ?


Reply | Threaded
Open this post in threaded view
|

Re: zoomed out view is wms and zoomed in is wfs

Paul Meems (Top-X)
You will get two layers. One of them is grayed-out depending on the scale.
Using grouped layers you can avoid this, but that only works if all layers are WMS

--
Paul


2012/5/17 sdunne <[hidden email]>

Paul Meems (Top-X) wrote
>
> Create two layers, the WMS version and the WFS version and use maxscale
> and
> minscale to set when which layer should be visible.
>

Thanks Paul, with this appraoch, in the layer selector, would this be viewed
as 2 different layers.
For example, when I reached a certian zoom level, the layer selector would
visually change from the wms to the wfs of the same name, being selected?
Or would only one layer be visible in the layer selector, and the
functionality would be performed without the user knowing that the layer had
changed ?




--
View this message in context: http://osgeo-org.1560.n6.nabble.com/zoomed-out-view-is-wms-and-zoomed-in-is-wfs-tp4974909p4975241.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users


_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: zoomed out view is wms and zoomed in is wfs

Jesse V. Griffis
In reply to this post by Phil Scadden
One reason, for us anyway: In modern browsers retrieving the features once
makes display much quicker than making network requests all the time for
png/jpg imagery - particularly with many layers / tiles.

Unfortunately "modern browsers" doesn't include IE8......

Jesse

On Thursday, May 17, 2012 09:29:44 AM Phil Scadden wrote:

> Hi Steve, I wonder why you want to make the transition from WMS to WFS?
> My strategy is use WMS for display on map, and use WFS for queries.
> http://osgeo-org.1560.n6.nabble.com/Select-WFS-Features-using-intersect-of-p
> olygon-td4467419.html#a4470543 has example of WFS query. This uses a
> wfsProtocol object. The
> fromWMSLayer is just easy way to create this protocol when you are using
> wms for display.
>
> 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.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users


_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: zoomed out view is wms and zoomed in is wfs

Phil Scadden

> One reason, for us anyway: In modern browsers retrieving the features once
> makes display much quicker than making network requests all the time for
> png/jpg imagery - particularly with many layers / tiles.
>
> Unfortunately "modern browsers" doesn't include IE8......
Well, this is only true when the total feature count is below a certain
critical level. Downloading a mass of vector geometry is slow even on
latest Chrome.
Even point layers have a limit but it is especially problematic for
dense line topographies.

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.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users