Google API Keys
In July of 2018, Google dramatically reduced the number of Google Maps "transactions" you're allowed to make per month. Unfortunately, this means that the general public can no longer access some of Google's services using GPS Visualizer's credentials.
Making maps
When you make a Google HTML map, you may see a "This page can't load Google Maps correctly" message, and Google's map tiles will be watermarked with "For development purposes only." For now, there are three ways to deal with this:
- Make a map with the open-source Leaflet API instead of Google Maps. The main difference is that you won't have access to Google's background tiles, but no key is required, and the map functionality is essentially the same.
- Get your own API Key and enter it into GPS Visualizer's input form; instructions are below, in the blue box.
- Use a non-Google background map, such as OpenStreetMap. You'll still get the "can't load correctly" message (which can be quickly dismissed), but the tiles won't be watermarked with the "development" message.
Converting driving directions
If you want to paste a Google Maps directions URL into a GPS Visualizer form to get a GPX file or elevation profile, you have two options:
- Get your own API Key and enter it into the conversion or profile input form; instructions are below, in the blue box. (This is your best bet if you'll be using this feature a lot.)
- Run the directions through Google's "My Maps" feature; instructions are below, in the purple box.
(By the way, Google Earth KML files are completely unaffected by all of this!)
How to get your own API Key
The best long-term solution is to create your own Google Cloud Platform API key:
- Go to https://console.cloud.google.com/google/maps-apis/start. Sign in if you are not already logged into a Google account.
- Select your country and agree to Google's Terms & Conditions.
- If Google doesn't have a credit card on file for you, you'll need to click "Finish Account Setup" and enter credit card info to prove that you're a real human being. (You can skip the survey asking which industry you're in.)
- Google will create a new API Key for you, and there's a checkbox to enable all of the Google Maps APIs by default; you probably want that box checked. (If you want to disable some of them later, click on APIs & Services in the sidebar.)
- You might be able to use your new key right away; if it gives you an error message about the Routes API not being enabled, wait a couple of minutes and try again. If it still doesn't work, go to APIs & Services and filter the list by "Maps" or "Routes" to see what's enabled and disabled.
API key info & maintenance:
- The 4 APIs that GPS Visualizer uses are Maps JavaScript API, Routes API, Elevation API, and Geocoding API.
- To check on your newly-created API Key (or make another one), click on Credentials in the sidebar or navigate to https://console.cloud.google.com/apis/credentials.
- To make a new key, click +Create Credentials and then select API Key. To edit an existing key, click the "three dots" icon on the right side of the list of keys.
- If you are only going to use the key to make maps for personal use or convert routes with GPS Visualizer, you can set Application restrictions to None. But if you're concerned about someone potentially "stealing" your map key, you can set it to only allow certain HTTP referers, and enter https://www.gpsvisualizer.com/* as one of the allowed sites under Website restrictions.
- If you want to restrict an API key used to convert routes with GPS Visualizer, you can add a restriction based on IP addresses and add GPS Visualizer's IP (155.254.19.114) to the list of allowed IPs. Note that you generally cannot use an IP-restricted key to make maps, only to convert a route (or perform a similar behind-the-scenes API call).
Note: Once you've entered your key into a GPS Visualizer input form, it will be saved in a "cookie," so you won't have to enter it again unless you switch to a different browser.
About "Billing"
To use the Google APIs, you need to "enable billing" by entering a credit card and verifying that you're a real person. Individual users will almost NEVER exceed the free usage limit, so you won't actually be billed. If you're worried, set a daily quota for your project/key.
Using "My Maps" to convert Google directions
(no API Key required)
If you just need to convert a Google Maps driving/walking/biking route to GPX, you can create the route in Google's "My Maps" feature, and GPS Visualizer will still be able to read it, as long as "sharing" has been enabled.
- Go to https://www.google.com/maps/d/. Sign in if you are not already logged into a Google account.
- Click on Create a new map.
- In the map-drawing interface's toolbar, click on the "add directions" button (
).
- Enter your beginning and ending points. You can also add additional destinations, or drag the route to a different road, just like in the normal Google Maps interface.
- Click Share in the sidebar (
). Name your map.
- In the Share map dialog, click Change... select Anyone with this link can view.
- Copy the map's URL from the dialog or from your browser's location bar.
|