Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.
roadidPicker = new OpenLayers.Control.WMSGetFeatureInfo({
                url: 'http://www.domainname.com:8080/geoserver/wms', 
                title: 'identify features on click',
                layers: [wms],
                queryVisible: true
            });
roadidPicker.infoFormat = 'application/vnd.ogc.gml';
roadidPicker.events.register("getfeatureinfo", this, pickRoadid);
map.addControl(roadidPicker);
roadidPicker.activate();

function pickRoadid(e) {
  if (e.features && e.features.length) {
     var val = e.features[0].attributes.id;
     document.getElementById('roadId').value = val;
  }
}

I used this code for fetching values from dbf file. I got 0 value for e.features.length.So i can't display information on map using onclick event.

share|improve this question
Have you looked at the data in firebug? – Devdatta Tengshe Apr 18 at 8:03
Welcome to SE-GIS @Ankita. Would you be able to re-phrase your question and title so that they include Question Marks to make what you are asking clearer and avoid it being prematurely closed, please? I find the best form to use is along the lines of: "I did this", "What I expected to see was this", "But what I observed was this". – PolyGeo Apr 18 at 8:03

closed as not a real question by iant, Get Spatial, R.K., Fezter, Aragon Apr 18 at 13:50

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.