[GIS] Openlayers: How to highlight a point on mouse over a line

javascriptopenlayers-2openstreetmap

Any suggestions on how to highlight a point on mouse over a line, I've read points from a javascript array, lines are drawn by using them and I want to highlight some points in that array by moving the mouse pointer through the line and near to that point. However, i'm stuck on actually how to get started with this.
This image contains the lines:

Any guidance and help is appreciated..!

Best Answer

use OpenLayers.Control.SelectFeature with hover:

        var make_hover= function(e) {
            console.log(e.feature.id);
            vector.features[x].style.fillColor = "#00b4ff"; //Your Point
            vectorLayer.redraw();
        };

        var highlightCtrl = new OpenLayers.Control.SelectFeature(vectorLayer, {
            hover: true,
            highlightOnly: true,               
            eventListeners: {
                beforefeaturehighlighted: another_Function,
                featurehighlighted: make_hover,
                featureunhighlighted: another_Function
            }
        });

i hope it helps you....