Harness and Section forms
|
Using the Google Static Maps API facilitates showing an address or longitude/latitude coordinates as a static map image containing a pin with the location. This allows users to display a geographical location visually in an application, for instance, when offline. To accomplish this, invoke the pyFetchStaticMap activity with a set of parameters.
The Static Maps API uses an API key to identify your application. API keys are managed through the Google APIs Console. To create a key:
Note: The above steps partially apply to a third-party resource (the Google Developer Console) and are accurate as of the publication of this article. Refer to the official Google Developer documentation for Obtaining an API Key for additional assistance with this process.
The pyFetchStaticMap activity populates any property with a Base64 image data representing the map and uses that property as an image source with the Icon /Image control. The use cases for pyFetchStaticMap are unlimited since it can be called from any other activity. Some of its most common use cases are outlined below - when you want to:
The following steps describe a user case calling the pyFetchStaticMap activity from a post-load processing activity of a data page. Step 1 is always performed no matter the context.
Call pyFetchStaticMap
in the Method field.When invoking the pyFetchStaticMap method, the following are its parameters, some of which are required:
Name |
Description |
targetProperty |
Required. Defines target property where the static Google map image with location is to be saved. The entered value must be in double quotes. The format should be Text. The map image data is saved in Base64 format in this property. |
markerAddress |
Required. A property which references a longitude/latitude coordinates or a human-readable geographical address of the location to be displayed in the static map, for instance, "40.689249, -74.044516" or "Statue of Liberty, Liberty Island, Brooklyn, NY 11231, USA". |
width |
Required. The width of the image in pixels, for instance, 300. |
height |
Required. The height of the image in pixels., for instance, 100. |
zoomLevel |
Specifies the zoom level on the map. Only values between 0 and 21 (inclusive) are permitted. The default value is 15. |
mapType |
Defines the type of Google map to display:
|
imageType |
Defines the type of image to use:
|