Url scheme apple maps

remeika / apple-maps.proto

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

syntax = «proto3» ;
package maps ;
message Collection <
string name = 1 ;
message Coordinates <
double latitude = 1 ;
double longitude = 2 ;
>
message Location <
int32 lsp = 1 ;
uint64 appleMapsId = 2 ;
string address = 3 ;
Coordinates coordinates = 4 ;
string name = 5 ;
>
repeated Location location = 2 ;
>

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

»’
Decode the data stored in the `_col` query parameter of an apple maps collection URL. Example:
https://collections.apple.com/collection?_col=ChkzNiBIb3VycyBpbiBQb3J0bGFuZCwgTWUuEl4aNVdlc3Rlcm4gUHJvbWVuYWRlLCBQb3J0bGFuZCwgTUUgIDA0MTAyLCBVbml0ZWQgU3RhdGVzIhIJvol88gvTRUARJ62u%2BaeRUcAqEVdlc3Rlcm4gUHJvbWVuYWRlEg0Irk0Q%2Bsvey9ivxpsPEg4Irk0QyuH475jurPioARJdGjAxODEgU3RhdGUgU3QsIFBvcnRsYW5kLCBNRSAgMDQxMDEsIFVuaXRlZCBTdGF0ZXMiEgmReYlWk9NFQBHVlwBXDZFRwCoVT25lIExvbmdmZWxsb3cgU3F1YXJlEg0Irk0QmarQ4r6omMpiEg4Irk0Qnojwv%2BmwwYjjARINCK5NEMX3iPvSiK7%2BEhIOCK5NEPiehseY6IrDgAESDQiuTRDhnL69jcilpF8SDgiuTRCUtvKfpI%2FujJMBEg0Irk0Qlu2S5PP6wbAaEg0Irk0Qta7tvbWs16w8Eg4Irk0QyprGyqzzuamOARINCK5NEKK7ke%2FBoJyfIhIOCK5NEPPmsNixr4awzwESDQiuTRC3pN3hgdTCjG4SDgiuTRDZ0KWnlan9o5sBEg4Irk0Qz5Dv76HQub%2FdARIOCK5NEKbF7OSsgomCrgESDQiuTRCXk%2Fmpq4icq3oSDgiuTRCu2LSXt8ze3aQBEg4Irk0Qxr%2FOvs%2Bz%2Bo7rARIOCK5NEI7Ko4r1j86osAESDQiuTRDhqoT2tLCayEMSDgiuTRDR38Pkz%2BWjzdEBEg0Irk0QqoS1hc23pPUzEg4Irk0QybPZmtGxzK2YARINCK5NELudnqabgaWNHA%3D%3D
This example assumes you’ve compiled the above protocol buffer into a python module named maps_pb2.
»’
from base64 import decodebytes
from urllib . parse import unquote
import maps_pb2
_col = «ChkzNiBIb3VycyBpbiBQb3J0bGFuZCwgTWUuEl4aNVdlc3Rlcm4gUHJvbWVuYWRlLCBQb3J0bGFuZCwgTUUgIDA0MTAyLCBVbml0ZWQgU3RhdGVzIhIJvol88gvTRUARJ62u%2BaeRUcAqEVdlc3Rlcm4gUHJvbWVuYWRlEg0Irk0Q%2Bsvey9ivxpsPEg4Irk0QyuH475jurPioARJdGjAxODEgU3RhdGUgU3QsIFBvcnRsYW5kLCBNRSAgMDQxMDEsIFVuaXRlZCBTdGF0ZXMiEgmReYlWk9NFQBHVlwBXDZFRwCoVT25lIExvbmdmZWxsb3cgU3F1YXJlEg0Irk0QmarQ4r6omMpiEg4Irk0Qnojwv%2BmwwYjjARINCK5NEMX3iPvSiK7%2BEhIOCK5NEPiehseY6IrDgAESDQiuTRDhnL69jcilpF8SDgiuTRCUtvKfpI%2FujJMBEg0Irk0Qlu2S5PP6wbAaEg0Irk0Qta7tvbWs16w8Eg4Irk0QyprGyqzzuamOARINCK5NEKK7ke%2FBoJyfIhIOCK5NEPPmsNixr4awzwESDQiuTRC3pN3hgdTCjG4SDgiuTRDZ0KWnlan9o5sBEg4Irk0Qz5Dv76HQub%2FdARIOCK5NEKbF7OSsgomCrgESDQiuTRCXk%2Fmpq4icq3oSDgiuTRCu2LSXt8ze3aQBEg4Irk0Qxr%2FOvs%2Bz%2Bo7rARIOCK5NEI7Ko4r1j86osAESDQiuTRDhqoT2tLCayEMSDgiuTRDR38Pkz%2BWjzdEBEg0Irk0QqoS1hc23pPUzEg4Irk0QybPZmtGxzK2YARINCK5NELudnqabgaWNHA%3D%3D»
base64_string = unquote ( _col )
base64_bytes = bytearray ( base64_string , encoding = ‘utf8’ )
raw = decodebytes ( base64_bytes )
collection_struct = maps_pb2 . Collection ()
collection_struct . ParseFromString ( raw )
print ( collection_struct )

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Apple URL Scheme Reference

About Apple URL Schemes

This document describes several URL schemes that are supported by system apps on iOS, macOS, and watchOS 2 and later. Native iOS apps and web apps running in Safari on any platform can use these schemes to integrate with system apps and provide a more seamless experience for the user. For example, if your iOS app displays telephone numbers, you could use an appropriate URL to launch the Phone app whenever someone taps one of those numbers. Similarly, clicking an iTunes link launches the iTunes app and plays the song specified in the link. When a user clicks a link, what happens depends on the platform and the installed system apps.

This document describes those schemes that require special attributes or special formatting in order to be understood by the associated system app. As a result, this document does not describe all URL schemes supported on different Apple platforms.

At a Glance

You should read this document if you want to launch a system app from your iOS or macOS app, or from your web app running in Safari. This document contains both Cocoa Touch sample code—using the openURL:options:completionHandler: method of the shared UIApplication object to open URLs—and HTML samples.

Composing Items Using Mail

Use the mailto scheme to open the Mail app and populate a new email with information.

Relevant Chapter: Mail Links

Starting a Phone or FaceTime Conversation

Use the tel and facetime schemes to initiate telephone or video conversations.

Specifying Text Messages

Use the sms scheme to compose a text message and specify a recipient.

Relevant Chapter: SMS Links

Opening Locations in Maps

Use specially formatted URLs to open the Maps app and display directions or locations.

Читайте также:  Проверка статуса активации iphone

Relevant Chapter: Map Links

Opening Items in iTunes

Use specially formatted URLs to open iTunes and display items in the iTunes Music Store.

Relevant Chapter: iTunes Links

Opening YouTube Videos

Use specially formatted URLs to open YouTube videos in Safari.

Relevant Chapter: YouTube Links

Copyright © 2017 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2017-09-19

Источник

Apple URL Scheme Reference

The maps URL scheme is used to show geographical locations and to generate driving directions between two points. If your app includes address or location information, you can use map links to open that information in the Maps app in iOS or macOS.

Unlike some schemes, map URLs do not start with a “maps” scheme identifier. Instead, map links are specified as regular http links and are opened either in Safari or the Maps app on the target platform.

Table 5-1 lists the supported parameters along with a brief description of each.

Table 5-1 Supported Apple Maps parameters

The map type. If you don’t specify one of the documented values, the current map type is used.

m (standard view)

k (satellite view)

The query. This parameter is treated as if its value had been typed into the Maps search field by the user. Note that q=* is not supported

The q parameter can also be used as a label if the location is explicitly defined in the ll or address parameters.

A URL-encoded string that describes the search object, such as “pizza,” or an address to be geocoded

The address. Using the address parameter simply displays the specified location, it does not perform a search for the location.

An address string that geolocation can understand.

A hint used during search. If the sll parameter is missing or its value is incomplete, the value of near is used instead.

A comma-separated pair of floating point values that represent latitude and longitude (in that order).

The location around which the map should be centered.

The ll parameter can also represent a pin location when you use the q parameter to specify a name.

A comma-separated pair of floating point values that represent latitude and longitude (in that order).

The zoom level. You can use the z parameter only when you also use the ll parameter; in particular, you can’t use z in combination with the spn or sspn parameters.

A floating point value between 2 and 21 that defines the area around the center point that should be displayed.

The area around the center point, or span. The center point is specified by the ll parameter.

You can’t use the spn parameter in combination with the z parameter.

A coordinate span (see MKCoordinateSpan ) denoting a latitudinal delta and a longitudinal delta.

The source address to be used as the starting point for directions.

A complete directions request includes the saddr , daddr , and dirflg parameters, but only the daddr parameter is required. If you don’t specify a value for saddr , the starting point is “here.”

An address string that geolocation can understand.

The destination address to be used as the destination point for directions.

A complete directions request includes the saddr , daddr , and dirflg parameters, but only the daddr parameter is required.

An address string that geolocation can understand.

The transport type.

A complete directions request includes the saddr , daddr , and dirflg parameters, but only the daddr parameter is required. If you don’t specify one of the documented transport type values, the dirflg parameter is ignored; if you don’t specify any value, Maps uses the user’s preferred transport type or the previous setting.

r (by public transit)

The search location. You can specify the sll parameter by itself or in combination with the q parameter. For example, http://maps.apple.com/?sll=50.894967,4.341626&z=10&t=s is a valid query.

A comma-separated pair of floating point values that represent latitude and longitude (in that order).

The screen span. Use the sspn parameter to specify a span around the search location specified by the sll parameter.

A coordinate span (see MKCoordinateSpan ) denoting a latitudinal delta and a longitudinal delta.

You can use the maps URL scheme to help the user:

Perform a search

Get directions to a location

View a specific location

To perform a search, supply a properly encoded URL string as the value of the q parameter. For example:

To specify a location for search, you can supply a value for the near parameter, or combine the sll parameter with either the z or sspn parameters. You can also set the map type using the t parameter, as shown here:

To provide navigation directions from one location to another, supply the start and destination addresses in the saddr and daddr parameters as shown below. You can also supply much more detail for the start and destination addresses than is shown here.

To specify a transport type, you can use the dirflg parameter as shown here:

You can omit the start address when you want to provide directions “from here.” The following example shows a search from here that provides driving directions in a hybrid map.

To display a specific location, use the ll parameter to center the map at the specified position as shown here:

Another way to display a location is to specify an address, such as:

If you use both the ll and address parameters, ll takes precedence over address . If you include a name in the value of the q parameter, Maps tries to match the name at the specified location.

Copyright © 2017 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2017-09-19

Источник

Apple Maps URL Schemes

In this article I will explain to you the Apple Maps URL Schemes and show you, how to use them.

URL Types

The Apple Maps app has three URL types, which open the app if installed.

URL types represent, where the system should open the URL, e.g. https:// or http:// represent a web URL.

Apple Maps Web URLs

You can also open Apple Maps via web URLs:

Without input parameters in the URL path (behind the last slash), the first URL redirects to the Apple Maps website and the other two can’t find the server.

Parameters

There are multiple parameters you can add to the Apple Maps URLs and the https://maps.apple.com/ URL. An explanation by apple is on the Apple Developer Documentation Archive. Multiple parameters can be stringed together with an & . Before the first parameter must be a ? . Between the parameter and the value is a = . Spaces are replaced with + or % and coordinates are defined as latitude,longitude with decimal values.

Defines the map type. Use m for standard, k for satellite, h for hybrid and r for transit. When missing, the current map type is used.

The search query. The value string is handled like a search. When the location is explicitly defined by ll or address , it adds a custom title to the location.

address

When the string is a valid location, Apple Maps adds a pin to the location. If not, a search with the string is performed.

The hint of where the search should be performed.

The location of the map center. When you use q as a label, ll can also represent a pin location. When it’s missing, either the last location is used or the location of the internet server (when the app is launched).

A decimal value between 2 and 21 to define the zoom level. Can only be used with the ll parameter.

The area or span around the ll center point. It can be used together with z . The value consist of two decimal numbers describing the latitude and longitude delta.

saddr

The starting point for directions. A full direction consists of saddr , daddr and dirflg , but only daddr is required. When empty, “here” i used.

daddr

The destination for directions.

dirflg

The transportation type for directions. Use d for car, w for foot, c for cycling and r for public transport. By default car is selected.

The search location.

Specify the span around the sll location.

Explained further below.

Probably a random ID, that is assigned to every Apple Maps item. Is in the path when you share a location and consists of only numbers.

A character string in the URLs, that are shared from Apple Maps.

Examples

Here are some examples, on what you can do with Apple Maps URL Schemes.

Opens the address “One Apple Park Way, Cupertino, United States” in Apple Maps.

Searches museums around the location with a span of 145.

Returns cycling directions between the Santa Teresa Country Park and the Windy Hill Open Space Reservate.

Here’s an example on how to create this in Swift. Be sure to replace the spaces with + .

Apple Maps Guide URLs

Apple Maps Guide URLs (pre iOS 14 called collections) can be shared. They can also be used to open guides. The syntax is:

The old syntax was:

Both open the Apple Maps Guides/ Collections web portal. Click here to see how it looks like. But you can also open the guide inside the Apple Maps app with this syntax:

By now, I haven’t figured out, how to create the GUIDE-SPECIFIC-CHARACTERS via code and not by creating the guide and copying the URL. The only thing I found out yet, is, that when Base64-Decoding the string the result contains the guide’s title. The result from this guide:

“Guide” was the title of the guide. When i find a way, I will add it to this article. The string represents all items in the guide, instead of it being a random string that is stored on Apples servers and connected to the guide. This can be seen first, because the string gets longer, depending on how many items are in the guide, and second, two guides, which both contain the same two locations and one guide another extra location, contain equal substrings:

The first substring contains the guide’s title, the second one element 1 (San Francisco) and element 2 (Cupertino) and the last one element 3 (Palo Alto).

If you maybe found a way to fully decode the guide string, or any other Apple Maps URL schemes or parameters, feel free to post them to a note here and I will add them to the article (with credit of course).

Источник

Читайте также:  Реклама айфон с коржиком
Оцените статью