Map

This timeline provides a static Google Maps component which:

  • Plots a pin on the map based on coordinates
  • Requires a Google API key to be based into ServisBOT Messenger in the ServisBOT.init() function

We automatically provide a key for our testing and preview pages, but you will need to generate and maintain one when deploying your bot to production. You can obtain a key here: Google Maps API Key

The parameters for StaticMap are:

Name Type Default Values Description
description string - - the description to be associated with the map e.g. the address
lat string - - the latitude co-ordinate of the pin to place on the map
lng string - - the longitude co-ordinate of the pin to place on the map
googleApiKey string - - Optional field, if no key is provided in the ServisBOT config, a key can be provided in the timeline element
showmap boolean true true, false Controls weather a map is rendered using google maps API
confirmText string - - Provides an overide to the confirm text in the widget
cancelText string - - Provides an overide to the cancel text in the widget
deniedText string - - Provides an overide to the denied text in the widget after select
confirmedText string - - Provides an overide to the confirmed text in the widget after select
requestLocationPermissionText string Please share your location with us. - The text to display when requesting the user to allow location permissions in the browser.
denyLocationPermissionText string DENY - The text to display for the deny button when location permissions are requested.
locationPermissionDeniedText string Please enable location permissions in your browser and reload the page. - The text to display if the user blocks location permissions.

An example of StaticMap markup is:

Get Users Location Using a Map

The map timeline element can be used to request a users’s location simply by using it with the markup interaction node and adjusting the markup.

The results will be provided as part of msg.payload.markupInteraction.

"markupInteraction": {
  "lat": 42.34339322495768,
  "lng": -71.09655591550987
}