smas1 / geoext-viewer

Automatically exported from code.google.com/p/geoext-viewer
GNU General Public License v3.0
0 stars 0 forks source link

featureinfo only for a subset of layers #373

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
1. "In order to be able to limit the queryable layers for featureinfo requests, 
it would be nice if there would be a parameter where one could set the array of 
layers. It would also be nice it this parameter could be set anytime, so a 
method is also desirable.
2. "Developers only need to configure the 'featureinfo' toolbar item, like 
this: queryOnlyLayers: [<openlayers layer objects array>]. If someone later 
wants to modify the layers, a new method is needed: 
setQueryOnlyLayers([<openlayers layer objects array>]).
3. "A new attribute (queryOnlyLayers) and a new method (setQueryOnlyLayers) is 
needed.

Original issue reported on code.google.com by fegyi...@gmail.com on 10 May 2014 at 8:30

GoogleCodeExporter commented 9 years ago
Hi - you can make a layer not-queryable by simply not declaring the 
featureInfoFormat for that layer I believe.

So:
    //polygon
    new OpenLayers.Layer.WMS(
        "MasterMap - Traditional Style",
        Heron.WCC.InternalUrls.geoserver_ows,
        {layers: "OS_MasterMap_Group_Traditional_Style", transparent: true, format: 'image/png8'},
        {singleTile: false, visibility: false, attribution: OS_attribution, maxResolution: this_scale(5000)}
    ),

rather than

    //line
    new OpenLayers.Layer.WMS(
        "MasterMap - BoundaryLine",
        Heron.WCC.InternalUrls.geoserver_ows,
        {layers: "OS_MM_BOUNDARYLINE", transparent: true, format: 'image/png8', styles:'OSMM BoundaryLine - 75000 Threshold'},
        {singleTile: true, visibility: false, attribution: OS_attribution, featureInfoFormat: 'application/vnd.ogc.gml', maxResolution: this_scale(75000)}
    ),

Does that do what you want?

Original comment by jonathan...@warwickshire.gov.uk on 12 May 2014 at 12:37

GoogleCodeExporter commented 9 years ago
Ah sorry, I don't don't know about that as I have no vector layers in my 
projects.

Original comment by jonathan...@warwickshire.gov.uk on 12 May 2014 at 2:19

GoogleCodeExporter commented 9 years ago
Yes, that is right: Vector Layers are now always queried, although those 
queries mainly will assemble vector objects already on the client. As GXP was 
using a generic custom Layer parameter 'queryable: false|true', default true, 
this is already supported within Heron for WMS Layers, but not yet Vector 
Layers, but this is a small additional check.

But overall I can see the use of just having a small dedicated set (array) of 
Layers that need to be queried with methods to alter that set dynamically. I 
guess the array could contain Layer Names or Layer objects. 

One question: is it interesting that Layers can be queried in those cases, even 
if non-visible? This would allow a more, 'Google-style' basemap in which one 
could click or hover without having to show all objects in the layer already.

Original comment by jus...@gmail.com on 21 May 2014 at 6:43

GoogleCodeExporter commented 9 years ago
In my case only those layers should be queried that are visible. That could
also be another option if someone wants to query all layers regardless of
visibility. For example queryOnlyVisibleLayers: true/false.

2014-05-21 8:43 GMT+02:00 <geoext-viewer@googlecode.com>:

Original comment by fegyi...@gmail.com on 21 May 2014 at 6:50

GoogleCodeExporter commented 9 years ago
You can set a layer to be "invisible" with an SLD while still being "visible" 
within Heron/OpenLayers. This way it can be queried. I do this for a meta-data 
layer in one of my apps.

Original comment by jonathan...@warwickshire.gov.uk on 21 May 2014 at 9:25