Polyline Set color option for Google Api V2 getting error ?? C# Web App
i am getting error on the line to set polyline color option my code,
GEvent.addListener(polyline, "click", function() {polyline.setOptions(options: { strokeColor: 'blue' })};
but if i try this,
GEvent.addListener(polyline, "click", function() {alert("clicked");});
it works fine
How to set polyline color on click ?? 开发者_JS百科
i also try this,
GEvent.addListener(polyline, "click", function() {PolylineOptions({ strokeStyle: new StrokeStyle({color: 0xFF0000})});
it is also resulting in error HOPES for your reply...
It looks like you're mixing up the Maps API V3 and Maps API V2 syntax.
- Maps API V2 uses setStrokeStyle not setOptions to change Polyline options
- Maps API V2 uses hex color codes (rather than 'blue' etc)
The following should work.
GEvent.addListener(polyline, "click", function() {
polyline.setStrokeStyle({ color: "#FF0000" });
};
精彩评论