⌂
›
Widgets
›
MarkerLayer
MarkerLayer
MarkerLayer control. Build it with the marker_layer helper.
Example
office = [51.505, -0.09]
markers = marker_layer([
marker(
icon("location_on", color: :red_600),
coordinates: office,
width: 44,
height: 44
)
])
page.add(
map(
[
tile_layer(url_template: "https://tile.openstreetmap.org/{z}/{x}/{y}.png"),
markers
],
initial_center: office,
initial_zoom: 13,
expand: true
)
)
Properties
alignment— Alignment of the content within the control.markers— Sets the markers property.
Common layout and animation properties
data— Arbitrary value you can attach to the control and read back in handlers.key— Stable identity used to preserve state across rebuilds.rotate— Rotation applied to the control.
Reference
- Family:
materials - Widget type:
markerlayer - Helpers:
marker_layer,markerlayer