Launching Streets from third party appsStreets can be launched from other apps by making use of custom URL schemes. This is useful to display panorama imagery for a given location or to create workflows that grab a panorama image and process it. The most basic example just opens the Streets app and shows a panorama for a given latitude,longitude:
The URL scheme is streets (or ftstreets in case of any ambiguity). The following GET query parameters are supported:
|Example value *)
|The location in latitude, longitude format of the requested Street View panorama.
|The viewing angle (north = 0)
|The vertical viewing angle (0 = looking straight to the horizon, negative value looking down, positive value looking up)
|The map region for the map shown before switching to the panorama. Format: center latitude, center longitude, latitude delta/span, longitude delta/span
|The title of the location. It is displayed as the title of the map callout, the panorama callout and the panorama title bar.
|The Google panorama ID (panoid in Google Street View links).
|The panorama image is copied to the clipboard.
|URL to get back to the originating application. The scheme has to be supported by your application. This URL will be called after a panorama image is copied to the clipboard. Only works in combination with action.
|URL to get back to the originating application in case no panorama is found. The scheme has to be supported by your application. This URL is called instead of x-success immediately if no panorama is found for the location. Only works in combination with x-success and action.
By returning panorama images via the clipboard, Streets can be used in powerful workflows. For instance, you can create a workflow that automatically adds panorama images for contacts, event locations or other places. We provide a sample workflow that lets the user select a contact and creates a new note with an image that consists of the street panorama at the left and a map on the right:
Feel free to modify the workflow to accomplish your specific needs, e.g. to share images on social networks. We’d love to hear from you what you have come up with!
Detecting if Streets is installedYou might want to disable linking to Streets if the app is not installed. Or you might instead want to open its App Store page (using an affiliate link you can even monetize this). This code will do it for you:
Calls to canOpenURL require an addition to your app’s Info.plist:
Web linksAs a fallback if Streets is not available you might want to link to a web page with an embedded Street View. The URL scheme is pretty similar: Just replace streets:// with https://www.streetsapp.net/streets. For example this link will display the Apple Store Opéra in Paris:
https://www.streetsapp.net/streets?pitch=7&title=Apple%20Store%20Opéra&location=48.872112,2.332977®ion=48.330605,2.062390,3.311491,3.164060&heading=60&pano=4mgeFbSLLMaDGxKdfHeq7QOn iPhone and iPad this web page tries to open the native Streets app if installed.