Workflow Example: Coordinates From Google Maps Share

This workflow is configured as an action extension. It is intended to receive map shares from the Google Maps app and to return some coordinate details for the location.

The workflow first checks to see if the input to it contains “/maps/” (which Google Maps shares do). If not it substitutes in example content from a Google Map share.

The URL passed in is first expanded (just to be sure we always have a full URL to work with) and then the initial part of the maps URL is stripped using a Replace Text action.

The first part (based on separation by forward slash (“/”) of the remaining portion of the URL is taken and split based on the position of a comma. The variable Coordinates then contains the coordinate elements of the map location being processed.

Latitude is the first element and longitude the second. These are stored in other variables and the result (along with the original (expanded) URL) are displayed to the user via a Quick Look action.

Note also the use of the Set Name action to title the Quick Look window that is displayed.

Tags: | workflow |