My scenario: We survey historic properties. I needed to make a photo location map to indicate where each photo of the property or historic district was taken from.
Two tables: Property and Photos
Six Fields: Photos::Latitude, Photos::Longitude, Photos::PhotoID, Photos::PhotoLocations
The Latitude and Longitude are pulled from the device using Get Location. The PhotoLocations field is an unstored calculation with the result being text. I also added the PhotoID field into the calculation for the marker label.
If ( not IsEmpty ( Latitude ); "&markers=color:red%7Clabel:" & PhotoID & "%7C" & Lat & "," & Long)
In the Property table I created two fields: ListPhotoLocations, and ListPhotoLocationsConcat, which are both unstored calculations with a result of text, respectively:
List ( Photos::PhotoLocations )
Substitute ( ListPhotoLocations; ¶; "")
In a layout based on the Property table, I inserted a WebViewer with the custom address, based on Google's' Static Map API instructions and trial and error:
"https://maps.googleapis.com/maps/api/staticmap?&zoom=19&size=1000x1000&scale=2&maptype=hybrid" & Property::ListPhotoLocationsConcat & "&key=YourAPIKey"
This pulls up a nice map with markers at each photo location around a property, and marked with the Photo ID. I plan to adjust it to allow the user to specify the zoom, and theoretically you could do that with the scale and map type too. I will also be adding a button to allow users to export the map as an image to insert in our reports.