- remeika / apple-maps.proto
- Apple URL Scheme Reference
- About Apple URL Schemes
- At a Glance
- Composing Items Using Mail
- Starting a Phone or FaceTime Conversation
- Specifying Text Messages
- Opening Locations in Maps
- Opening Items in iTunes
- Opening YouTube Videos
- Apple URL Scheme Reference
- Map Links
- Apple Maps URL Schemes
- URL Types
- Apple Maps Web URLs
- Parameters
- address
- saddr
- daddr
- dirflg
- Examples
- Apple Maps Guide URLs
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.
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
Map Links
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.