On Jul 3, 3:10 am, CSharp <
aliquis.igno...@gmail.com> wrote:
> I've found out why the event works but doesn't show the stroke color
> when there is a mouse over on the polyline. Here's the code that
> works:
>
> google.maps.event.addListener(currentPolyline, "mouseover",
> function(){ currentPolyline.setOptions({strokeColor:
> hilitedLineColor, strokeOpacity: .8});});
>
> google.maps.event.addListener(currentPolyline, "mouseout",
> function(){ currentPolyline.setOptions({strokeColor:
> originalPolylineColor, strokeOpacity: originalPolylineOpacity});});
>
> What's different is that the polyline's options are set with the
> setOption() method (by accessing the JSON properties within the
> polyline) rather than setting the attributes directly. This is rather
> inconsistent with the Marker objects in which you can access the
> properties of the marker object directly.
>
with Marker there's a full range of set() and get() methods for each
property, but are you using those methods like getFlat() and setFlat()
or accessing them directly like marker.flat?
The doco doesn't specify any properties for Marker, even though on
inspection in Firebug you can see properties like title, map, position
and visible. If they aren't documented then a future version of the
API might hide these properties.
for PolyLine you could also use the MVCObject methods for set() and
get() like this:
currentPolyline.set('strokeColor', hilitedLineColor);
currentPolyline.set('strokeOpacity', 0.8);