Google-maps-react: How do I make a polygon?

Created on 13 Jul 2020  路  1Comment  路  Source: fullstackreact/google-maps-react

I am currently trying to make a polygon so that I can shape it as the cities in my island. I do not see how I can implement the polygons. If there is no current way to implement them will there be one in the near future?

Most helpful comment

triangleCoords should be your island position
import {Polygon} from 'google-maps-react'

`
const triangleCoords = {
{ lat: 41.2935, lng: 69.2401}
{ lat: 41.2935, lng: 69.2401}
{ lat: 41.2935, lng: 69.2401}
}

 <Polygon
     paths={triangleCoords}
      strokeColor="#0000FF"
      strokeOpacity={0.8}
      strokeWeight={1}
      fillColor="#0000FF"
      fillOpacity={0.2} />

`

>All comments

triangleCoords should be your island position
import {Polygon} from 'google-maps-react'

`
const triangleCoords = {
{ lat: 41.2935, lng: 69.2401}
{ lat: 41.2935, lng: 69.2401}
{ lat: 41.2935, lng: 69.2401}
}

 <Polygon
     paths={triangleCoords}
      strokeColor="#0000FF"
      strokeOpacity={0.8}
      strokeWeight={1}
      fillColor="#0000FF"
      fillOpacity={0.2} />

`

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samirbraga picture samirbraga  路  3Comments

EmmaU25 picture EmmaU25  路  3Comments

ktosiek picture ktosiek  路  3Comments

mruoss picture mruoss  路  5Comments

lishi500 picture lishi500  路  4Comments