Skip to content

Commit

Permalink
fix(geocoding-demo): change placeholders to values
Browse files Browse the repository at this point in the history
I was running through tests clicking each button expecting requests to work
however only the
findAddressCandidate method works with empty input
all others throw errors.

AFFECTS PACKAGES:
@esri/arcgis-rest-geocoder
@esri/arcgis-rest-geocoder-vanilla
  • Loading branch information
patrickarlt committed Sep 22, 2017
1 parent 6d04ded commit cfc7f7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions demos/geocoder/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ <h1>get to geocodin!</h1>
</p>

<p>
<input id="geocodeInput" placeholder="123 main st"></input>
<input id="geocodeInput" value="123 main st"></input>
<button class="btn" id="geocode" role="button">geocode an address</button>
<p>
<input id="suggestInput" placeholder="World Tr"></input>
<input id="suggestInput" value="World Tr"></input>
<button class="btn" id="suggest" role="button">get address suggestion</button>
</p>

<p>
<input id="reverseInput" placeholder="{x:-118,y:34}"></input>
<input id="reverseInput" value="{x:-118,y:34}"></input>
<button class="btn" id="reverse" role="button">determine address</button>
</p>

Expand Down Expand Up @@ -81,6 +81,7 @@ <h1>get to geocodin!</h1>
var suggestBtn = document.getElementById('suggest');

suggestBtn.addEventListener('click', function (e) {
console.log(document.getElementById("suggestInput").value);
arcgisRest.suggest(document.getElementById("suggestInput").value)
.then((response) => {
console.log("suggest", response);
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-geocoder/src/geocoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface IGeocodeParams extends IParams {
/**
* You can create an autocomplete experience by making a call to suggest with partial text and then passing through the magicKey and complete address that are returned to geocode.
* ```js
* import { suggest, geocode } from '@esri/arcgis-geocoder';
* import { suggest, geocode } from '@esri/arcgis-geocoder';
* suggest("LAX")
* .then((response) => {
* response.suggestions[2].magicKey; // => "dHA9MCNsb2M9Mjk3ODc2MCNsbmc9MzMjcGw9ODkxNDg4I2xicz0xNDoxNDc4MTI1MA=="
Expand Down Expand Up @@ -233,7 +233,7 @@ export function suggest(
* .then((response) => {
* response.address.PlaceName; // => "LA Airport"
* });
*
*
* // or
* reverseGeocode({ long: -118.409, lat: 33.943 })
* reverseGeocode({ latitude: 33.943, latitude: -118.409 })
Expand Down

0 comments on commit cfc7f7a

Please sign in to comment.