Extensions

Map

Map extension

Build interactive maps with tile, marker, circle, polyline, polygon, and attribution layers.

Enable the extension

Add the extension key to ruflet.yaml:

extensions:
  - map

Run ruflet run during development or ruflet build <target> for a release. Extension packages are compiled into the Ruflet client, so rebuild the client after changing this list.

Ruby DSL example

office = { latitude: 40.7128, longitude: -74.0060 }
map_view = map(
  [
    tile_layer(url_template: "https://tile.openstreetmap.org/{z}/{x}/{y}.png"),
    marker_layer([marker(coordinates: office, content: icon("location_on"))])
  ],
  initial_center: office,
  initial_zoom: 13,
  on_tap: ->(event) { puts event.data.inspect }
)
page.add(map_view)

API provided

Permissions and platforms

No protected service declaration is added automatically. Platform support still follows the underlying Flet extension, so test every target you ship.

Build behavior

Ruflet resolves the extension key to flet_map and includes that Flet package through the client extension pipeline. Application code uses the Ruby DSL shown above; do not add the package directly to your app's Flutter dependencies.