[OpenLayers-Users] WMSGetFeatureInfo does not return feature beyond wrapdateline

Bruno Combal bruno.combal at gmail.com
Tue Feb 4 09:03:27 PST 2014


I've built a map made of several layers, each layer being served by
geoserver..

I need to display the layers features fields at the place where the user
clicks (see the controler code hereafter). The layers are correctly
displayed and go across the dateline. If the user clicks on a feature, its
fields values are written in a div. However, if I click on a feature beyond
the dateline, my controler returns nothing! How can I force it (or force
geoserver?) to consider clicks beyond the dateline?


[...]
var options = {minResolution:minResolution, maxResolution:maxResolution,
        controls:[new OpenLayers.Control.PanZoom(), new
OpenLayers.Control.NavToolbar(), layersSwitcher, graticule]};
var map = new OpenLayers.Map("map-id", options);
[...]

var map = new OpenLayers.Map("map-id", options);

var infoGnrl = new OpenLayers.Control.WMSGetFeatureInfo({
               url:'http://mysite.org/geoserver/ocean/wms',
               title:'identify feature by clicking',
               output:'features', infoFormat:'application/vnd.ogc.gml',
               format: new OpenLayers.Format.GML,
               eventListeners: {
                getfeatureinfo: function(event) {
                    eezName='';
                    lmeName='';
                    if
(typeof(event.features[0])=='undefined'){document.getElementById('infoGeneral').innerHTML=' ';
return};
                    for (ii=0; ii< event.features.length; ii++){
                        thisEEZNAME=event.features[ii].attributes['eez'];

thisLMENAME=event.features[ii].attributes['LME_NAME'];
                        if (typeof(thisEEZNAME)!='undefined') {if
(eezName=='') {eezName=thisEEZNAME} else {eezName+=', '+thisEEZNAME}};
                        if (typeof(thisLMENAME)!='undefined') {if
(eezName=='') {eezName=thisEEZNAME} else {lmeName+=', '+thisLMENAME}};
                    }
                  document.getElementById('infoGeneral').innerHTML=eezName;
                }
               }
            });



best
Bruno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20140204/df95df98/attachment.html>


More information about the Users mailing list