[OpenLayers-Users] RE Selected attributes in Pop up
adityakumar529
adityakumar529 at gmail.com
Sat May 4 01:52:51 PDT 2013
I resolved the problem.
Following is the code which I used.
var roadidPicker = new OpenLayers.Control.WMSGetFeatureInfo({
url:
'http://localhost/ArcGIS/services/CivicAgency_15_11_11/MapServer/WMSServer',
title: 'identify features on click',
//layers: [BDA],
queryVisible: true,
});
roadidPicker.infoFormat = 'application/vnd.ogc.gml';
roadidPicker.events.register("getfeatureinfo", this, pickRoadid);
map.addControl(roadidPicker);
roadidPicker.activate();
function pickRoadid(event) {
map.addPopup(new OpenLayers.Popup.FramedCloud(
"chicken",
map.getLonLatFromPixel(event.xy),
null,
"<div style='font-size:.8em; font-weight: bold'>"
+event.features[0].attributes.Local_Unit+
"Ward No:" +event.features[0].attributes.Address+
"</div>",
null,
true
));
}
Aditya kumar
-----
GIS Developer
India Urban Space Foundation
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Selected-attributes-in-Pop-up-tp5051001p5051290.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list