Google Map

Attribute Type Documentation Default Value
Required id * :string

DOM identifier

class :string

Additional CSS classes for the map container

style :string

Inline CSS styles for the map container

marker_template :string

Lodash HTML template for marker info windows, evaluated with the marker's attributes

marker_events :map

LiveView events by marker collection.

Read more Read less
%{}

Example: %{default: [%{on: "click", push: %{event: "select_marker", payload: %{id: %{marker: :id}}}}]}. Payload values reference attributes of the clicked marker.

click_marker_event :boolean

Send the click_marker_event LiveView event with the marker's shop_id when clicked

false
settings_menu :list

Settings entries: %{label: "Refresh", event: "refresh", payload: %{}}. Events are sent to the parent LiveView. An empty list hides the control.

[]
options :any

Google Map options. A JavaScript mapId is required for advanced markers.

Read more Read less
%{}

Use DEMO_MAP_ID only for development and stories. https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions

markers :any

list of marker collections. %{default: [%{lat: lat, lng: lng}, ...], some_collection: [...]}

%{}
marker_colors :any

Color for each collection of markers

%{default: "#FF0000"}
marker_radius :any

Radius in meters for each collection of markers (%{default: 500, disabled: 100})

focused_marker_id :integer

ID of a single marker that will start bouncing as it get focus

bounds :list

When no bounds are given they are automatically infered from markers.

Read more Read less
[]

This option prevents the map from panning/zooming around as markers are added and removed. [%{lat: sw_lat, lng: sw_lng}, %{lat: ne_lat, lng: ne_lng}]

marker_clusters :any

Enable or disable map cluster, for each collection

%{default: false}