YV,
The clicked feature ID or column values cannot be got from the argument "e". You can get the selected marker by the following script, its id equals to feature’s id. We can’t get the columnValue only with script as that will transfer too much data to the client side, you can use callback to get it if you want.
var selectedMarker = null;
var olMap;
function markerClick(e)
{
var iconId = e.srcElement.parentNode.id;
for (var i = 0; i < this.markers.length; i++) {
if (this.markers[i].icon.imageDiv.id == iconId) {
selectedMarker = this.markers[i];
}
}
}
function OnMapCreated(map) {
olMap = map;
var markerOverlay = olMap.getLayer("Markers");
markerOverlay.events.register('click', markerOverlay, markerClick);
}
Thanks,
Ben
444-Post5327Script.txt (665 Bytes)