Generate Static Map Image
This snippet will show you how to generate a static map image.
Step 1
To start, add a Text Formula to any table that has an Address field. The text formula will be made up of the following parts
https://maps.googleapis.com/maps/api/staticmap?center=
- Add Field > Address - Address field.
&zoom=13&size=600x300&maptype=roadmap&markers=color:red%7Clabel:%7C
- Add Field > Address - Latitude
,
- Add Field > Address - Longitude
-
&key=YOUR_GOOGLE_API_KEY
(You can create an API key in the Google Developers Console 1.)
The result should look like this.
A similar Text Formula (found below) can be used if you'd like to display a Street View.
https://maps.googleapis.com/maps/api/streetview?size=1800x1800&location=
- Add Field > Address - Address
- Add Field > Address - City
- Add Field > Address - State
- Add Field > Address - Country
&source=outdoor&key=YOUR_GOOGLE_API_KEY
Step 2
To add this to your List component, you may add the following to HTML inside a List. (Change field_id to the Text Formulas field slug)
<p><img src="{!!field_id!!}" alt="" width="100%" /></p>
Step 3
To add this to a PDF, add an HTML Component and the following to the Source Code.
Change “Text Formula” to the name of your Text Formula Field.
<p><img src="{!!Text Formula!!}" alt="" /></p>
<p style="display: none;">{Text Formula}</p>
Original Community Post:
Generate static map image - Community Discussions / Tips and Tricks - Tadabase Community
We'd love to hear your feedback.