Skip to content

Commit 4fda5cc

Browse files
committed
add initial files
1 parent ef08871 commit 4fda5cc

26 files changed

Lines changed: 274 additions & 27 deletions

javascriptv3/example_code/location-services/actions/batch-update-device-position.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const updateDevicePosParams = {
2121
},
2222
],
2323
};
24-
async function main() {
24+
export const main = async () => {
2525
try {
2626
const command = new BatchUpdateDevicePositionCommand(updateDevicePosParams);
2727
const response = await locationClient.send(command);
@@ -34,7 +34,7 @@ async function main() {
3434
} catch (error) {
3535
console.log("error ", error);
3636
}
37-
}
37+
};
3838

3939
// snippet-end:[location.JavaScript.device.batchUpdatePositionV3]
4040

javascriptv3/example_code/location-services/actions/calculate-distance-async.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import data from "./inputs.json" with { type: "json" };
1313
const region = "eu-west-1";
1414
const locationClient = new LocationClient({ region: region });
1515

16-
async function main() {
16+
export const main = async () => {
1717
const routeCalcParams = {
1818
CalculatorName: `${data.inputs.calculatorName}`,
1919
DeparturePosition: [-122.3321, 47.6062],
@@ -37,7 +37,7 @@ async function main() {
3737
return;
3838
}
3939
}
40-
}
40+
};
4141

4242
// snippet-end:[location.JavaScript.distance.createDistAsyncV3]
4343

javascriptv3/example_code/location-services/actions/calculate-route.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const calculateRouteParams = {
1919
TravelMode: "Car",
2020
DistanceUnit: "Kilometers",
2121
};
22-
async function main() {
22+
export const main = async () => {
2323
try {
2424
const command = new CalculateRouteCommand(calculateRouteParams);
2525
const response = await locationClient.send(command);
@@ -36,7 +36,7 @@ async function main() {
3636
return;
3737
}
3838
}
39-
}
39+
};
4040

4141
// snippet-end:[location.JavaScript.CalculateRouteV3]
4242

javascriptv3/example_code/location-services/actions/create-geofence-collection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import data from "./inputs.json" with { type: "json" };
1212

1313
const region = "eu-west-1";
1414

15-
async function main() {
15+
export const main = async () => {
1616
const geoFenceCollParams = {
1717
CollectionName: `${data.inputs.collectionName}`,
1818
};
@@ -30,7 +30,7 @@ async function main() {
3030
return;
3131
}
3232
}
33-
}
33+
};
3434

3535
// snippet-end:[location.JavaScript.geofence.createCollectionV3]
3636

javascriptv3/example_code/location-services/actions/create-map.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import data from "./inputs.json" with { type: "json" };
88

99
const region = "eu-west-1";
1010

11-
async function main() {
11+
export const main = async () => {
1212
const CreateMapCommandInput = {
1313
MapName: `${data.inputs.mapName}`,
1414
Configuration: { style: "VectorEsriNavigation" },
@@ -22,7 +22,7 @@ async function main() {
2222
console.error("Error creating map: ", error);
2323
throw error;
2424
}
25-
}
25+
};
2626

2727
// snippet-end:[location.JavaScript.map.createMapV3]
2828

javascriptv3/example_code/location-services/actions/create-route-calculator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import data from "./inputs.json" with { type: "json" };
1313
const region = "eu-west-1";
1414
const locationClient = new LocationClient({ region: region });
1515

16-
async function main() {
16+
export const main = async () => {
1717
const routeCalcParams = {
1818
CalculatorName: `${data.inputs.calculatorName}`,
1919
DataSource: "Esri",
@@ -34,7 +34,7 @@ async function main() {
3434
return;
3535
}
3636
}
37-
}
37+
};
3838

3939
// snippet-end:[location.JavaScript.routes.createRouteCalcV3]
4040

javascriptv3/example_code/location-services/actions/create-tracker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import data from "./inputs.json" with { type: "json" };
88

99
const region = "eu-west-1";
1010

11-
async function main() {
11+
export const main = async () => {
1212
const createTrackerParams = {
1313
TrackerName: `${data.inputs.trackerName}`,
1414
};
@@ -22,7 +22,7 @@ async function main() {
2222
console.error("Error creating map: ", error);
2323
throw error;
2424
}
25-
}
25+
};
2626

2727
// snippet-end:[location.JavaScript.tracker.createTrackerV3]
2828

javascriptv3/example_code/location-services/actions/delete-geofence-collection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import data from "./inputs.json" with { type: "json" };
1212

1313
const region = "eu-west-1";
1414

15-
async function main() {
15+
export const main = async () => {
1616
const deleteGeofenceCollParams = {
1717
CollectionName: `${data.inputs.collectionName}`,
1818
};
@@ -31,7 +31,7 @@ async function main() {
3131
return;
3232
}
3333
}
34-
}
34+
};
3535

3636
// snippet-end:[location.JavaScript.geofence.deleteCollectionV3]
3737

javascriptv3/example_code/location-services/actions/delete-map.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import data from "./inputs.json" with { type: "json" };
1212

1313
const region = "eu-west-1";
1414

15-
async function main() {
15+
export const main = async () => {
1616
const deleteMapParams = {
1717
MapName: `${data.inputs.mapName}`,
1818
};
@@ -27,7 +27,7 @@ async function main() {
2727
return;
2828
}
2929
}
30-
}
30+
};
3131

3232
// snippet-end:[location.JavaScript.geofence.deleteMapV3]
3333

javascriptv3/example_code/location-services/actions/delete-route-calculator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import data from "./inputs.json" with { type: "json" };
1212

1313
const region = "eu-west-1";
1414

15-
async function main() {
15+
export const main = async () => {
1616
const deleteRouteCalculatorParams = {
1717
CalculatorName: `${data.inputs.calculatorName}`,
1818
};
@@ -31,7 +31,7 @@ async function main() {
3131
return;
3232
}
3333
}
34-
}
34+
};
3535

3636
// snippet-end:[location.JavaScript.calculator.deleteRouteCalculatorV3]
3737

0 commit comments

Comments
 (0)