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

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -