I have KML layer with multiple tracks and I would like to highlight them individually on mouse hover. I tried to implement this like in the example found in OpenLayers examples, but couldn't get it work.
In the example there is following code that adds polygon as feature. In my case, how do I add KML-tracks as feature so that I can highlight them with SelectFeature?
var feature = new OpenLayers.Feature.Vector(
OpenLayers.Geometry.fromWKT(
"POLYGON((28.828125 0.3515625, 132.1875 -13.0078125, -1.40625 -59.4140625, 28.828125 0.3515625))"
)
);
vectors.addFeatures([feature]);
You can find simplified version of my index.html and KML file here: https://gist.github.com/1379118