nbolender / mapkit-web-snapshot
Generate a signed URL to an Apple MapKit Web Snapshot.
Installs: 4 222
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.0.0
- ext-openssl: *
This package is auto-updated.
Last update: 2025-06-14 13:10:02 UTC
README
PHP library that generates a signed URL to an Apple Maps Web Snapshot.
Install
composer require nbolender/mapkit-web-snapshot
Usage
use NBolender\MapKit\WebSnapshot; $teamId = 'XXXXXXXXXX'; // Apple Developer Team ID $keyId = 'XXXXXXXXXX'; // Apple MapKit Key ID $private_key = '-----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY-----'; // Contents of, or path to, private key file $center = 'One Apple Park Way, Cupertino, CA 95014'; // The center of the map, specified as either coordinates or an address // (Optional) A keyed array of any additional map parameters; JSON parameters will be automatically encoded $additional_parameters = [ 'z' => 12, 'size' => '300x300', 't' => 'standard', 'colorScheme' => 'dark', 'annotations' => [ [ 'color' => 'ff0000', 'markerStyle' => 'balloon', 'point' => 'center', ], ], ]; $url = WebSnapshot::signedURL($teamId, $keyId, $private_key, $center, $additional_parameters); echo $url;
Apple Documentation
License
This project is open-source software and licensed under the MIT license.
Credits
This project is developed by Nathan Bolender. Special thanks to Thomas Schoffelen and his MapKit JWT library, which was referenced for this project.