{"id":123380,"date":"2022-01-04T09:00:19","date_gmt":"2022-01-04T09:00:19","guid":{"rendered":"https:\/\/developer.apple.com\/news\/?id=ftkfxb8m"},"modified":"2022-01-04T09:00:19","modified_gmt":"2022-01-04T09:00:19","slug":"add-a-maps-web-snapshot-to-your-online-content","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2022\/01\/04\/add-a-maps-web-snapshot-to-your-online-content\/","title":{"rendered":"Add a Maps Web Snapshot to your online content"},"content":{"rendered":"<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/03\/add-a-maps-web-snapshot-to-your-online-content.jpg\" data-hires=\"false\" alt><\/div>\n<p>Maps Web Snapshots let you visually share important points of interest and details including business locations, geographic boundaries, and routes \u2014 simply by loading a URL. Snapshots work well when you\u2019d like to replace a static image on your website, within an email, or in another location where JavaScript isn\u2019t available and you don&#8217;t have need for a fully interactive map.<\/p>\n<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/03\/add-a-maps-web-snapshot-to-your-online-content-1.jpg\" data-hires=\"false\" alt=\"You\u2019ve probably seen Maps Web Snapshots in action if you\u2019ve used DuckDuckGo as your search engine.\"><\/p>\n<p class=\"typography-caption\">You\u2019ve probably seen Maps Web Snapshots in action if you\u2019ve used DuckDuckGo as your search engine.<\/p>\n<\/div>\n<p>To function, a Snapshot URL requires basic account information \u2014 including your Team ID and a Key ID you\u2019ll create specifically for accessing Apple Maps \u2014 along with a physical location to center the map. You\u2019ll also append a signature to ensure that the map request isn\u2019t altered anywhere between your server and Apple Maps.<\/p>\n<pre class=\"code-source\"><code>https:\/\/snapshot.apple-mapkit.com\/api\/v1\/snapshot?center=[location name or coordinates]&amp;teamId=[Team ID]&amp;keyId=[Maps Key ID]&amp;signature=[base64_url_encoded_signature]<\/code><\/pre>\n<p>The center point of a map is the only required parameter for the URL, and can be either a comma-separated latitude and longitude pair or a physical address. For example, use <code>center=\"Apple Park\"<\/code> to request a snapshot centered on Apple Park in California.<\/p>\n<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/03\/add-a-maps-web-snapshot-to-your-online-content-2.jpg\" data-hires=\"false\" alt><\/div>\n<h3>Add query parameters<\/h3>\n<p>Maps Web Snapshots can be further customized by adding query parameters to display different annotations and overlay styles, alternate map types, and a choice of light or dark color schemes to better match your embedded content.<\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/snapshots\/create_a_maps_web_snapshot\" class=\"icon icon-after icon-chevronright\">Create a Maps Web Snapshot<\/a><\/p>\n<p><strong>Add map annotations<\/strong> To add one or more annotations, use the annotations parameter and include an array of JSON Annotation objects representing the bottom center-point of each. To place the default style, append <code>annotations=[\"point\":\"37.33489990234375,-122.00901794433594\"]<\/code> to your snapshot URL.<\/p>\n<p>You can additionally customize an annotation object to alter its color, style, size, or add a custom image.<\/p>\n<p><strong>Set the color scheme<\/strong> Using the <code>colorScheme<\/code> parameter, you can generate Maps Web Snapshots to match the content and the Appearance setting of a person&#8217;s device. For example, to fetch and display a snapshot of Apple Park when the device is set to Dark Appearance, you can append <code>colorScheme=dark<\/code> to your snapshot URL.<\/p>\n<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/03\/add-a-maps-web-snapshot-to-your-online-content-3.jpg\" data-hires=\"false\" alt><\/div>\n<p><strong>Choose your terrain<\/strong> To display a particular type of map, append the parameter with correct map value: <code>standard<\/code>, <code>satellite<\/code>, or <code>hybrid<\/code>. For example, to fetch the satellite rendition of the Apple Park map, append <code>t=satellite<\/code> to your snapshot URL.<\/p>\n<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/03\/add-a-maps-web-snapshot-to-your-online-content-4.jpg\" data-hires=\"false\" alt><\/div>\n<h3>Explore Snapshots Studio<\/h3>\n<p>Now that you understand the fundamentals of Maps Web Snapshots, the best way to become familiar with the full extent of capabilities is by experimenting with Snapshots Studio.<\/p>\n<p><a href=\"https:\/\/maps.developer.apple.com\/snapshot\" class=\"icon icon-after icon-chevronright\">Visit Snapshots Studio<\/a><\/p>\n<p><strong>Start a snapshot<\/strong> To preview a snapshot, begin by selecting an address or point of interest and choose your desired image dimensions and language.<\/p>\n<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/03\/add-a-maps-web-snapshot-to-your-online-content-5.jpg\" data-hires=\"false\" alt><\/div>\n<p>Then, click the <strong>Show Snapshot<\/strong> button to see the default representation of your chosen location.<\/p>\n<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/03\/add-a-maps-web-snapshot-to-your-online-content-6.jpg\" data-hires=\"false\" alt><\/div>\n<p>To modify results, you can use the snapshot map preview to customize the default annotation, choose a map type, and set the zoom factor.<\/p>\n<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/03\/add-a-maps-web-snapshot-to-your-online-content-7.jpg\" data-hires=\"false\" alt><\/div>\n<p><strong>Create your own snapshots<\/strong> Want to build embeddable Maps Web Snapshots? You\u2019ll want to make sure you have the appropriate credentials. If you haven&#8217;t already created a Maps ID and MapKitJS private key, here\u2019s how to do so:<\/p>\n<ol>\n<li>Create a new identifier (Maps ID) in your developer account. Like a bundle ID, a Map ID is created in reverse domain name notation. <code>*maps.*<\/code> will be prepended to the string you enter. With your Map ID created, you\u2019ll next create your MapKitJS private key.<\/li>\n<li>Create and register a MapKitJS Private Key in your developer account. First, enter a unique name in the <strong>Key Name<\/strong> field, select the checkbox next to MapKit JS, and click <strong>Continue<\/strong>.<\/li>\n<li>Pick the <strong>Configure<\/strong> button. You\u2019ll link the key to the Maps ID you created previously by selecting it from the <strong>Maps ID<\/strong> dropdown menu.<\/li>\n<li>Click the <strong>Save<\/strong> button.<\/li>\n<li>Press <strong>Continue<\/strong>.<\/li>\n<li>Click <strong>Register<\/strong> on the next screen. <\/li>\n<li>When finished, click to download your MapKitJS Private key. Remember, after you\u2019ve downloaded your key, it cannot be re-downloaded as the server copy is removed. Be sure to save a backup in a secure place. <\/li>\n<li>With your key downloaded, click the <strong>Done<\/strong> button and you\u2019re ready to create your own Maps Web Snapshots.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/developer.apple.com\/account\/resources\/identifiers\/add\/bundleId\" class=\"icon icon-after icon-chevronright\">Learn how to create an identifier for your developer account<\/a><\/p>\n<p><a href=\"https:\/\/developer.apple.com\/account\/resources\/authkeys\/list\" class=\"icon icon-after icon-chevronright\">Learn how to create and register a private key<\/a><\/p>\n<p>With the above credentials ready, head back to Snapshots Studio. Enter your developer team ID, MapKitJS key information, the domain you\u2019ll refer the Snapshot from, then press the <strong>OK<\/strong> button to validate your credentials.<\/p>\n<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/03\/add-a-maps-web-snapshot-to-your-online-content-8.jpg\" data-hires=\"false\" alt><\/div>\n<p>After validation, click the <strong>Show Snapshot<\/strong> button one more time.<\/p>\n<p>Now, your map preview image will include a URL that can be placed on your website and linked to from wherever you wish.<\/p>\n<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2022\/03\/add-a-maps-web-snapshot-to-your-online-content-9.jpg\" data-hires=\"false\" alt><\/div>\n<p><strong>Explore Dynamic Snapshots<\/strong> While the generated Maps URL contains all the maps details you configured in Snapshots Studio, it\u2019s actually a flexible template with customizable parameters you can adjust each time the snapshot is requested. To explore all the options you can customize, check out the Maps Web Snapshots documentation for more information.<\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/snapshots\" class=\"icon icon-after icon-chevronright\">Maps Web Snapshots<\/a><\/p>\n<p><a href=\"https:\/\/developer.apple.com\/maps\/web\/\" class=\"icon icon-after icon-chevronright\">Learn more about MapKitJS<\/a><\/p>\n<h3>Make the most of your Maps Web Snapshots<\/h3>\n<p>By default, you can display up to 25,000 unique Maps Web Snapshots requests free with your Apple Developer Program membership. <\/p>\n<p>To avoid accesses that count toward your service limit, we recommend retrieving, storing, then embedding the rendered image rather than serve a link that retrieves the image at display time. If you need additional capacity for your implementation, please contact Developer Relations.<\/p>\n<p><a href=\"https:\/\/developer.apple.com\/contact\/request\/mapkitjs\/\" class=\"icon icon-after icon-chevronright\">Request a MapKit JS Capacity Increase<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Maps Web Snapshots let you visually share important points of interest and details including business locations, geographic boundaries, and routes \u2014 simply by loading a URL. Snapshots work well when you\u2019d like to replace a static image on your website, within an email, or in another location where JavaScript isn\u2019t available and you don&#8217;t have [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":123381,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[],"class_list":["post-123380","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apple-developer-news"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/123380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=123380"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/123380\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media\/123381"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=123380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=123380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=123380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}