chrispump/elm-maps-extra/1.0.0

NOTE: the latest version is 2.0.0

Maps.Area

Work with rectangular map areas (polygons) defined by two corners and an optional rotation.

This module provides a simplified interface for creating and using rectangular areas on a map. It wraps the internal polygon logic and exposes a clean public API.

Types

type alias Area =
Area

Represents a rectangular polygonal area on the map. This type is opaque and should be created using the create function.

Create

create : LatLng -> LatLng -> Float -> Area

Create a rectangular area from a top-left and bottom-right coordinate, with a rotation in degrees (clockwise, around the center of the rectangle).

import Maps.Area
import Maps.Geo exposing (latLng)


myArea =
    Maps.Area.create
        (latLng 52.52 13.38)
        -- top-left
        (latLng 52.51 13.39)
        -- bottom-right
        30


-- rotation in degrees