The ggmap R package is a powerful tool for creating stunning map visualizations in R, making mapping tasks more accessible and efficient. To enable Stadia Maps services in R, an API key is required. A free API key for non-commercial use can be obtained without requiring a credit card for sign-up.
Sign up for Stadia Maps at https://client.stadiamaps.com/signup/
Navigate to the client dashboard at https://client.stadiamaps.com/dashboard/
Click on Create a Property → insert Property Name → click on Create
Under Authentication Configuration, select Add API key
Copy the provided API key and execute the following code in the console
ggmap::register_stadiamaps(key = "YOUR-API-KEY", write = FALSE)
When setting the API key:
write = FALSE
to configure the key for the current R session only. The API key needs to be provided again when restarting R.write = TRUE
to set the API key permanently across R sessions.Note: The API key is a PRIVATE access key and should be handled with caution.
Avoid sharing it online, like in a public GitHub repository, or storing it in a shared R script file.