[OpenLayers-Users] WMTSGetFeatureInfo on a Geoserver “Layer Group”

RD Harles rdh at adci.com
Mon Mar 18 08:56:51 PDT 2013


Hi,
I’m attempting to execute OpenLayers.Control.WMTSGetFeatureInfo on a Geoserver “Layer Group”.
It gives me a popup with information from ONLY one layer in the layer group.  Is it possible to get information from all layers in the group?
I thought setting “drillDown = true” would take care of it, but it doesn’t seem to work.
Any thoughts would be appreciated!
Thanks!
R.D.  Harles



    format = new OpenLayers.Format.WMTSCapabilities({
                yx: {
                     "urn:ogc:def:crs:EPSG::4326": true
                    }
            });
            // Base Layer
            OpenLayers.Request.GET({
            url: "http://localhost:8080/geoserver/gwc/service/wmts",
    params: {
        SERVICE: "WMTS",
        VERSION: "1.0.0",
        REQUEST: "GetCapabilities"
    },
            success: function(request) {
                var doc = request.responseXML;
                if (!doc || !doc.documentElement) {
                    doc = request.responseText;
                }
                var capabilities = format.read(doc);
                var mainlayer = format.createLayer(capabilities, {
                    layer: "AllLayers",
                    matrixSet: "EPSG:4326",
                    //srs: 'EPSG:4326',
                    //matrixIds: matrixIds,
                    format: "image/png",
                    //wrapDateLine: false,
                    opacity: 0.7,
                    isBaseLayer: true,
                    tilesOrigin: map.maxExtent.left+','+map.maxExtent.bottom,
                    displayInLayerSwitcher: true
                        });
                map.addLayer(mainlayer);
                map.zoomToMaxExtent();
            },
            failure: function() {
                alert("Trouble getting capabilities doc");
                    OpenLayers.Console.error.apply(OpenLayers.Console, arguments);
                }
            });

    info = new OpenLayers.Control.WMTSGetFeatureInfo({
        url: 'http://localhost:8080/geoserver/wmts',
        layerUrls: 'http://localhost:8080/geoserver/gwc/service/wmts',
        title: 'Identify features by clicking',
        queryVisible: true,
        drillDown: true,
        eventListeners: {
            getfeatureinfo: function(event) {
                map.addPopup(new OpenLayers.Popup.FramedCloud(
                    "popup",
                    map.getLonLatFromPixel(event.xy),
                    null,
                    event.text,
                    null,
                    true
                ));
            }
        }
    });
    map.addControl(info);
    info.activate();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130318/17698c87/attachment-0001.html>


More information about the Users mailing list