Browse Source

Merge pull request #199 from pelias/rhonda-key-placeholders

Update text referring to replacing key placeholders
pull/205/head
Rhonda Glennon 8 years ago committed by GitHub
parent
commit
fa30bedef3
  1. 9
      add-search-to-a-map.md
  2. 4
      search.md

9
add-search-to-a-map.md

@ -116,16 +116,14 @@ To display a Leaflet map on a page, you need a `<div>` element, which is a conta
<div id='map'></div>
```
3. Directly after the `<div>`, add this JavaScript code within a `<script>` tag to set the API key for the map. Use your own API key substituted for the placeholder text of `your-mapzen-api-key`.
3. Directly after the `<div>`, add this JavaScript code within a `<script>` tag to set the API key for the map.
```js
<script>
L.Mapzen.apiKey = "your-mapzen-api-key"; // paste your actual API key here
L.Mapzen.apiKey = "your-mapzen-api-key";
</script>
```
The `your-mapzen-api-key` text is the Mapzen API key; paste your own API key inside the single quotes. You can get an API key by following the steps in the Mapzen [developer overview](https://mapzen.com/documentation/overview/).
4. Inside the same `<script>` tag, and after the code you just added for the API key, initialize a map.
```html
@ -227,6 +225,7 @@ Now, you will test your search box by finding a few locations. As you type, the
2. In the results list, find the entry for `Seattle University` and click it to zoom and add a point to the map at that location. (The point is only on your map, and does not update OpenStreetMap.)
![Entering an address to find on the map](images/geocoder-address-search.png)
3. Search for other addresses or places to experiment with the search function and get an idea of the results it returns. For example, you might try looking for a point of interest in Seattle, your work address, or a city outside the United States.
## Customize the geocoder
@ -359,7 +358,7 @@ Because the geocoder is still under development and considered experimental, if
## Completed HTML for this tutorial
You can refer to this HTML if you want to review your work or troubleshoot an error. You will need to substitute your own API key for the placeholder text in the source code.
You can refer to this HTML if you want to review your work or troubleshoot an error.
```html
<!DOCTYPE html>

4
search.md

@ -9,8 +9,8 @@ Making the leap from text to coordinates is an intricate and challenging process
All Mapzen Search requests share the same format:
```
https://search.mapzen.com/v1/search?text=London&api_key=your-api-key
\___/ \_______________/\__/\_____/\__________/\___________________/
https://search.mapzen.com/v1/search?text=London&api_key=
\___/ \_______________/\__/\_____/\__________/\_______/
| | / | | |
scheme domain version path query authentication token
```

Loading…
Cancel
Save