跳到主要内容
版本:v2.0.0

Map

The map widget can be used to pick or select locations on the Google map with the location's coordinates.

ToolJet - Widget Reference - Map

Exposed variables

Exposed variables can be used to get data from the widget.

variabledescription
boundsViewport area of the map
centerIt contains the locations' coordinates at the center of the bounding area
markersA marker identifies a location on the map. markers contains the list of markers on the map
selectedMarkerObject with the marker selected by the user

Events

eventsdescription
On bounds changeTriggered when the bounding area is changed. This event is triggered after bounds variable is updated
On create markerThis event is triggered when a new marker is created on the map
On marker clickThis event is triggered when any of the markers in the map is clicked
信息

Check Action Reference docs to get the detailed information about all the Actions.

Properties

propertiesdescriptionExpected value
Initial locationIt is the default location's coordinates that the map should focus on.An object containing the latitude and langitude as key value pairs. ex: {{ {"lat": 40.7128, "lng": -73.935242} }}
Default MarkersList of markers that should be shown on the mapAn array of objects containing the coordinates. ex: {{ [{"lat": 40.7128, "lng": -73.935242}] }}
Add new markersThis property should be enabled to add new markers to the map on click.On by default, toggle off to disable adding new markers on the map. Can be programmatically configured by clicking on Fx, accepts values {{true}} or {{false}}
Search for placesIt can be used to show or hide auto-complete search box.On by default, toggle off to disable search on the map. Can be programmatically configured by clicking on Fx, accepts values {{true}} or {{false}}

General

Tooltip

A Tooltip is often used to specify extra information about something when the user hovers the mouse pointer over the widget.

Under the General accordion, you can set the value in the string format. Now hovering over the widget will display the string as the tooltip.

ToolJet - Widget Reference - Map

Layout

Show on desktop

Toggle on or off to display the widget in desktop view. You can programmatically determine the value by clicking on Fx to set the value {{true}} or {{false}}.

Show on mobile

Toggle on or off to display the widget in mobile view. You can programmatically determine the value by clicking on Fx to set the value {{true}} or {{false}}.

Styles

Visibility

Toggle on or off to control the visibility of the widget. You can programmatically change its value by clicking on the Fx button next to it. If {{false}} the widget will not be visible after the app is deployed. By default, it's set to {{true}}.

Disable

This is off by default, toggle on the switch to lock the widget and make it non-functional. You can also programmatically set the value by clicking on the Fx button next to it. If set to {{true}}, the widget will be locked and becomes non-functional. By default, its value is set to {{false}}.

信息

Any property having Fx button next to its field can be programmatically configured.

Actions

ActionDescriptionProperties
setLocationSet map's location.Latitude and Longitude values as parameters. ex: component.map1.setLocation(40.7128, -73.935242)