[OpenLayers-Users] drillDown: multiple requests but only first in pop-up

Giuseppe De Marco peppelinux at yahoo.it
Thu May 23 07:52:00 PDT 2013


thank you Ian,

I've just fixed this strange behaviour.
The problem was a mapquery layermanager instance; sincerely I don't know how it does the issue but dropping all mapquery code and using only a simplified jquery widget for managing layers, now, everything works great with this configuration:

<code>

$(function(){

    mapControls = {
    line: new OpenLayers.Control.Measure(OpenLayers.Handler.Path, {persist: true}),
    polygon: new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon, {persist: true}),
    pan: new OpenLayers.Control.Pan({title:"Pan"}),
    zoomin: new OpenLayers.Control.ZoomBox({title:"Zoom in box", out: false}),
    zoomout: new OpenLayers.Control.ZoomBox({title:"Zoom out box", out: true}),
        // aggiunti peppelinux
        wmsgetfeatinfo: new OpenLayers.Control.WMSGetFeatureInfo({
                            url: "http://"+ wms_hostname +"/cgi-bin/mapserv?map="+mapfile_path, 
                            title: 'Identify features by clicking',
                            drillDown: true,
                            layers: null,
                            //layers: [ corine, invasi, centri, infrastrutture, comuni, province ],
                            //layers: [ corine, invasi, centri, infrastrutture ],
                            //layers:   [ invasi ],
                            //infoFormat:'text/plain',
                            infoFormat:'text/html',
                            //infoFormat:"application/vnd.ogc.gml",
                            click: 'true',
                            queryVisible: true,
                            eventListeners: {
                                getfeatureinfo: function(event) {
                                    map.addPopup(
                                                new OpenLayers.Popup.FramedCloud
                                                (
                                                "chicken", 
                                                map.getLonLatFromPixel(event.xy),
                                                null,
                                                event.text,
                                                null,
                                                true
                                                )
                                                );},
                                
                                nogetfeatureinfo: function(event) 
                                                  {
                                                      
                                                   new OpenLayers.Popup("chicken",
                                                        new OpenLayers.LonLat(5,40),
                                                        new OpenLayers.Size(200,200),
                                                        "example popup",
                                                        true);    
                                                  }
                                
                                
                                }
                            }), // fine getfeatureinfo
    };
    
    
    for(var key in mapControls) {
control = mapControls[key];
control.events.on({
    "measure": handleMeasurements,
    "measurepartial": handleMeasurements
});
map.addControl(control);
    }


});


</code>


thank you all,
G


________________________________
 Da: Ian Turton <ijturton at gmail.com>
A: Giuseppe De Marco <peppelinux at yahoo.it> 
Cc: "openlayers-users at lists.osgeo.org" <openlayers-users at lists.osgeo.org> 
Inviato: Giovedì 23 Maggio 2013 16:39
Oggetto: Re: [OpenLayers-Users] drillDown: multiple requests but only first in pop-up
 


You need to change the QUERY_LAYERS parameter - that controls the layers that are queried.

Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130523/dc9569e9/attachment.html>


More information about the Users mailing list