An Elm library for interactive maps, originally developed by kennib and further modified by 4onen.
This library allows you to embed interactive, tile-based maps into your Elm applications with support for markers and now also polygonal areas, as well as various options to customize the map's behavior.
A simple map can be created like this:
import Browser
import Maps
main : Program () (Maps.Model msg) (Maps.Msg msg)
main =
Browser.element
{ init = \_ -> ( Maps.defaultModel, Cmd.none )
, update = Maps.update
, view = Maps.view
, subscriptions = Maps.subscriptions
}Below are working examples showcasing the different features of the library:
| Example | Source Code | Live Demo |
|---|---|---|
| Basic Map | Example.elm | Live |
| Fullscreen Map | Fullscreen.elm | Live |
| Map Markers | Markers.elm | Live |
| Custom Markers | CustomMarkers.elm | Live |
| Geocode Search | Search.elm | Live |
| Geocode + Markers | SearchMarkers.elm | Live |
| Draw Areas | Areas.elm | - |
| Options | Options.elm | - |
You can find full documentation of the latest API on the Elm package site.