First post so bear with me.
I have a google map that displays polylines.
I create the polylines using the following method:
function createPoly(number,path, color, name) {
var g = google.maps;
var poly = new g.Polyline({
path: path,
strokeColor: color,
strokeOpacity: 1,
strokeWeight: 3
});
var label = new Label({ map: map }, poly);
// Add mouse events to poly
g.event.addListener(poly, "mouseover", function() {
label.add_(name);
poly.setOptions({strokeWeight: 6.0,strokeColor: "#0000FF",});
});
g.event.addListener(poly, "mouseout", function() {
label.remove_();
poly.setOptions({strokeWeight: 3.0,strokeColor: "#FF0000",});
});
g.event.addListener(poly, "click", function() {
$('.LORDesc').empty();
$('.LORDesc').append(name);
});
poly.setMap(map);
return poly;
}
The above code works, and every time I want to create a poly on my map I use:
var MyPoly = createPoly(0,SC001, "#FF0000", "SC001 <BR>Poly 1");
which works fine also.
My problem is I want to create Links to the side of my map and allow the user to hover over the link and have the poly change weight and color. Like it does when the user hovers over the poly on the map. Basically to identify the poly as they hover over the links.
I hope this makes sense.
Any help would be appreciated. I have tried various techniques on my own but have failed.
Regards,
Jonny