Change polygon fillColor with javascript (google maps) -
i'm trying change google maps polygon fillcolor on click. here code => https://jsfiddle.net/nw6j52f6/
Аnd here problem part of code. function should change design of polygons:
function polyopt(i) { setoptions({ strokecolor: '#ff0000', strokeopacity: 0.8, strokeweight: 3, fillcolor: '#ff0000', fillopacity: 0.35 }); }
but console return error:
map-array.html:56 uncaught referenceerror: setoptions not defined @ polyopt (map-array.html:56) @ htmlinputelement.onclick (map-array.html:69)
i'm using google maps api https://developers.google.com/maps/documentation/javascript/reference#polygonoptions
but don't understand why console show error.
if polygon i
must use i.setoptions
function polyopt(i) { i.setoptions({ strokecolor: '#ff0000', strokeopacity: 0.8, strokeweight: 3, fillcolor: '#ff0000', fillopacity: 0.35 });
Comments
Post a Comment