Block: Map

A Map block for configuring an interactive 2D map to be displayed in the user interface.

Overview

A Map block is used for configuring a 2D geographical map, to be displayed in a frame. The map allows the user to select a geo-spatial location, by clicking a point on the map. The longitude and latitude of selected location can be passed to a Grasshopper model for further processing.

Example

Below is an example configuration.

kind: Solution
version: v0
router:
  kind: Router
  routes:
    - frame: home-frame
frames:
  home-frame:
    kind: Frame
    contents:
      my-map:
        kind: Map
        bounds:
          bottomLeft:
            latitude: 1.211008
            longitude: 103.594621
          topRight:
            latitude: 1.499482
            longitude: 104.018872
        placeMarker:
          title: Select location
          text: Where do you live?
          ok: Save
          cancel: Try again
      my-model:
        kind: Model
        modelFile: my-grasshopper-model.gh
        subscribe:
          - kind: Map
            frame: home-frame
            source: my-map
            setInputFromMarkers: my-input-component

MapConfig

Name Type Required Description
kind "Map" Yes
bounds Bounds No
placeMarker PlaceMarker No

Bounds

Name Type Required Description
bottomLeft LatLong Yes
topRight LatLong Yes

LatLong

Name Type Required Description
latitude number Yes
longitude number Yes

PlaceMarker

Name Type Required Description
title string Yes
text string Yes
ok string Yes
cancel string Yes