@esri/solutions-components 0.6.16 → 0.6.18
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/assets/t9n/map-tools/resources.json +2 -1
- package/dist/assets/t9n/map-tools/resources_en.json +2 -1
- package/dist/assets/t9n/solution-spatial-ref/resources.json +0 -1
- package/dist/assets/t9n/solution-spatial-ref/resources_en.json +0 -1
- package/dist/assets/t9n/solution-spatial-ref/resources_fr.json +6 -0
- package/dist/assets/t9n/solution-spatial-ref/resources_he.json +6 -0
- package/dist/assets/t9n/spatial-ref/resources.json +3 -0
- package/dist/assets/t9n/spatial-ref/resources_en.json +3 -0
- package/dist/assets/t9n/spatial-ref/resources_fr.json +3 -0
- package/dist/assets/t9n/spatial-ref/resources_he.json +3 -0
- package/dist/cjs/{basemap-gallery_6.cjs.entry.js → basemap-gallery_7.cjs.entry.js} +124 -3
- package/dist/cjs/{calcite-tree_3.cjs.entry.js → calcite-checkbox_3.cjs.entry.js} +123 -319
- package/dist/cjs/calcite-combobox_6.cjs.entry.js +1 -1
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +4 -3
- package/dist/cjs/card-manager_3.cjs.entry.js +10 -7
- package/dist/{collection/components/basemap-gallery/test/basemap-gallery.e2e.js → cjs/common-13719149.js} +17 -9
- package/dist/cjs/crowdsource-manager.cjs.entry.js +12 -7
- package/dist/cjs/{downloadUtils-34a515ad.js → downloadUtils-121fd7ff.js} +2 -2
- package/dist/cjs/edit-card_2.cjs.entry.js +4 -3
- package/dist/cjs/{index.es-0ba11065.js → index.es-5c0c137a.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
- package/dist/cjs/{mapViewUtils-a2884698.js → mapViewUtils-786a219b.js} +32 -19
- package/dist/cjs/public-notification.cjs.entry.js +2 -2
- package/dist/cjs/solution-configuration.cjs.entry.js +2 -1
- package/dist/cjs/solution-contents_3.cjs.entry.js +21 -21256
- package/dist/cjs/solution-item-icon.cjs.entry.js +327 -0
- package/dist/cjs/{solution-store-c443e657.js → solution-resource-f9e3b289.js} +2 -1698
- package/dist/cjs/solution-store-2414dd8a.js +1707 -0
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/cjs/spatial-ref.cjs.entry.js +21293 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/card-manager/card-manager.js +1 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +17 -2
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +47 -6
- package/dist/collection/components/edit-card/edit-card.css +0 -8
- package/dist/collection/components/floor-filter/floor-filter.css +19 -0
- package/dist/collection/components/floor-filter/floor-filter.js +163 -0
- package/dist/collection/components/info-card/info-card.js +3 -2
- package/dist/collection/components/layer-table/layer-table.css +8 -0
- package/dist/collection/components/layer-table/layer-table.js +18 -2
- package/dist/collection/components/map-card/map-card.js +19 -1
- package/dist/collection/components/map-picker/map-picker.css +0 -4
- package/dist/collection/components/map-picker/map-picker.js +1 -1
- package/dist/collection/components/map-tools/map-tools.js +54 -1
- package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.css +1 -7
- package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +37 -291
- package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.e2e.js +24 -12
- package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.spec.js +32 -128
- package/dist/collection/components/spatial-ref/spatial-ref.css +20 -0
- package/dist/collection/components/spatial-ref/spatial-ref.js +445 -0
- package/dist/collection/components/spatial-ref/test/spatial-ref.e2e.js +71 -0
- package/dist/collection/components/spatial-ref/test/spatial-ref.spec.js +158 -0
- package/dist/collection/demos/crowdsource-manager.html +4 -0
- package/dist/collection/demos/solution-spatial-ref.html +9 -16
- package/dist/collection/demos/spatial-ref.html +53 -0
- package/dist/collection/utils/mapViewUtils.js +32 -19
- package/dist/collection/utils/mapViewUtils.ts +43 -20
- package/dist/collection/utils/{templates.e2e.js → test/templates.e2e.js} +2 -2
- package/dist/collection/utils/{templates.e2e.ts → test/templates.e2e.ts} +2 -2
- package/dist/components/card-manager2.js +1 -1
- package/dist/components/crowdsource-manager.js +86 -73
- package/dist/components/edit-card2.js +1 -1
- package/dist/components/floor-filter.d.ts +11 -0
- package/dist/components/floor-filter.js +11 -0
- package/dist/components/floor-filter2.js +115 -0
- package/dist/components/info-card2.js +3 -2
- package/dist/components/layer-table2.js +5 -3
- package/dist/components/map-card2.js +45 -37
- package/dist/components/map-picker2.js +2 -2
- package/dist/components/map-tools2.js +52 -11
- package/dist/components/mapViewUtils.js +32 -19
- package/dist/components/solution-configuration.js +79 -72
- package/dist/components/solution-resource-item2.js +2 -1
- package/dist/components/solution-resource.js +1836 -0
- package/dist/components/solution-spatial-ref2.js +41 -21277
- package/dist/components/solution-store.js +2 -1830
- package/dist/components/spatial-ref.d.ts +11 -0
- package/dist/components/spatial-ref.js +11 -0
- package/dist/components/spatial-ref2.js +21374 -0
- package/dist/esm/{basemap-gallery_6.entry.js → basemap-gallery_7.entry.js} +124 -4
- package/dist/esm/{calcite-tree_3.entry.js → calcite-checkbox_3.entry.js} +125 -321
- package/dist/esm/calcite-combobox_6.entry.js +1 -1
- package/dist/esm/calcite-shell-panel_14.entry.js +2 -1
- package/dist/esm/card-manager_3.entry.js +10 -7
- package/dist/{collection/components/layer-table/test/layer-table.e2e.js → esm/common-e4a8e353.js} +15 -9
- package/dist/esm/crowdsource-manager.entry.js +12 -7
- package/dist/esm/{downloadUtils-ac67a786.js → downloadUtils-287994b1.js} +2 -2
- package/dist/esm/edit-card_2.entry.js +4 -3
- package/dist/esm/{index.es-f553598f.js → index.es-a3f8409f.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +2 -2
- package/dist/esm/{mapViewUtils-8141d8c1.js → mapViewUtils-8bfabd80.js} +32 -19
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solution-configuration.entry.js +2 -1
- package/dist/esm/solution-contents_3.entry.js +20 -21255
- package/dist/esm/solution-item-icon.entry.js +323 -0
- package/dist/esm/{solution-store-b29d50f7.js → solution-resource-be35d35b.js} +1 -1697
- package/dist/esm/solution-store-e734626a.js +1704 -0
- package/dist/esm/solutions-components.js +1 -1
- package/dist/esm/spatial-ref.entry.js +21289 -0
- package/dist/solutions-components/demos/crowdsource-manager.html +4 -0
- package/dist/solutions-components/demos/solution-spatial-ref.html +9 -16
- package/dist/solutions-components/demos/spatial-ref.html +53 -0
- package/dist/solutions-components/{p-64d29ba2.entry.js → p-0bc27ba7.entry.js} +2 -2
- package/dist/{collection/components/map-card/test/map-card.e2e.js → solutions-components/p-1b228f97.js} +2 -10
- package/dist/solutions-components/{p-9f11a403.entry.js → p-3c5c1487.entry.js} +1 -1
- package/dist/solutions-components/{p-a26711e8.js → p-469c8f8a.js} +1 -1
- package/dist/solutions-components/p-53bc5fc1.js +36 -0
- package/dist/solutions-components/p-5b8c8942.entry.js +21 -0
- package/dist/solutions-components/p-63c6fc29.entry.js +6 -0
- package/dist/solutions-components/p-64945b43.entry.js +18 -0
- package/dist/solutions-components/{p-c8d0ce92.js → p-698c6a56.js} +2 -2
- package/dist/solutions-components/{p-b9d29f30.entry.js → p-734cb206.entry.js} +1 -1
- package/dist/solutions-components/p-770bff06.entry.js +6 -0
- package/dist/solutions-components/p-7741dbab.entry.js +6 -0
- package/dist/solutions-components/p-80465067.entry.js +6 -0
- package/dist/solutions-components/p-846df994.entry.js +6 -0
- package/dist/solutions-components/p-b3f8d2cb.js +192 -0
- package/dist/solutions-components/p-c26d8b36.entry.js +6 -0
- package/dist/solutions-components/{p-57cf6784.entry.js → p-d22be647.entry.js} +1 -1
- package/dist/solutions-components/{p-4d942b0f.entry.js → p-f35147d5.entry.js} +1 -1
- package/dist/solutions-components/p-ff0d7712.js +44 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/mapViewUtils.ts +43 -20
- package/dist/solutions-components/utils/{templates.e2e.ts → test/templates.e2e.ts} +2 -2
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +9 -1
- package/dist/types/components/floor-filter/floor-filter.d.ts +61 -0
- package/dist/types/components/layer-table/layer-table.d.ts +4 -0
- package/dist/types/components/map-card/map-card.d.ts +4 -0
- package/dist/types/components/map-tools/map-tools.d.ts +24 -0
- package/dist/types/components/solution-spatial-ref/solution-spatial-ref.d.ts +11 -93
- package/dist/types/components/spatial-ref/spatial-ref.d.ts +142 -0
- package/dist/types/components.d.ts +123 -16
- package/dist/types/preact.d.ts +8 -1
- package/package.json +6 -6
- package/dist/cjs/calcite-checkbox.cjs.entry.js +0 -136
- package/dist/collection/components/basemap-gallery/test/basemap-gallery.spec.js +0 -37
- package/dist/collection/components/buffer-tools/test/buffer-tools.e2e.js +0 -29
- package/dist/collection/components/buffer-tools/test/buffer-tools.spec.js +0 -160
- package/dist/collection/components/card-manager/test/card-manager.e2e.js +0 -29
- package/dist/collection/components/card-manager/test/card-manager.spec.js +0 -37
- package/dist/collection/components/crowdsource-manager/test/crowdsource-manager.e2e.js +0 -29
- package/dist/collection/components/crowdsource-manager/test/crowdsource-manager.spec.js +0 -37
- package/dist/collection/components/crowdsource-reporter/test/crowdsource-reporter.e2e.js +0 -29
- package/dist/collection/components/crowdsource-reporter/test/crowdsource-reporter.spec.js +0 -37
- package/dist/collection/components/deduct-calculator/test/deduct-calculator.e2e.js +0 -29
- package/dist/collection/components/deduct-calculator/test/deduct-calculator.spec.js +0 -37
- package/dist/collection/components/edit-card/test/edit-card.e2e.js +0 -14
- package/dist/collection/components/edit-card/test/edit-card.spec.js +0 -22
- package/dist/collection/components/info-card/test/info-card.e2e.js +0 -29
- package/dist/collection/components/info-card/test/info-card.spec.js +0 -37
- package/dist/collection/components/json-editor/test/json-editor.e2e.js +0 -36
- package/dist/collection/components/json-editor/test/json-editor.spec.js +0 -65
- package/dist/collection/components/layer-table/test/layer-table.spec.js +0 -37
- package/dist/collection/components/layout-manager/test/layout-manager.e2e.js +0 -29
- package/dist/collection/components/layout-manager/test/layout-manager.spec.js +0 -37
- package/dist/collection/components/list-item/test/list-item.e2e.js +0 -29
- package/dist/collection/components/list-item/test/list-item.spec.js +0 -37
- package/dist/collection/components/map-card/test/map-card.spec.js +0 -37
- package/dist/collection/components/map-draw-tools/test/map-draw-tools.e2e.js +0 -29
- package/dist/collection/components/map-draw-tools/test/map-draw-tools.spec.js +0 -37
- package/dist/collection/components/map-fullscreen/test/map-fullscreen.e2e.js +0 -29
- package/dist/collection/components/map-fullscreen/test/map-fullscreen.spec.js +0 -37
- package/dist/collection/components/map-layer-picker/test/map-layer-picker.e2e.js +0 -29
- package/dist/collection/components/map-layer-picker/test/map-layer-picker.spec.js +0 -114
- package/dist/collection/components/map-legend/test/map-legend.e2e.js +0 -14
- package/dist/collection/components/map-legend/test/map-legend.spec.js +0 -22
- package/dist/collection/components/map-picker/test/map-picker.e2e.js +0 -29
- package/dist/collection/components/map-picker/test/map-picker.spec.js +0 -37
- package/dist/collection/components/map-search/test/map-search.e2e.js +0 -29
- package/dist/collection/components/map-search/test/map-search.spec.js +0 -37
- package/dist/collection/components/map-select-tools/test/map-select-tools.e2e.js +0 -29
- package/dist/collection/components/map-select-tools/test/map-select-tools.spec.js +0 -366
- package/dist/collection/components/map-tools/test/map-tools.e2e.js +0 -29
- package/dist/collection/components/map-tools/test/map-tools.spec.js +0 -37
- package/dist/collection/components/pci-calculator/test/pci-calculator.e2e.js +0 -29
- package/dist/collection/components/pci-calculator/test/pci-calculator.spec.js +0 -37
- package/dist/collection/components/pdf-download/test/pdf-download.e2e.js +0 -76
- package/dist/collection/components/pdf-download/test/pdf-download.spec.js +0 -107
- package/dist/collection/components/public-notification/test/public-notification.spec.js +0 -161
- package/dist/collection/components/refine-selection/test/refine-selection.e2e.js +0 -14
- package/dist/collection/components/refine-selection/test/refine-selection.spec.js +0 -22
- package/dist/collection/components/solution-configuration/test/solution-configuration.e2e.js +0 -36
- package/dist/collection/components/solution-configuration/test/solution-configuration.spec.js +0 -119
- package/dist/collection/components/solution-contents/test/solution-contents.e2e.js +0 -94
- package/dist/collection/components/solution-contents/test/solution-contents.spec.js +0 -143
- package/dist/collection/components/solution-item/test/solution-item.e2e.js +0 -36
- package/dist/collection/components/solution-item/test/solution-item.spec.js +0 -77
- package/dist/collection/components/solution-item-details/test/solution-item-details.e2e.js +0 -36
- package/dist/collection/components/solution-item-details/test/solution-item-details.spec.js +0 -142
- package/dist/collection/components/solution-item-icon/test/solution-item-icon.e2e.js +0 -29
- package/dist/collection/components/solution-item-icon/test/solution-item-icon.spec.js +0 -39
- package/dist/collection/components/solution-item-sharing/test/solution-item-sharing.e2e.js +0 -36
- package/dist/collection/components/solution-item-sharing/test/solution-item-sharing.spec.js +0 -54
- package/dist/collection/components/solution-organization-variables/test/solution-organization-variables.e2e.js +0 -36
- package/dist/collection/components/solution-organization-variables/test/solution-organization-variables.spec.js +0 -65
- package/dist/collection/components/solution-resource-item/test/solution-resource-item.e2e.js +0 -36
- package/dist/collection/components/solution-resource-item/test/solution-resource-item.spec.js +0 -55
- package/dist/collection/components/solution-template-data/test/solution-template-data.e2e.js +0 -36
- package/dist/collection/components/solution-template-data/test/solution-template-data.spec.js +0 -60
- package/dist/collection/components/solution-variables/test/solution-variables.e2e.js +0 -36
- package/dist/collection/components/solution-variables/test/solution-variables.spec.js +0 -131
- package/dist/esm/calcite-checkbox.entry.js +0 -132
- package/dist/solutions-components/p-07d7e11f.entry.js +0 -6
- package/dist/solutions-components/p-16362eb4.js +0 -36
- package/dist/solutions-components/p-17d176b5.js +0 -230
- package/dist/solutions-components/p-1d9a5198.entry.js +0 -37
- package/dist/solutions-components/p-3707d9bd.entry.js +0 -6
- package/dist/solutions-components/p-4dbe8337.entry.js +0 -6
- package/dist/solutions-components/p-5ffaaaf4.entry.js +0 -6
- package/dist/solutions-components/p-736e76fb.entry.js +0 -17
- package/dist/solutions-components/p-99f1a767.entry.js +0 -6
- /package/dist/collection/components/{solution-spatial-ref → spatial-ref}/spatialreferences.js +0 -0
- /package/dist/types/components/{solution-spatial-ref → spatial-ref}/spatialreferences.d.ts +0 -0
@@ -0,0 +1,71 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
/** @license
|
7
|
+
* Copyright 2022 Esri
|
8
|
+
*
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
* you may not use this file except in compliance with the License.
|
11
|
+
* You may obtain a copy of the License at
|
12
|
+
*
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
*
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
* See the License for the specific language governing permissions and
|
19
|
+
* limitations under the License.
|
20
|
+
*/
|
21
|
+
import { newE2EPage } from "@stencil/core/testing";
|
22
|
+
describe('spatial-ref', () => {
|
23
|
+
let page;
|
24
|
+
beforeEach(async () => {
|
25
|
+
page = await newE2EPage();
|
26
|
+
});
|
27
|
+
it('renders', async () => {
|
28
|
+
await page.setContent('<spatial-ref/>');
|
29
|
+
const spatial_ref = await page.find('spatial-ref');
|
30
|
+
expect(spatial_ref).toHaveClass('hydrated');
|
31
|
+
expect(await spatial_ref.getProperty('defaultWkid')).toBe(102100);
|
32
|
+
expect(await spatial_ref.getProperty('value')).toBe('102100');
|
33
|
+
});
|
34
|
+
it('select first value after typing in search field', async () => {
|
35
|
+
await page.setContent('<spatial-ref/>');
|
36
|
+
const spatial_ref = await page.find('spatial-ref');
|
37
|
+
expect(await spatial_ref.getProperty('value')).toBe('102100');
|
38
|
+
const input = await page.find('calcite-input >>> input');
|
39
|
+
await input.focus();
|
40
|
+
await page.keyboard.type('wyoming');
|
41
|
+
await page.waitForChanges();
|
42
|
+
await page.keyboard.press('Enter');
|
43
|
+
await page.waitForChanges();
|
44
|
+
expect(await spatial_ref.getProperty('value')).toBe('2862');
|
45
|
+
});
|
46
|
+
xit('select tabbed-to value after typing in search field', async () => {
|
47
|
+
await page.setContent('<spatial-ref/>');
|
48
|
+
const spatial_ref = await page.find('spatial-ref');
|
49
|
+
expect(await spatial_ref.getProperty('value')).toBe('102100');
|
50
|
+
const input = await page.find('calcite-input >>> input');
|
51
|
+
await input.focus();
|
52
|
+
await page.keyboard.type('wyoming');
|
53
|
+
await page.waitForChanges();
|
54
|
+
// Enter the list of suggested projections
|
55
|
+
await page.keyboard.press('Tab');
|
56
|
+
await page.waitForChanges();
|
57
|
+
// And tab down to one of them
|
58
|
+
await page.keyboard.press('Tab');
|
59
|
+
await page.waitForChanges();
|
60
|
+
await page.keyboard.press('Tab');
|
61
|
+
await page.waitForChanges();
|
62
|
+
await page.keyboard.press('Tab');
|
63
|
+
await page.waitForChanges();
|
64
|
+
// Select it, and use second selection to make it the current projection
|
65
|
+
await page.keyboard.press('Enter');
|
66
|
+
await page.waitForChanges();
|
67
|
+
await page.keyboard.press('Enter');
|
68
|
+
await page.waitForChanges();
|
69
|
+
expect(await spatial_ref.getProperty('value')).toBe('2865');
|
70
|
+
});
|
71
|
+
});
|
@@ -0,0 +1,158 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
/** @license
|
7
|
+
* Copyright 2022 Esri
|
8
|
+
*
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
* you may not use this file except in compliance with the License.
|
11
|
+
* You may obtain a copy of the License at
|
12
|
+
*
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
*
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
* See the License for the specific language governing permissions and
|
19
|
+
* limitations under the License.
|
20
|
+
*/
|
21
|
+
import * as locale from "../../../utils/locale";
|
22
|
+
import { h } from "@stencil/core";
|
23
|
+
import { newSpecPage } from "@stencil/core/testing";
|
24
|
+
import { SpatialRef } from "../spatial-ref";
|
25
|
+
describe('spatial-ref', () => {
|
26
|
+
beforeEach(() => {
|
27
|
+
jest.spyOn(locale, 'getLocaleComponentStrings').mockImplementation(() => Promise.resolve([{ "spatialReferencePlaceholder": "Search for spatial reference using name or WKID" }, "en"]));
|
28
|
+
});
|
29
|
+
afterEach(() => {
|
30
|
+
jest.clearAllMocks();
|
31
|
+
});
|
32
|
+
it('renders', async () => {
|
33
|
+
const page = await newSpecPage({
|
34
|
+
components: [SpatialRef],
|
35
|
+
supportsShadowDom: false,
|
36
|
+
template: () => (h("spatial-ref", null))
|
37
|
+
});
|
38
|
+
expect(page.root).toEqualHtml(`
|
39
|
+
<spatial-ref default-wkid="102100" value="102100">
|
40
|
+
<div>
|
41
|
+
<calcite-input id="calcite-sr-search" placeholder="Search for spatial reference using name or WKID"></calcite-input>
|
42
|
+
<calcite-tree id="calcite-sr-tree" slot="children">
|
43
|
+
<div class="spatial-ref-container" id="solution-wkid-container">
|
44
|
+
<calcite-tree-item aria-selected="" id="102100" selected="">
|
45
|
+
<div>
|
46
|
+
WGS 1984 Web Mercator Auxiliary Sphere (102100)
|
47
|
+
</div>
|
48
|
+
</calcite-tree-item>
|
49
|
+
</div>
|
50
|
+
</calcite-tree>
|
51
|
+
</div>
|
52
|
+
</spatial-ref>
|
53
|
+
`);
|
54
|
+
});
|
55
|
+
it('creates description for known WKID', async () => {
|
56
|
+
await newSpecPage({
|
57
|
+
components: [SpatialRef],
|
58
|
+
template: () => (h("spatial-ref", null))
|
59
|
+
});
|
60
|
+
const component = document.querySelector('spatial-ref');
|
61
|
+
component.wkidToDisplay(4326)
|
62
|
+
.then(result => expect(result).toEqual('GCS WGS 1984 (4326)'));
|
63
|
+
});
|
64
|
+
it('creates description for unknown WKID', async () => {
|
65
|
+
await newSpecPage({
|
66
|
+
components: [SpatialRef],
|
67
|
+
template: () => (h("spatial-ref", null))
|
68
|
+
});
|
69
|
+
const component = document.querySelector('spatial-ref');
|
70
|
+
component.wkidToDisplay(0)
|
71
|
+
.then(result => expect(result).toEqual('WKID 0'));
|
72
|
+
});
|
73
|
+
it('creates description for default component value', async () => {
|
74
|
+
await newSpecPage({
|
75
|
+
components: [SpatialRef],
|
76
|
+
template: () => (h("spatial-ref", null))
|
77
|
+
});
|
78
|
+
const component = document.querySelector('spatial-ref');
|
79
|
+
component.createSpatialRefDisplay(null)
|
80
|
+
.then(result => {
|
81
|
+
expect(result.display).toEqual('WGS 1984 Web Mercator Auxiliary Sphere (102100)');
|
82
|
+
expect(result.usingWkid).toBeTruthy();
|
83
|
+
expect(result.wkid).toEqual(102100);
|
84
|
+
expect(result.wkt).toEqual('');
|
85
|
+
});
|
86
|
+
});
|
87
|
+
it('creates description for WKID component value', async () => {
|
88
|
+
await newSpecPage({
|
89
|
+
components: [SpatialRef],
|
90
|
+
template: () => (h("spatial-ref", null))
|
91
|
+
});
|
92
|
+
const component = document.querySelector('spatial-ref');
|
93
|
+
component.createSpatialRefDisplay("4151")
|
94
|
+
.then(result => {
|
95
|
+
expect(result.display).toEqual('GCS Swiss TRF 1995 (4151)');
|
96
|
+
expect(result.usingWkid).toBeTruthy();
|
97
|
+
expect(result.wkid).toEqual(4151);
|
98
|
+
expect(result.wkt).toEqual('');
|
99
|
+
});
|
100
|
+
});
|
101
|
+
it('creates description for WKT component value', async () => {
|
102
|
+
await newSpecPage({
|
103
|
+
components: [SpatialRef],
|
104
|
+
template: () => (h("spatial-ref", null))
|
105
|
+
});
|
106
|
+
const component = document.querySelector('spatial-ref');
|
107
|
+
component.createSpatialRefDisplay('PROJCS["Germany_Zone_5",GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",DATUM["D_Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",5500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]')
|
108
|
+
.then(result => {
|
109
|
+
expect(result.display).toEqual('PROJCS["Germany_Zone_5",GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",DATUM["D_Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",5500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]');
|
110
|
+
expect(result.usingWkid).toBeFalsy();
|
111
|
+
expect(result.wkid).toEqual(0);
|
112
|
+
expect(result.wkt).toEqual('PROJCS["Germany_Zone_5",GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",DATUM["D_Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",5500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]');
|
113
|
+
});
|
114
|
+
});
|
115
|
+
it('sets default component value', async () => {
|
116
|
+
await newSpecPage({
|
117
|
+
components: [SpatialRef],
|
118
|
+
template: () => (h("spatial-ref", null))
|
119
|
+
});
|
120
|
+
const component = document.querySelector('spatial-ref');
|
121
|
+
component.getSpatialRef()
|
122
|
+
.then(result => {
|
123
|
+
expect(result.display).toEqual('WGS 1984 Web Mercator Auxiliary Sphere (102100)');
|
124
|
+
expect(result.usingWkid).toBeTruthy();
|
125
|
+
expect(result.wkid).toEqual(102100);
|
126
|
+
expect(result.wkt).toEqual('');
|
127
|
+
});
|
128
|
+
});
|
129
|
+
it('sets WKID component value', async () => {
|
130
|
+
await newSpecPage({
|
131
|
+
components: [SpatialRef],
|
132
|
+
template: () => (h("spatial-ref", { value: "4151" }))
|
133
|
+
});
|
134
|
+
const component = document.querySelector('spatial-ref');
|
135
|
+
component.getSpatialRef()
|
136
|
+
.then(result => {
|
137
|
+
expect(result.display).toEqual('GCS Swiss TRF 1995 (4151)');
|
138
|
+
expect(result.usingWkid).toBeTruthy();
|
139
|
+
expect(result.wkid).toEqual(4151);
|
140
|
+
expect(result.wkt).toEqual('');
|
141
|
+
});
|
142
|
+
});
|
143
|
+
it('sets WKT component value', async () => {
|
144
|
+
const v = `PROJCS["Germany_Zone_5",GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",DATUM["D_Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",5500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]`;
|
145
|
+
await newSpecPage({
|
146
|
+
components: [SpatialRef],
|
147
|
+
template: () => (h("spatial-ref", { value: v }))
|
148
|
+
});
|
149
|
+
const component = document.querySelector('spatial-ref');
|
150
|
+
component.getSpatialRef()
|
151
|
+
.then(result => {
|
152
|
+
expect(result.display).toEqual(v);
|
153
|
+
expect(result.usingWkid).toBeFalsy();
|
154
|
+
expect(result.wkid).toEqual(0);
|
155
|
+
expect(result.wkt).toEqual(v);
|
156
|
+
});
|
157
|
+
});
|
158
|
+
});
|
@@ -85,6 +85,7 @@
|
|
85
85
|
...[{
|
86
86
|
id: "ce3dec81bf714d3bb71da9691ab686d1",
|
87
87
|
name: "Popup Configured Map",
|
88
|
+
// filters: {},
|
88
89
|
// layerInfos: [{
|
89
90
|
// id: "Requests_681",
|
90
91
|
// columnTemplates: [{
|
@@ -122,6 +123,9 @@
|
|
122
123
|
}, {
|
123
124
|
id: "f5b01c17a09941eaad63e7b4e6c7d880",
|
124
125
|
name: "Attachments Map"
|
126
|
+
}, {
|
127
|
+
id: "b422923b7a4c4958b9788118255f2f0a",
|
128
|
+
name: "Floor aware map"
|
125
129
|
}]
|
126
130
|
];
|
127
131
|
}
|
@@ -19,44 +19,37 @@
|
|
19
19
|
| See the License for the specific language governing permissions and
|
20
20
|
| limitations under the License.
|
21
21
|
-->
|
22
|
-
|
23
22
|
<link rel="stylesheet" href="https://unpkg.com/@esri/calcite-components@1.0.0-beta.97/dist/calcite/calcite.css" type="text/css" />
|
24
23
|
<link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
|
25
24
|
<link rel="stylesheet" href="../solutions-components.css" type="text/css">
|
26
25
|
<style>
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
.content {
|
27
|
+
padding: 20px;
|
28
|
+
}
|
29
|
+
.full-height {
|
30
|
+
height: calc(100% - 40px);
|
31
|
+
}
|
30
32
|
</style>
|
31
|
-
|
32
33
|
<script type="module" src="https://unpkg.com/@esri/calcite-components@1.0.0-beta.97/dist/calcite/calcite.esm.js"></script>
|
33
34
|
<script type="module" src="../solutions-components.esm.js"></script>
|
34
35
|
</head>
|
35
|
-
|
36
36
|
<body>
|
37
37
|
<h1>Demo Solution Spatial Reference</h1>
|
38
38
|
<main id="appContainer">
|
39
39
|
<div class="content full-height">
|
40
40
|
<store-manager id="helper"></store-manager>
|
41
|
-
<solution-spatial-ref id="demo"
|
41
|
+
<solution-spatial-ref id="demo"/>
|
42
42
|
</div>
|
43
43
|
</main>
|
44
44
|
|
45
45
|
<script src="./libs/require.js"></script>
|
46
46
|
<script src="./libs/setLocale.js"></script>
|
47
47
|
<script>
|
48
|
-
require([],
|
48
|
+
require([], // for loading i18n in setLocale
|
49
49
|
function () {
|
50
|
-
// Initialize the configuration content
|
51
|
-
const demo = document.getElementById("demo");
|
52
|
-
|
53
|
-
window.addEventListener("stateLoaded", (r) => {
|
54
|
-
demo.services = r.detail.featureServices.map(fs => fs.name);
|
55
|
-
document.getElementById("appContainer").style.opacity = "1";
|
56
|
-
});
|
57
|
-
|
58
50
|
fetch("./data/election-outreach.json").then(result => {
|
59
51
|
result.json().then(data => {
|
52
|
+
document.getElementById("appContainer").style.opacity = "1";
|
60
53
|
const helper = document.getElementById("helper");
|
61
54
|
helper.value = JSON.stringify(data.templates);
|
62
55
|
});
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html dir="ltr" lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
|
6
|
+
<title>Spatial Reference</title>
|
7
|
+
<!--
|
8
|
+
| Copyright 2022 Esri
|
9
|
+
|
|
10
|
+
| Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
| you may not use this file except in compliance with the License.
|
12
|
+
| You may obtain a copy of the License at
|
13
|
+
|
|
14
|
+
| http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
|
16
|
+
| Unless required by applicable law or agreed to in writing, software
|
17
|
+
| distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
| See the License for the specific language governing permissions and
|
20
|
+
| limitations under the License.
|
21
|
+
-->
|
22
|
+
<link rel="stylesheet" href="https://unpkg.com/@esri/calcite-components@1.0.0-beta.97/dist/calcite/calcite.css" type="text/css" />
|
23
|
+
<link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
|
24
|
+
<link rel="stylesheet" href="../solutions-components.css" type="text/css">
|
25
|
+
<style>
|
26
|
+
.content {
|
27
|
+
padding: 20px;
|
28
|
+
}
|
29
|
+
.full-height {
|
30
|
+
height: calc(100% - 40px);
|
31
|
+
}
|
32
|
+
</style>
|
33
|
+
<script type="module" src="https://unpkg.com/@esri/calcite-components@1.0.0-beta.97/dist/calcite/calcite.esm.js"></script>
|
34
|
+
<script type="module" src="../solutions-components.esm.js"></script>
|
35
|
+
</head>
|
36
|
+
<body>
|
37
|
+
<h1>Demo Spatial Reference</h1>
|
38
|
+
<main id="appContainer">
|
39
|
+
<div class="content full-height">
|
40
|
+
<spatial-ref id="demo"/>
|
41
|
+
</div>
|
42
|
+
</main>
|
43
|
+
|
44
|
+
<script src="./libs/require.js"></script>
|
45
|
+
<script src="./libs/setLocale.js"></script>
|
46
|
+
<script>
|
47
|
+
require([], // for loading i18n in setLocale
|
48
|
+
function () {
|
49
|
+
document.getElementById("appContainer").style.opacity = "1";
|
50
|
+
});
|
51
|
+
</script>
|
52
|
+
</body>
|
53
|
+
</html>
|
@@ -42,16 +42,7 @@ export async function getMapLayerHash(mapView, onlyShowUpdatableLayers) {
|
|
42
42
|
return prev;
|
43
43
|
}, {});
|
44
44
|
});
|
45
|
-
return onlyShowUpdatableLayers
|
46
|
-
const layer = await getLayerOrTable(mapView, cur);
|
47
|
-
await layer.when(() => {
|
48
|
-
prev[cur] = {
|
49
|
-
name: layerHash[cur].name,
|
50
|
-
supportsUpdate: layer.editingEnabled && layer.capabilities.operations.supportsUpdate
|
51
|
-
};
|
52
|
-
});
|
53
|
-
return prev;
|
54
|
-
}, {}) : layerHash;
|
45
|
+
return _getFinalHash(onlyShowUpdatableLayers, layerHash, mapView);
|
55
46
|
}
|
56
47
|
/**
|
57
48
|
* Gets the table names from the current map
|
@@ -73,15 +64,37 @@ export async function getMapTableHash(mapView, onlyShowUpdatableTables) {
|
|
73
64
|
return prev;
|
74
65
|
}, {});
|
75
66
|
});
|
76
|
-
return onlyShowUpdatableTables
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
67
|
+
return _getFinalHash(onlyShowUpdatableTables, tableHash, mapView);
|
68
|
+
}
|
69
|
+
/**
|
70
|
+
* Get the final hash
|
71
|
+
*
|
72
|
+
* @param onlyShowUpdatable boolean when true only layers that support editing and the update capability will be returned
|
73
|
+
* @param hash IMapItemHash key: layer id, values: name, supportsUpdate
|
74
|
+
* @param mapView the map view to fetch the layer from
|
75
|
+
*
|
76
|
+
* @returns Promise resolving with IMapItemHash
|
77
|
+
*
|
78
|
+
*/
|
79
|
+
async function _getFinalHash(onlyShowUpdatable, hash, mapView) {
|
80
|
+
if (onlyShowUpdatable) {
|
81
|
+
const editableHash = {};
|
82
|
+
const keys = Object.keys(hash);
|
83
|
+
for (let i = 0; i < keys.length; i++) {
|
84
|
+
const id = keys[i];
|
85
|
+
const layer = await getLayerOrTable(mapView, id);
|
86
|
+
await layer.load();
|
87
|
+
await layer.when();
|
88
|
+
editableHash[id] = {
|
89
|
+
name: hash[id].name,
|
90
|
+
supportsUpdate: layer.editingEnabled && layer.capabilities.operations.supportsUpdate
|
91
|
+
};
|
92
|
+
}
|
93
|
+
return editableHash;
|
94
|
+
}
|
95
|
+
else {
|
96
|
+
return hash;
|
97
|
+
}
|
85
98
|
}
|
86
99
|
/**
|
87
100
|
* Get a layer view by id
|
@@ -42,17 +42,11 @@ export async function getMapLayerHash(
|
|
42
42
|
return prev;
|
43
43
|
}, {});
|
44
44
|
});
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
name: layerHash[cur].name,
|
51
|
-
supportsUpdate: layer.editingEnabled && layer.capabilities.operations.supportsUpdate
|
52
|
-
};
|
53
|
-
});
|
54
|
-
return prev;
|
55
|
-
}, {}) : layerHash;
|
45
|
+
return _getFinalHash(
|
46
|
+
onlyShowUpdatableLayers,
|
47
|
+
layerHash,
|
48
|
+
mapView
|
49
|
+
);
|
56
50
|
}
|
57
51
|
|
58
52
|
/**
|
@@ -78,16 +72,45 @@ export async function getMapTableHash(
|
|
78
72
|
return prev;
|
79
73
|
}, {});
|
80
74
|
});
|
75
|
+
return _getFinalHash(
|
76
|
+
onlyShowUpdatableTables,
|
77
|
+
tableHash,
|
78
|
+
mapView
|
79
|
+
);
|
80
|
+
}
|
81
81
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
82
|
+
/**
|
83
|
+
* Get the final hash
|
84
|
+
*
|
85
|
+
* @param onlyShowUpdatable boolean when true only layers that support editing and the update capability will be returned
|
86
|
+
* @param hash IMapItemHash key: layer id, values: name, supportsUpdate
|
87
|
+
* @param mapView the map view to fetch the layer from
|
88
|
+
*
|
89
|
+
* @returns Promise resolving with IMapItemHash
|
90
|
+
*
|
91
|
+
*/
|
92
|
+
async function _getFinalHash(
|
93
|
+
onlyShowUpdatable: boolean,
|
94
|
+
hash: IMapItemHash,
|
95
|
+
mapView: __esri.MapView
|
96
|
+
): Promise<IMapItemHash> {
|
97
|
+
if (onlyShowUpdatable) {
|
98
|
+
const editableHash = {};
|
99
|
+
const keys = Object.keys(hash);
|
100
|
+
for (let i = 0; i < keys.length; i++) {
|
101
|
+
const id = keys[i];
|
102
|
+
const layer = await getLayerOrTable(mapView, id);
|
103
|
+
await layer.load();
|
104
|
+
await layer.when();
|
105
|
+
editableHash[id] = {
|
106
|
+
name: hash[id].name,
|
107
|
+
supportsUpdate: layer.editingEnabled && layer.capabilities.operations.supportsUpdate
|
108
|
+
};
|
109
|
+
}
|
110
|
+
return editableHash;
|
111
|
+
} else {
|
112
|
+
return hash;
|
113
|
+
}
|
91
114
|
}
|
92
115
|
|
93
116
|
/**
|
@@ -18,8 +18,8 @@
|
|
18
18
|
* See the License for the specific language governing permissions and
|
19
19
|
* limitations under the License.
|
20
20
|
*/
|
21
|
-
import { getInventoryItems } from "
|
22
|
-
import * as electionOutreach from "
|
21
|
+
import { getInventoryItems } from "../templates";
|
22
|
+
import * as electionOutreach from "../../demos/data/election-outreach.json";
|
23
23
|
describe("getInventoryItems", () => {
|
24
24
|
it("can get inventory items", () => {
|
25
25
|
const templates = electionOutreach.templates;
|
@@ -16,8 +16,8 @@
|
|
16
16
|
|
17
17
|
import {
|
18
18
|
getInventoryItems
|
19
|
-
} from "
|
20
|
-
import * as electionOutreach from '
|
19
|
+
} from "../templates";
|
20
|
+
import * as electionOutreach from '../../demos/data/election-outreach.json';
|
21
21
|
|
22
22
|
describe("getInventoryItems", () => {
|
23
23
|
it("can get inventory items", () => {
|
@@ -84,7 +84,7 @@ const CardManager = /*@__PURE__*/ proxyCustomElement(class CardManager extends H
|
|
84
84
|
var _a, _b;
|
85
85
|
const featuresClass = ((_a = this._graphics) === null || _a === void 0 ? void 0 : _a.length) > 0 ? "" : "display-none";
|
86
86
|
const messageClass = ((_b = this._graphics) === null || _b === void 0 ? void 0 : _b.length) > 0 ? "display-none" : "";
|
87
|
-
return (h(Host, null, h("div", { class: "overflow-auto height-full" }, h("calcite-shell", { class: "position-relative " + featuresClass }, h("div", null, h("info-card", { graphics: this._graphics, isLoading: this._cardLoading, mapView: this.mapView, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))), h("
|
87
|
+
return (h(Host, null, h("div", { class: "overflow-auto height-full" }, h("calcite-shell", { class: "position-relative " + featuresClass }, h("div", null, h("info-card", { graphics: this._graphics, isLoading: this._cardLoading, mapView: this.mapView, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))), h("calcite-shell", { class: "position-relative " + messageClass }, h("div", { class: "padding-1" }, h("calcite-notice", { icon: "table", open: true }, h("div", { slot: "message" }, this._translations.selectFeaturesToStart)))))));
|
88
88
|
}
|
89
89
|
//--------------------------------------------------------------------------
|
90
90
|
//
|