PaackEng / elm-google-maps / 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 : Marker 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 alias Marker msg =
Internals.Marker.Marker msg

Opaque type that upholds the marker description.


type alias Latitude =
Basics.Float

This type is latitude in float format as expected by Google Maps.


type alias Longitude =
Basics.Float

This type is longitude in float format as expected by Google Maps.

init : Latitude -> Longitude -> Marker msg

It requires the latitude and longitude (both are floats)


type Animation

This type wraps the available animations for markers in Google Maps, "DROP" or "BOUNCE" or nothing.

Modifiers

withCursor : String -> Marker msg -> Marker msg

Sets cursor to the marker

withIcon : String -> Marker msg -> Marker msg

Sets a custom image to the marker

withDraggableMode : Marker msg -> Marker msg

Makes the marker draggable

withTitle : String -> Marker msg -> Marker msg

Sets an on hover title for the marker

withAnimation : Animation -> Marker msg -> Marker msg

Sets the animation for the marker.

withInfoWindow : List (Html msg) -> Marker msg -> Marker msg

Sets the content of the Info Window.

When empty, disables the info window.

Animations

bounce : Animation

Get Bounce animation

drop : Animation

Get Drop animation

Events

onClick : msg -> Marker msg -> Marker msg

Sets a click event handler

withInfoWindowOnMouseOver : Marker msg -> Marker msg

Allows to enter/leave a Info Window specified in withInfoWindow