2

I built a map made of several layers. 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 click 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;
                }
               }
            });
  • I'm having a similar issue with bounding boxes that extend past the international dateline. – gnarbarian Feb 19 '16 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.