Skip to main content
added 125 characters in body
Source Link

A pretty easy way is to use hue-rotate filter:

https://developer.mozilla.org/fr/docs/Web/CSS/filter-function/hue-rotate()

With this, you can call marker._icon.style.webkitFilter = "hue-rotate(xdeg)"

var random_value = Math.floor(Math.random() * 360);
marker._icon.style.webkitFilter = "hue-rotate(" + parseString(random_value) + "deg)"; 

where xrandom_value is a number between 0 and 360.

It will apply a color depending on this value.

A pretty easy way is to use hue-rotate filter:

https://developer.mozilla.org/fr/docs/Web/CSS/filter-function/hue-rotate()

With this, you can call marker._icon.style.webkitFilter = "hue-rotate(xdeg)" where x is a number between 0 and 360.

It will apply a color depending on this value.

A pretty easy way is to use hue-rotate filter:

https://developer.mozilla.org/fr/docs/Web/CSS/filter-function/hue-rotate()

With this, you can call

var random_value = Math.floor(Math.random() * 360);
marker._icon.style.webkitFilter = "hue-rotate(" + parseString(random_value) + "deg)"; 

where random_value is a number between 0 and 360.

It will apply a color depending on this value.

Source Link

A pretty easy way is to use hue-rotate filter:

https://developer.mozilla.org/fr/docs/Web/CSS/filter-function/hue-rotate()

With this, you can call marker._icon.style.webkitFilter = "hue-rotate(xdeg)" where x is a number between 0 and 360.

It will apply a color depending on this value.