This module allows you to create polygons to be used along with GoogleMaps.Map
import GoogleMaps.Map as Map
import GoogleMaps.Polygon as Polygon
myPolygon : Polygon.Polygon Msg
myPolygon =
Polygon.init
[ ( -3.7344654, -38.5057405 )
, ( -3.7366108, -38.5188557 )
, ( -3.7374002, -38.5195225 )
, ( -3.7474947, -38.5153675 )
]
|> Polygon.withStrokeColor "red"
|> Polygon.withFillColor "orange"
|> Polygon.withFillOpacity 0.25
|> Polygon.onClick OnMarkerClicked
|> Polygon.withClosedMode
mapView : String -> Html Msg
mapView apiKey =
Map.init apiKey
|> Map.withPolygons [ myPolygon ]
|> Map.toHtmlIt forces the polygon to be a closed shape
There is no default color
this function accepts the same formats as the CSS color values
E.g "rbg(255,255,0)", "orange" or "#ff00ff"
The default is 0
The default is black
this function accepts the same formats as the CSS color values
E.g "rbg(255,255,0)", "orange" or "#ff00ff"
The default is 3