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

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
}