Skip to content

Commit 203821d

Browse files
patrickarltBrunoCaimargavinr-mapssemantic-release-bot
authored
feat(arcgis-rest-places): places api - add icon param
* fix: places api - add icon param * chore: update open API types and doc * docs: update docs with link to spec doc * Update packages/arcgis-rest-places/README.md Co-authored-by: Gavin Rehkemper <[email protected]> * feat: add overwrite and isView options (#1175) added overwrite and isView options to ICreateServiceOptions, per https://developers.arcgis.com/rest/users-groups-and-items/create-service/#request-parameters * chore(release): 4.1.0 [skip ci] # @esri/arcgis-rest-feature-service [4.1.0](https://github.com/Esri/arcgis-rest-js/compare/@esri/[email protected]...@esri/[email protected]) (2024-12-17) ### Features * add overwrite and isView options ([#1175](#1175)) ([949e341](949e341)) * docs: reference correct classes (#1183) * chore: update open API types and doc * docs: update docs with link to spec doc * Update packages/arcgis-rest-places/README.md Co-authored-by: Gavin Rehkemper <[email protected]> * chore: update package-lock for merge --------- Co-authored-by: Bruno Caimar <[email protected]> Co-authored-by: Gavin Rehkemper <[email protected]> Co-authored-by: semantic-release-bot <[email protected]>
1 parent 4982c2e commit 203821d

24 files changed

+9264
-1439
lines changed

demos/node-places-api/categories.mock.json

Lines changed: 4934 additions & 1235 deletions
Large diffs are not rendered by default.

demos/node-places-api/category.mock.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
"fullLabel": [
44
"Arts and Entertainment"
55
],
6-
"parents": []
6+
"parents": [],
7+
"icon": {
8+
"url": "https://static.arcgis.com/icons/places/Default_Arts_and_Entertainment_15.cim"
9+
}
710
}
Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,71 @@
11
{
22
"results": [
33
{
4-
"placeId": "6eb039fa6c292d431b370f8ff9182955",
4+
"placeId": "188ab43b2bec75c6e4f6d5df10afc003",
55
"location": {
6-
"x": -118.001636,
7-
"y": 33.802438
6+
"x": -118.008724,
7+
"y": 33.816751
88
},
99
"categories": [
1010
{
11-
"categoryId": "13043",
12-
"label": "Donut Shop"
11+
"categoryId": "13002",
12+
"label": "Bakery"
1313
},
14+
{
15+
"categoryId": "13065",
16+
"label": "Restaurant"
17+
}
18+
],
19+
"name": "Maxs Baked Goods",
20+
"icon": {
21+
"url": "https://static.arcgis.com/icons/places/Bakery_15.cim"
22+
}
23+
},
24+
{
25+
"placeId": "2a6ddf5433a1c9a664b268adbdcf7559",
26+
"location": {
27+
"x": -118.010416,
28+
"y": 33.825168
29+
},
30+
"categories": [
1431
{
1532
"categoryId": "13001",
1633
"label": "Bagel Shop"
1734
},
35+
{
36+
"categoryId": "13065",
37+
"label": "Restaurant"
38+
},
1839
{
1940
"categoryId": "13002",
2041
"label": "Bakery"
2142
}
2243
],
23-
"name": "Donut King and Water"
44+
"name": "Donut Storr",
45+
"icon": {
46+
"url": "https://static.arcgis.com/icons/places/Bakery_15.cim"
47+
}
2448
},
2549
{
26-
"placeId": "06dc48eba7c1c3106db6a0f498eaf1c7",
50+
"placeId": "c602ca8f1010f95618c231046dbef3f6",
2751
"location": {
28-
"x": -118.001186,
29-
"y": 33.809568
52+
"x": -118.001473,
53+
"y": 33.831684
3054
},
3155
"categories": [
3256
{
3357
"categoryId": "13002",
3458
"label": "Bakery"
3559
},
3660
{
37-
"categoryId": "13303",
38-
"label": "Mexican Restaurant"
61+
"categoryId": "13065",
62+
"label": "Restaurant"
3963
}
4064
],
41-
"name": "Panaderia Cortez"
65+
"name": "Tlaxcala Bakery",
66+
"icon": {
67+
"url": "https://static.arcgis.com/icons/places/Bakery_15.cim"
68+
}
4269
},
4370
{
4471
"placeId": "693a02b6f4c32acf6d1060a164865da4",
@@ -47,20 +74,23 @@
4774
"y": 33.795145
4875
},
4976
"categories": [
50-
{
51-
"categoryId": "13043",
52-
"label": "Donut Shop"
53-
},
5477
{
5578
"categoryId": "13001",
5679
"label": "Bagel Shop"
5780
},
81+
{
82+
"categoryId": "13065",
83+
"label": "Restaurant"
84+
},
5885
{
5986
"categoryId": "13002",
6087
"label": "Bakery"
6188
}
6289
],
63-
"name": "Amy's Donuts"
90+
"name": "Amy's Donuts",
91+
"icon": {
92+
"url": "https://static.arcgis.com/icons/places/Bakery_15.cim"
93+
}
6494
}
6595
]
6696
}

demos/node-places-api/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ApiKeyManager } from "@esri/arcgis-rest-request";
2-
import { getCategories } from "@esri/arcgis-rest-places";
2+
import { getCategories, IconOptions } from "@esri/arcgis-rest-places";
33
import * as dotenv from "dotenv";
44
import fs from "fs";
55
import find from "unist-util-find";
@@ -15,6 +15,7 @@ const authentication = ApiKeyManager.fromKey(process.env.API_KEY);
1515

1616
const { categories } = await getCategories({
1717
endpoint: "https://places-api.arcgis.com/arcgis/rest/services/places-service/v1/categories",
18+
icon: IconOptions.PNG,
1819
authentication
1920
});
2021

@@ -34,6 +35,7 @@ const tree = {
3435
type: "category",
3536
id: c.categoryId,
3637
fullLabel: c.fullLabel || [],
38+
icon: c.icon,
3739
children: []
3840
};
3941
})
@@ -50,6 +52,7 @@ childCategories.reduce((tree, child) => {
5052
type: "category",
5153
id: child.categoryId,
5254
fullLabel: child.fullLabel || [],
55+
icon: child.icon,
5356
children: []
5457
});
5558
return tree;

demos/node-places-api/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import {
44
findPlacesWithinExtent,
55
getPlaceDetails,
66
getCategories,
7-
getCategory
7+
getCategory,
8+
IconOptions
89
} from "@esri/arcgis-rest-places";
910
import * as dotenv from "dotenv";
1011
import fs from "fs";
@@ -17,6 +18,7 @@ let lastResponse = await findPlacesNearPoint({
1718
x: -3.1883,
1819
y: 55.9533,
1920
radius: 100,
21+
icon: IconOptions.PNG,
2022
authentication
2123
});
2224

@@ -40,6 +42,7 @@ const extentResults = await findPlacesWithinExtent({
4042
xmax: -117.995753,
4143
ymax: 33.833337,
4244
categoryIds: ["13002"],
45+
icon: IconOptions.CIM,
4346
authentication
4447
});
4548

@@ -51,6 +54,7 @@ fs.promises.writeFile(
5154
const placeResult = await getPlaceDetails({
5255
placeId: extentResults.results[0].placeId,
5356
requestedFields: ["all"],
57+
icon: IconOptions.SVG,
5458
authentication
5559
});
5660

@@ -83,7 +87,10 @@ if (placeResult.placeDetails.categories) {
8387
);
8488
}
8589

86-
const { categories } = await getCategories({ authentication });
90+
const { categories } = await getCategories({
91+
authentication,
92+
icon: IconOptions.PNG
93+
});
8794

8895
console.log("Found categories: ", categories.length);
8996

@@ -93,6 +100,7 @@ fs.promises.writeFile(
93100
);
94101
const categoryMock = await getCategory({
95102
categoryId: "10000",
103+
icon: IconOptions.CIM,
96104
authentication
97105
});
98106

0 commit comments

Comments
 (0)