<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello! How to get Lon and Lat when i clicked on feature (line)?<br>
<br>
<i>selectControl = new OpenLayers.Control.SelectFeature(lineLayer,<br>
{onSelect: onFeatureSelect, onUnselect:
onFeatureUnselect});<br>
drawControls = {<br>
point: new
OpenLayers.Control.DrawFeature(lineLayer,<br>
OpenLayers.Handler.Point),<br>
select: selectControl<br>
};<br>
for(var key in drawControls) {<br>
map.addControl(drawControls[key]);<br>
}<br>
function onPopupClose(evt) {<br>
selectControl.unselect(selectedFeature);<br>
}<br>
function onFeatureSelect(feature) { <br>
selectedFeature = feature;<br>
id = feature.id;<br>
popup = new
OpenLayers.Popup.FramedCloud("chicken", <br>
feature.geometry.getBounds().getCenterLonLat(), //<span
id="result_box" class="" lang="en"><span class="hps">need to get
the</span> <span class="hps">lon and lat</span><span class="">,
where</span> <span class="hps">I clicked</span></span><br>
null,<br>
"<div
style='font-size:.8em'>" +CableLineText_arr[id]
+"</div>",<br>
null, true, onPopupClose);<br>
feature.popup = popup;<br>
map.addPopup(popup);<br>
}<br>
function onFeatureUnselect(feature) {<br>
map.removePopup(feature.popup);<br>
feature.popup.destroy();<br>
feature.popup = null;<br>
}</i><br>
</body>
</html>