PaackEng/elm-google-maps/1.0.0

NOTE: the latest version is 2.5.0

GoogleMaps.Marker

This module allows you to create markers to be used along with GoogleMaps.Map

import GoogleMaps.Map as Map
import GoogleMaps.Marker as Marker


myMarker : Html Msg
myMarker =
    Marker.init -3.7344654 -38.5057405
        |> Marker.onClick MyClickMsg


mapView : String -> Html Msg
mapView apiKey =
    Map.init apiKey
        |> Map.withMarkers [ myMarker ]
        |> Map.toHtml
type Marker msg
type alias Latitude =
Float
type alias Longitude =
Float
init : Latitude -> Longitude -> Marker msg

It requires the latitude and longitude(both are floats)

Modifiers

withIcon : String -> Marker msg -> Marker msg

Sets a custom image to the marker

make the marker draggable

Events

onClick : msg -> Marker msg -> Marker msg

Sets a click event handler

Don't use this :o

toHtml : Marker msg -> Html msg

You should not use this function, GoogleMaps.Map uses it in order to render the marker.