Skip to content

Commit d129bb0

Browse files
committed
add initial files
1 parent 962b62d commit d129bb0

34 files changed

+158
-71
lines changed

.doc_gen/metadata/location_metadata.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ location_CreateMap:
3939
JavaScript:
4040
versions:
4141
- sdk_version: 3
42-
github: javascriptv3/example_code/location-services/actions
42+
github: javascriptv3/example_code/location/actions
4343
sdkguide:
4444
excerpts:
4545
- description:
@@ -92,7 +92,7 @@ location_CreateGeofenceCollection:
9292
JavaScript:
9393
versions:
9494
- sdk_version: 3
95-
github: javascriptv3/example_code/location-services/actions
95+
github: javascriptv3/example_code/location/actions
9696
sdkguide:
9797
excerpts:
9898
- description:
@@ -123,7 +123,7 @@ location_PutGeofence:
123123
JavaScript:
124124
versions:
125125
- sdk_version: 3
126-
github: javascriptv3/example_code/location-services/actions
126+
github: javascriptv3/example_code/location/actions
127127
sdkguide:
128128
excerpts:
129129
- description:
@@ -154,7 +154,7 @@ location_CreateTracker:
154154
JavaScript:
155155
versions:
156156
- sdk_version: 3
157-
github: javascriptv3/example_code/location-services/actions
157+
github: javascriptv3/example_code/location/actions
158158
sdkguide:
159159
excerpts:
160160
- description:
@@ -185,7 +185,7 @@ location_BatchUpdateDevicePosition:
185185
JavaScript:
186186
versions:
187187
- sdk_version: 3
188-
github: javascriptv3/example_code/location-services/actions
188+
github: javascriptv3/example_code/location/actions
189189
sdkguide:
190190
excerpts:
191191
- description:
@@ -216,7 +216,7 @@ location_GetDevicePosition:
216216
JavaScript:
217217
versions:
218218
- sdk_version: 3
219-
github: javascriptv3/example_code/location-services/actions
219+
github: javascriptv3/example_code/location/actions
220220
sdkguide:
221221
excerpts:
222222
- description:
@@ -247,7 +247,7 @@ location_CreateRouteCalculator:
247247
JavaScript:
248248
versions:
249249
- sdk_version: 3
250-
github: javascriptv3/example_code/location-services/actions
250+
github: javascriptv3/example_code/location/actions
251251
sdkguide:
252252
excerpts:
253253
- description:
@@ -278,7 +278,7 @@ location_CalculateRoute:
278278
JavaScript:
279279
versions:
280280
- sdk_version: 3
281-
github: javascriptv3/example_code/location-services/actions
281+
github: javascriptv3/example_code/location/actions
282282
sdkguide:
283283
excerpts:
284284
- description:
@@ -309,7 +309,7 @@ location_DeleteGeofenceCollection:
309309
JavaScript:
310310
versions:
311311
- sdk_version: 3
312-
github: javascriptv3/example_code/location-services/actions
312+
github: javascriptv3/example_code/location/actions
313313
sdkguide:
314314
excerpts:
315315
- description:
@@ -362,7 +362,7 @@ location_DeleteMap:
362362
JavaScript:
363363
versions:
364364
- sdk_version: 3
365-
github: javascriptv3/example_code/location-services/actions
365+
github: javascriptv3/example_code/location/actions
366366
sdkguide:
367367
excerpts:
368368
- description:
@@ -393,7 +393,7 @@ location_DeleteTracker:
393393
JavaScript:
394394
versions:
395395
- sdk_version: 3
396-
github: javascriptv3/example_code/location-services/actions
396+
github: javascriptv3/example_code/location/actions
397397
sdkguide:
398398
excerpts:
399399
- description:
@@ -424,7 +424,7 @@ location_DeleteRouteCalculator:
424424
JavaScript:
425425
versions:
426426
- sdk_version: 3
427-
github: javascriptv3/example_code/location-services/actions
427+
github: javascriptv3/example_code/location/actions
428428
sdkguide:
429429
excerpts:
430430
- description:
@@ -481,7 +481,7 @@ location_Scenario:
481481
JavaScript:
482482
versions:
483483
- sdk_version: 3
484-
github: javascriptv3/example_code/location-services/scenarios
484+
github: javascriptv3/example_code/location/scenarios
485485
sdkguide:
486486
excerpts:
487487
- description:

javascriptv3/example_code/location-services/README.md

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Amazon Location code examples for the SDK for JavaScript (v3)
2+
3+
## Overview
4+
5+
Shows how to use the AWS SDK for JavaScript (v3) to work with Amazon Location Service.
6+
7+
<!--custom.overview.start-->
8+
<!--custom.overview.end-->
9+
10+
_Amazon Location lets you easily and securely add maps, places, routes, geofences, and trackers, to your applications._
11+
12+
## ⚠ Important
13+
14+
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/).
15+
* Running the tests might result in charges to your AWS account.
16+
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
17+
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
18+
19+
<!--custom.important.start-->
20+
<!--custom.important.end-->
21+
22+
## Code examples
23+
24+
### Prerequisites
25+
26+
For prerequisites, see the [README](../../README.md#Prerequisites) in the `javascriptv3` folder.
27+
28+
29+
<!--custom.prerequisites.start-->
30+
<!--custom.prerequisites.end-->
31+
32+
### Basics
33+
34+
Code examples that show you how to perform the essential operations within a service.
35+
36+
- [Learn the basics](scenarios/location-service-basics.js)
37+
38+
39+
### Single actions
40+
41+
Code excerpts that show you how to call individual service functions.
42+
43+
- [BatchUpdateDevicePosition](actions/batch-update-device-position.js#L4)
44+
- [CalculateRoute](actions/calculate-distance-async.js#L4)
45+
- [CreateGeofenceCollection](actions/create-geofence-collection.js#L4)
46+
- [CreateMap](actions/create-map.js#L4)
47+
- [CreateRouteCalculator](actions/create-route-calculator.js#L4)
48+
- [CreateTracker](actions/create-tracker.js#L4)
49+
- [DeleteGeofenceCollection](actions/delete-geofence-collection.js#L4)
50+
- [DeleteMap](actions/delete-map.js#L4)
51+
- [DeleteRouteCalculator](actions/delete-route-calculator.js#L4)
52+
- [DeleteTracker](actions/delete-tracker.js#L4)
53+
- [GetDevicePosition](actions/get-device-position.js#L4)
54+
- [PutGeofence](actions/put-geofence.js#L4)
55+
56+
57+
<!--custom.examples.start-->
58+
<!--custom.examples.end-->
59+
60+
## Run the examples
61+
62+
### Instructions
63+
64+
**Note**: All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see
65+
[JavaScript ES6/CommonJS syntax](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/sdk-examples-javascript-syntax.html).
66+
67+
**Run a single action**
68+
69+
```bash
70+
node ./actions/<fileName>
71+
```
72+
73+
**Run a scenario**
74+
75+
Most scenarios can be run with the following command:
76+
```bash
77+
node ./scenarios/<fileName>
78+
```
79+
80+
**Run with options**
81+
82+
Some actions and scenarios can be run with options from the command line:
83+
```bash
84+
node ./scenarios/<fileName> --option1 --option2
85+
```
86+
[util.parseArgs](https://nodejs.org/api/util.html#utilparseargsconfig) is used to configure
87+
these options. For the specific options available to each script, see the `parseArgs` usage
88+
for that file.
89+
90+
<!--custom.instructions.start-->
91+
<!--custom.instructions.end-->
92+
93+
94+
#### Learn the basics
95+
96+
This example shows you how to do the following:
97+
98+
- Create an Amazon Location map.
99+
- Create an Amazon Location API key.
100+
- Display Map URL.
101+
- Create a geofence collection.
102+
- Store a geofence geometry.
103+
- Create a tracker resource.
104+
- Update the position of a device.
105+
- Retrieve the most recent position update for a specified device.
106+
- Create a route calculator.
107+
- Determine the distance between Seattle and Vancouver.
108+
- Use Amazon Location higher level APIs.
109+
- Delete the Amazon Location Assets.
110+
111+
<!--custom.basic_prereqs.location_Scenario.start-->
112+
<!--custom.basic_prereqs.location_Scenario.end-->
113+
114+
115+
<!--custom.basics.location_Scenario.start-->
116+
<!--custom.basics.location_Scenario.end-->
117+
118+
119+
### Tests
120+
121+
⚠ Running tests might result in charges to your AWS account.
122+
123+
124+
To find instructions for running these tests, see the [README](../../README.md#Tests)
125+
in the `javascriptv3` folder.
126+
127+
128+
129+
<!--custom.tests.start-->
130+
<!--custom.tests.end-->
131+
132+
## Additional resources
133+
134+
- [Amazon Location Developer Guide](https://docs.aws.amazon.com/location/latest/developerguide/what-is.html)
135+
- [Amazon Location API Reference](https://docs.aws.amazon.com/location/latest/APIReference/Welcome.html)
136+
- [SDK for JavaScript (v3) Amazon Location reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/location/)
137+
138+
<!--custom.resources.start-->
139+
<!--custom.resources.end-->
140+
141+
---
142+
143+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
144+
145+
SPDX-License-Identifier: Apache-2.0

0 commit comments

Comments
 (0)