Global

Methods


generateRandomColor()

Generates a random color by randomly generating an hexadecimal string.
Source:
See:
Returns:
A random hexadecimal string representing a color.
Type
string
Example
const randomColor = generateRandomColor();
 console.log(randomColor);

 new google.maps.Polygon({
     paths: coords,              //your polygon coordinates
     strokeColor: randomColor,
     strokeOpacity: 0.8,
     strokeWeight: 2,
     fillColor: randomColor,
     fillOpacity: 0.35,
     map: myMap                  //your google map
 });