Hello! How to get Lon and Lat when i clicked on feature (line)?

/selectControl = new OpenLayers.Control.SelectFeature(lineLayer,
             {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});
drawControls = {
                point: new OpenLayers.Control.DrawFeature(lineLayer,
                            OpenLayers.Handler.Point),
                select: selectControl
            };
for(var key in drawControls) {
            map.addControl(drawControls[key]);
    }
function onPopupClose(evt) {
                selectControl.unselect(selectedFeature);
            }
            function onFeatureSelect(feature) {
                selectedFeature = feature;
                id = feature.id;
                popup = new OpenLayers.Popup.FramedCloud("chicken",
feature.geometry.getBounds().getCenterLonLat(), //need to get the lon and lat, where I clicked
                                        null,
"<div style='font-size:.8em'>" +CableLineText_arr[id] +"</div>",
                                        null, true, onPopupClose);
                feature.popup = popup;
                map.addPopup(popup);
            }
            function onFeatureUnselect(feature) {
                map.removePopup(feature.popup);
                feature.popup.destroy();
                feature.popup = null;
            }/
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to