@esri/solutions-components 0.6.6 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/basemap-gallery_4.cjs.entry.js +622 -0
- package/dist/cjs/card-manager_4.cjs.entry.js +91 -37
- package/dist/cjs/crowdsource-manager.cjs.entry.js +4 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/basemap-gallery/basemap-gallery.css +19 -0
- package/dist/collection/components/basemap-gallery/basemap-gallery.js +166 -0
- package/dist/collection/components/basemap-gallery/test/basemap-gallery.e2e.js +29 -0
- package/dist/collection/components/basemap-gallery/test/basemap-gallery.spec.js +37 -0
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +43 -2
- package/dist/collection/components/layer-table/layer-table.js +99 -30
- package/dist/collection/components/map-card/map-card.css +0 -7
- package/dist/collection/components/map-card/map-card.js +12 -7
- package/dist/collection/components/map-search/map-search.css +24 -0
- package/dist/collection/components/map-search/map-search.js +321 -0
- package/dist/collection/components/map-search/test/map-search.e2e.js +29 -0
- package/dist/collection/components/map-search/test/map-search.spec.js +37 -0
- package/dist/collection/components/map-tools/map-tools.js +139 -14
- package/dist/collection/demos/crowdsource-manager.html +3 -3
- package/dist/collection/utils/interfaces.ts +2 -0
- package/dist/components/action-bar.js +1 -0
- package/dist/components/action-group.js +1 -0
- package/dist/components/action-menu.js +1 -0
- package/dist/components/action.js +1 -0
- package/dist/components/alert.js +1 -0
- package/dist/components/avatar.js +1 -0
- package/dist/components/basemap-gallery.d.ts +11 -0
- package/dist/components/basemap-gallery.js +11 -0
- package/dist/components/basemap-gallery2.js +118 -0
- package/dist/components/buffer-tools2.js +1 -0
- package/dist/components/button.js +1 -0
- package/dist/components/calcite-accordion-item.js +1 -0
- package/dist/components/calcite-accordion.js +1 -0
- package/dist/components/calcite-action-pad.js +1 -0
- package/dist/components/calcite-block-section.js +1 -0
- package/dist/components/calcite-block.js +1 -0
- package/dist/components/calcite-card.js +1 -0
- package/dist/components/calcite-chip-group.js +1 -0
- package/dist/components/calcite-color-picker.js +1 -0
- package/dist/components/calcite-combobox-item-group.js +1 -0
- package/dist/components/calcite-fab.js +1 -0
- package/dist/components/calcite-flow-item.js +1 -0
- package/dist/components/calcite-flow.js +1 -0
- package/dist/components/calcite-inline-editable.js +1 -0
- package/dist/components/calcite-input-date-picker.js +1 -0
- package/dist/components/calcite-input-time-picker.js +1 -0
- package/dist/components/calcite-input-time-zone.js +1 -0
- package/dist/components/calcite-list-item-group.js +1 -0
- package/dist/components/calcite-menu-item.js +1 -0
- package/dist/components/calcite-modal.js +1 -0
- package/dist/components/calcite-navigation-logo.js +1 -0
- package/dist/components/calcite-navigation-user.js +1 -0
- package/dist/components/calcite-navigation.js +1 -0
- package/dist/components/calcite-option-group.js +1 -0
- package/dist/components/calcite-pagination.js +1 -0
- package/dist/components/calcite-pick-list-group.js +1 -0
- package/dist/components/calcite-pick-list.js +1 -0
- package/dist/components/calcite-radio-button-group.js +1 -0
- package/dist/components/calcite-radio-button.js +1 -0
- package/dist/components/calcite-rating.js +1 -0
- package/dist/components/calcite-shell-center-row.js +1 -0
- package/dist/components/calcite-sortable-list.js +1 -0
- package/dist/components/calcite-split-button.js +1 -0
- package/dist/components/calcite-stepper-item.js +1 -0
- package/dist/components/calcite-stepper.js +1 -0
- package/dist/components/calcite-text-area.js +1 -0
- package/dist/components/calcite-tile-select-group.js +1 -0
- package/dist/components/calcite-tile-select.js +1 -0
- package/dist/components/calcite-tip-group.js +1 -0
- package/dist/components/calcite-tip-manager.js +1 -0
- package/dist/components/calcite-tip.js +1 -0
- package/dist/components/card-manager2.js +1 -0
- package/dist/components/checkbox.js +1 -0
- package/dist/components/chip.js +1 -0
- package/dist/components/color-picker-hex-input.js +1 -0
- package/dist/components/color-picker-swatch.js +1 -0
- package/dist/components/combobox-item.js +1 -0
- package/dist/components/combobox.js +1 -0
- package/dist/components/crowdsource-manager.js +95 -78
- package/dist/components/crowdsource-reporter.js +1 -0
- package/dist/components/date-picker-day.js +1 -0
- package/dist/components/date-picker-month-header.js +1 -0
- package/dist/components/date-picker-month.js +1 -0
- package/dist/components/date-picker.js +1 -0
- package/dist/components/deduct-calculator2.js +1 -0
- package/dist/components/dropdown-group.js +1 -0
- package/dist/components/dropdown-item.js +1 -0
- package/dist/components/dropdown.js +1 -0
- package/dist/components/edit-card2.js +1 -0
- package/dist/components/esri-loader.js +301 -0
- package/dist/components/filter2.js +1 -0
- package/dist/components/graph.js +1 -0
- package/dist/components/handle.js +1 -0
- package/dist/components/icon.js +1 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +1 -1
- package/dist/components/info-card2.js +1 -0
- package/dist/components/input-message.js +1 -0
- package/dist/components/input-number.js +1 -0
- package/dist/components/input-text.js +1 -0
- package/dist/components/input.js +1 -0
- package/dist/components/json-editor2.js +1 -0
- package/dist/components/label2.js +1 -0
- package/dist/components/layer-table2.js +83 -31
- package/dist/components/layout-manager2.js +1 -0
- package/dist/components/link.js +1 -0
- package/dist/components/list-item.js +1 -0
- package/dist/components/list-item2.js +1 -0
- package/dist/components/list.js +1 -0
- package/dist/components/loadModules.js +1 -1
- package/dist/components/loader.js +1 -0
- package/dist/components/locale.js +2 -295
- package/dist/components/map-card2.js +61 -42
- package/dist/components/map-draw-tools2.js +1 -0
- package/dist/components/map-layer-picker2.js +1 -0
- package/dist/components/map-picker2.js +1 -0
- package/dist/components/map-search.d.ts +11 -0
- package/dist/components/map-search.js +11 -0
- package/dist/components/map-search2.js +201 -0
- package/dist/components/map-select-tools2.js +1 -0
- package/dist/components/map-tools2.js +141 -30
- package/dist/components/menu.js +1 -0
- package/dist/components/notice.js +1 -0
- package/dist/components/option.js +1 -0
- package/dist/components/panel.js +1 -0
- package/dist/components/pci-calculator.js +1 -0
- package/dist/components/pdf-download2.js +1 -0
- package/dist/components/pick-list-item.js +1 -0
- package/dist/components/popover.js +1 -0
- package/dist/components/progress.js +1 -0
- package/dist/components/public-notification.js +1 -0
- package/dist/components/refine-selection2.js +1 -0
- package/dist/components/scrim.js +1 -0
- package/dist/components/segmented-control-item.js +1 -0
- package/dist/components/segmented-control.js +1 -0
- package/dist/components/select.js +1 -0
- package/dist/components/shell-panel.js +1 -0
- package/dist/components/shell.js +1 -0
- package/dist/components/slider.js +1 -0
- package/dist/components/solution-configuration.js +1 -0
- package/dist/components/solution-contents2.js +1 -0
- package/dist/components/solution-item-details2.js +1 -0
- package/dist/components/solution-item-icon2.js +1 -0
- package/dist/components/solution-item-sharing2.js +1 -0
- package/dist/components/solution-item2.js +1 -0
- package/dist/components/solution-organization-variables2.js +1 -0
- package/dist/components/solution-resource-item2.js +1 -0
- package/dist/components/solution-spatial-ref2.js +1 -0
- package/dist/components/solution-template-data2.js +1 -0
- package/dist/components/solution-variables2.js +1 -0
- package/dist/components/stack.js +1 -0
- package/dist/components/store-manager.js +1 -0
- package/dist/components/switch.js +1 -0
- package/dist/components/tab-nav.js +1 -0
- package/dist/components/tab-title.js +1 -0
- package/dist/components/tab.js +1 -0
- package/dist/components/tabs.js +1 -0
- package/dist/components/tile.js +1 -0
- package/dist/components/time-picker.js +1 -0
- package/dist/components/tooltip.js +1 -0
- package/dist/components/tree-item.js +1 -0
- package/dist/components/tree.js +1 -0
- package/dist/components/value-list-item.js +1 -0
- package/dist/components/value-list.js +1 -0
- package/dist/esm/basemap-gallery_4.entry.js +615 -0
- package/dist/esm/card-manager_4.entry.js +91 -37
- package/dist/esm/crowdsource-manager.entry.js +4 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/solutions-components.js +2 -2
- package/dist/solutions-components/demos/crowdsource-manager.html +3 -3
- package/dist/solutions-components/p-55aefaa8.entry.js +6 -0
- package/dist/solutions-components/p-5b5a6ac8.entry.js +6 -0
- package/dist/solutions-components/p-a6c85bd7.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +2 -0
- package/dist/types/components/basemap-gallery/basemap-gallery.d.ts +64 -0
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +9 -1
- package/dist/types/components/layer-table/layer-table.d.ts +24 -2
- package/dist/types/components/map-card/map-card.d.ts +10 -2
- package/dist/types/components/map-search/map-search.d.ts +107 -0
- package/dist/types/components/map-tools/map-tools.d.ts +68 -5
- package/dist/types/components.d.ts +122 -0
- package/dist/types/preact.d.ts +4 -0
- package/dist/types/stencil-public-runtime.d.ts +2 -0
- package/dist/types/utils/interfaces.d.ts +2 -0
- package/package.json +1 -1
- package/dist/cjs/map-picker_2.cjs.entry.js +0 -264
- package/dist/esm/map-picker_2.entry.js +0 -259
- package/dist/solutions-components/p-1990d9c8.entry.js +0 -6
- package/dist/solutions-components/p-40bde8b2.entry.js +0 -6
- package/dist/solutions-components/p-b921aa1a.entry.js +0 -6
@@ -0,0 +1,321 @@
|
|
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 { Host, h } from "@stencil/core";
|
22
|
+
import { loadModules } from "../../utils/loadModules";
|
23
|
+
export class MapSearch {
|
24
|
+
constructor() {
|
25
|
+
this.mapView = undefined;
|
26
|
+
this.popupEnabled = false;
|
27
|
+
this.resultGraphicEnabled = false;
|
28
|
+
this.searchConfiguration = undefined;
|
29
|
+
this.searchTerm = undefined;
|
30
|
+
this.searchWidget = undefined;
|
31
|
+
}
|
32
|
+
//--------------------------------------------------------------------------
|
33
|
+
//
|
34
|
+
// Watch handlers
|
35
|
+
//
|
36
|
+
//--------------------------------------------------------------------------
|
37
|
+
/**
|
38
|
+
* Called each time the searchConfiguration prop is changed.
|
39
|
+
*
|
40
|
+
* @returns Promise when complete
|
41
|
+
*/
|
42
|
+
async watchSearchConfigurationHandler() {
|
43
|
+
this._initSearchWidget();
|
44
|
+
}
|
45
|
+
/**
|
46
|
+
* Called each time the mapView prop is changed.
|
47
|
+
*
|
48
|
+
* @returns Promise when complete
|
49
|
+
*/
|
50
|
+
async mapViewWatchHandler() {
|
51
|
+
await this.mapView.when(() => {
|
52
|
+
this._initSearchWidget();
|
53
|
+
});
|
54
|
+
}
|
55
|
+
//--------------------------------------------------------------------------
|
56
|
+
//
|
57
|
+
// Methods (public)
|
58
|
+
//
|
59
|
+
//--------------------------------------------------------------------------
|
60
|
+
//--------------------------------------------------------------------------
|
61
|
+
//
|
62
|
+
// Events (public)
|
63
|
+
//
|
64
|
+
//--------------------------------------------------------------------------
|
65
|
+
//--------------------------------------------------------------------------
|
66
|
+
//
|
67
|
+
// Functions (lifecycle)
|
68
|
+
//
|
69
|
+
//--------------------------------------------------------------------------
|
70
|
+
/**
|
71
|
+
* StencilJS: Called once just after the component is first connected to the DOM.
|
72
|
+
*/
|
73
|
+
async componentWillLoad() {
|
74
|
+
await this._initModules();
|
75
|
+
}
|
76
|
+
/**
|
77
|
+
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
78
|
+
*/
|
79
|
+
async componentDidLoad() {
|
80
|
+
return this._initSearchWidget();
|
81
|
+
}
|
82
|
+
/**
|
83
|
+
* Renders the component.
|
84
|
+
*/
|
85
|
+
render() {
|
86
|
+
return (h(Host, null, h("div", { class: "search-widget", ref: (el) => { this._searchElement = el; } })));
|
87
|
+
}
|
88
|
+
//--------------------------------------------------------------------------
|
89
|
+
//
|
90
|
+
// Functions (protected)
|
91
|
+
//
|
92
|
+
//--------------------------------------------------------------------------
|
93
|
+
/**
|
94
|
+
* Load esri javascript api modules
|
95
|
+
*
|
96
|
+
* @returns Promise resolving when function is done
|
97
|
+
*
|
98
|
+
* @protected
|
99
|
+
*/
|
100
|
+
async _initModules() {
|
101
|
+
const [Search, FeatureLayer] = await loadModules([
|
102
|
+
"esri/widgets/Search",
|
103
|
+
"esri/layers/FeatureLayer"
|
104
|
+
]);
|
105
|
+
this.Search = Search;
|
106
|
+
this.FeatureLayer = FeatureLayer;
|
107
|
+
}
|
108
|
+
/**
|
109
|
+
* Initialize the search widget
|
110
|
+
*
|
111
|
+
* @protected
|
112
|
+
*/
|
113
|
+
_initSearchWidget() {
|
114
|
+
if (this.mapView && this._searchElement && !this.searchWidget) {
|
115
|
+
let searchOptions = {
|
116
|
+
view: this.mapView,
|
117
|
+
container: this._searchElement,
|
118
|
+
searchTerm: this.searchTerm
|
119
|
+
};
|
120
|
+
if (this.searchConfiguration) {
|
121
|
+
const searchConfiguration = this._getSearchConfig(this.searchConfiguration, this.mapView);
|
122
|
+
searchOptions = Object.assign({}, searchConfiguration);
|
123
|
+
}
|
124
|
+
this.searchWidget = new this.Search(searchOptions);
|
125
|
+
this.searchWidget.popupEnabled = this.popupEnabled;
|
126
|
+
this.searchWidget.resultGraphicEnabled = this.resultGraphicEnabled;
|
127
|
+
}
|
128
|
+
else {
|
129
|
+
if (this.searchWidget) {
|
130
|
+
this.searchWidget.view = this.mapView;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
/**
|
135
|
+
* Initialize the search widget based on user defined configuration
|
136
|
+
*
|
137
|
+
* @param searchConfiguration search configuration defined by the user
|
138
|
+
* @param view the current map view
|
139
|
+
*
|
140
|
+
* @protected
|
141
|
+
*/
|
142
|
+
_getSearchConfig(searchConfiguration, view) {
|
143
|
+
const INCLUDE_DEFAULT_SOURCES = "includeDefaultSources";
|
144
|
+
const sources = searchConfiguration.sources;
|
145
|
+
if ((sources === null || sources === void 0 ? void 0 : sources.length) > 0) {
|
146
|
+
searchConfiguration[INCLUDE_DEFAULT_SOURCES] = false;
|
147
|
+
sources.forEach((source) => {
|
148
|
+
var _a, _b;
|
149
|
+
const isLayerSource = source.hasOwnProperty("layer");
|
150
|
+
if (isLayerSource) {
|
151
|
+
const layerSource = source;
|
152
|
+
const layerId = (_a = layerSource.layer) === null || _a === void 0 ? void 0 : _a.id;
|
153
|
+
const layerFromMap = layerId ? view.map.findLayerById(layerId) : null;
|
154
|
+
const layerUrl = (_b = layerSource === null || layerSource === void 0 ? void 0 : layerSource.layer) === null || _b === void 0 ? void 0 : _b.url;
|
155
|
+
if (layerFromMap) {
|
156
|
+
layerSource.layer = layerFromMap;
|
157
|
+
}
|
158
|
+
else if (layerUrl) {
|
159
|
+
layerSource.layer = new this.FeatureLayer(layerUrl);
|
160
|
+
}
|
161
|
+
}
|
162
|
+
});
|
163
|
+
sources === null || sources === void 0 ? void 0 : sources.forEach((source) => {
|
164
|
+
const isLocatorSource = source.hasOwnProperty("locator");
|
165
|
+
if (isLocatorSource) {
|
166
|
+
const locatorSource = source;
|
167
|
+
if ((locatorSource === null || locatorSource === void 0 ? void 0 : locatorSource.name) === "ArcGIS World Geocoding Service") {
|
168
|
+
const outFields = locatorSource.outFields || ["Addr_type", "Match_addr", "StAddr", "City"];
|
169
|
+
locatorSource.outFields = outFields;
|
170
|
+
locatorSource.singleLineFieldName = "SingleLine";
|
171
|
+
}
|
172
|
+
locatorSource.url = locatorSource.url;
|
173
|
+
delete locatorSource.url;
|
174
|
+
}
|
175
|
+
});
|
176
|
+
}
|
177
|
+
else {
|
178
|
+
searchConfiguration = Object.assign(Object.assign({}, searchConfiguration), { includeDefaultSources: true });
|
179
|
+
}
|
180
|
+
return searchConfiguration;
|
181
|
+
}
|
182
|
+
static get is() { return "map-search"; }
|
183
|
+
static get encapsulation() { return "shadow"; }
|
184
|
+
static get originalStyleUrls() {
|
185
|
+
return {
|
186
|
+
"$": ["map-search.css"]
|
187
|
+
};
|
188
|
+
}
|
189
|
+
static get styleUrls() {
|
190
|
+
return {
|
191
|
+
"$": ["map-search.css"]
|
192
|
+
};
|
193
|
+
}
|
194
|
+
static get properties() {
|
195
|
+
return {
|
196
|
+
"mapView": {
|
197
|
+
"type": "unknown",
|
198
|
+
"mutable": false,
|
199
|
+
"complexType": {
|
200
|
+
"original": "__esri.MapView",
|
201
|
+
"resolved": "MapView",
|
202
|
+
"references": {
|
203
|
+
"___esri": {
|
204
|
+
"location": "global",
|
205
|
+
"id": "global::___esri"
|
206
|
+
}
|
207
|
+
}
|
208
|
+
},
|
209
|
+
"required": false,
|
210
|
+
"optional": false,
|
211
|
+
"docs": {
|
212
|
+
"tags": [],
|
213
|
+
"text": "esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html"
|
214
|
+
}
|
215
|
+
},
|
216
|
+
"popupEnabled": {
|
217
|
+
"type": "boolean",
|
218
|
+
"mutable": false,
|
219
|
+
"complexType": {
|
220
|
+
"original": "boolean",
|
221
|
+
"resolved": "boolean",
|
222
|
+
"references": {}
|
223
|
+
},
|
224
|
+
"required": false,
|
225
|
+
"optional": false,
|
226
|
+
"docs": {
|
227
|
+
"tags": [],
|
228
|
+
"text": "boolean: When true the selected feature popup will be shown when serach result is found"
|
229
|
+
},
|
230
|
+
"attribute": "popup-enabled",
|
231
|
+
"reflect": false,
|
232
|
+
"defaultValue": "false"
|
233
|
+
},
|
234
|
+
"resultGraphicEnabled": {
|
235
|
+
"type": "boolean",
|
236
|
+
"mutable": false,
|
237
|
+
"complexType": {
|
238
|
+
"original": "boolean",
|
239
|
+
"resolved": "boolean",
|
240
|
+
"references": {}
|
241
|
+
},
|
242
|
+
"required": false,
|
243
|
+
"optional": false,
|
244
|
+
"docs": {
|
245
|
+
"tags": [],
|
246
|
+
"text": "boolean: When true a graphic will be added for the search result"
|
247
|
+
},
|
248
|
+
"attribute": "result-graphic-enabled",
|
249
|
+
"reflect": false,
|
250
|
+
"defaultValue": "false"
|
251
|
+
},
|
252
|
+
"searchConfiguration": {
|
253
|
+
"type": "unknown",
|
254
|
+
"mutable": false,
|
255
|
+
"complexType": {
|
256
|
+
"original": "ISearchConfiguration",
|
257
|
+
"resolved": "ISearchConfiguration",
|
258
|
+
"references": {
|
259
|
+
"ISearchConfiguration": {
|
260
|
+
"location": "import",
|
261
|
+
"path": "../../utils/interfaces",
|
262
|
+
"id": "src/utils/interfaces.ts::ISearchConfiguration"
|
263
|
+
}
|
264
|
+
}
|
265
|
+
},
|
266
|
+
"required": false,
|
267
|
+
"optional": false,
|
268
|
+
"docs": {
|
269
|
+
"tags": [],
|
270
|
+
"text": "ISearchConfiguration: Configuration details for the Search widget"
|
271
|
+
}
|
272
|
+
},
|
273
|
+
"searchTerm": {
|
274
|
+
"type": "string",
|
275
|
+
"mutable": false,
|
276
|
+
"complexType": {
|
277
|
+
"original": "string",
|
278
|
+
"resolved": "string",
|
279
|
+
"references": {}
|
280
|
+
},
|
281
|
+
"required": false,
|
282
|
+
"optional": false,
|
283
|
+
"docs": {
|
284
|
+
"tags": [],
|
285
|
+
"text": "string: Text entered by the end user.\r\nUsed to search against the locator."
|
286
|
+
},
|
287
|
+
"attribute": "search-term",
|
288
|
+
"reflect": false
|
289
|
+
},
|
290
|
+
"searchWidget": {
|
291
|
+
"type": "unknown",
|
292
|
+
"mutable": false,
|
293
|
+
"complexType": {
|
294
|
+
"original": "__esri.widgetsSearch",
|
295
|
+
"resolved": "widgetsSearch",
|
296
|
+
"references": {
|
297
|
+
"___esri": {
|
298
|
+
"location": "global",
|
299
|
+
"id": "global::___esri"
|
300
|
+
}
|
301
|
+
}
|
302
|
+
},
|
303
|
+
"required": false,
|
304
|
+
"optional": false,
|
305
|
+
"docs": {
|
306
|
+
"tags": [],
|
307
|
+
"text": "esri/widgets/Search: https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html"
|
308
|
+
}
|
309
|
+
}
|
310
|
+
};
|
311
|
+
}
|
312
|
+
static get watchers() {
|
313
|
+
return [{
|
314
|
+
"propName": "searchConfiguration",
|
315
|
+
"methodName": "watchSearchConfigurationHandler"
|
316
|
+
}, {
|
317
|
+
"propName": "mapView",
|
318
|
+
"methodName": "mapViewWatchHandler"
|
319
|
+
}];
|
320
|
+
}
|
321
|
+
}
|
@@ -0,0 +1,29 @@
|
|
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
|
+
xdescribe('map-search', () => {
|
23
|
+
it('renders', async () => {
|
24
|
+
const page = await newE2EPage();
|
25
|
+
await page.setContent('<map-search></map-search>');
|
26
|
+
const element = await page.find('map-search');
|
27
|
+
expect(element).toHaveClass('hydrated');
|
28
|
+
});
|
29
|
+
});
|
@@ -0,0 +1,37 @@
|
|
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 { newSpecPage } from "@stencil/core/testing";
|
22
|
+
import { MapSearch } from "../map-search";
|
23
|
+
xdescribe('map-search', () => {
|
24
|
+
it('renders', async () => {
|
25
|
+
const page = await newSpecPage({
|
26
|
+
components: [MapSearch],
|
27
|
+
html: `<map-search></map-search>`,
|
28
|
+
});
|
29
|
+
expect(page.root).toEqualHtml(`
|
30
|
+
<map-search>
|
31
|
+
<mock:shadow-root>
|
32
|
+
<slot></slot>
|
33
|
+
</mock:shadow-root>
|
34
|
+
</map-search>
|
35
|
+
`);
|
36
|
+
});
|
37
|
+
});
|
@@ -25,9 +25,53 @@ export class MapTools {
|
|
25
25
|
constructor() {
|
26
26
|
this.layout = "vertical";
|
27
27
|
this.mapView = undefined;
|
28
|
+
this.searchConfiguration = undefined;
|
28
29
|
this._translations = undefined;
|
29
30
|
this._showTools = true;
|
30
|
-
this.
|
31
|
+
this._showBasemapWidget = false;
|
32
|
+
this._showSearchWidget = false;
|
33
|
+
}
|
34
|
+
//--------------------------------------------------------------------------
|
35
|
+
//
|
36
|
+
// Watch handlers
|
37
|
+
//
|
38
|
+
//--------------------------------------------------------------------------
|
39
|
+
/**
|
40
|
+
* Store the home extent when the map view changes
|
41
|
+
*/
|
42
|
+
async mapViewWatchHandler() {
|
43
|
+
await this.mapView.when(() => {
|
44
|
+
this._homeExtent = this.mapView.extent;
|
45
|
+
});
|
46
|
+
}
|
47
|
+
/**
|
48
|
+
* When the _showBasemapWidget property is true display the basemap gallery
|
49
|
+
*/
|
50
|
+
async _showBasemapWidgetWatchHandler(v) {
|
51
|
+
if (v) {
|
52
|
+
this.mapView.ui.add(this._basemapElement.basemapWidget, {
|
53
|
+
position: "top-right",
|
54
|
+
index: 1
|
55
|
+
});
|
56
|
+
}
|
57
|
+
else {
|
58
|
+
this.mapView.ui.remove(this._basemapElement.basemapWidget);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* When the _showSearchWidget property is true display the search widget
|
63
|
+
*/
|
64
|
+
async _showSearchWidgetWatchHandler(v) {
|
65
|
+
console.log("_showSearchWidget changed");
|
66
|
+
if (v) {
|
67
|
+
this.mapView.ui.add(this._searchElement.searchWidget, {
|
68
|
+
position: "top-right",
|
69
|
+
index: 1
|
70
|
+
});
|
71
|
+
}
|
72
|
+
else {
|
73
|
+
this.mapView.ui.remove(this._searchElement.searchWidget);
|
74
|
+
}
|
31
75
|
}
|
32
76
|
//--------------------------------------------------------------------------
|
33
77
|
//
|
@@ -46,8 +90,15 @@ export class MapTools {
|
|
46
90
|
render() {
|
47
91
|
const toggleIcon = this._showTools ? "chevrons-up" : "chevrons-down";
|
48
92
|
const toolsClass = this._showTools ? "" : "display-none";
|
49
|
-
|
93
|
+
const searchClass = this._showSearchWidget ? "" : "display-none";
|
94
|
+
const basemapClass = this._showBasemapWidget ? "" : "display-none";
|
95
|
+
return (h(Host, null, h("div", null, h("calcite-action", { alignment: "center", class: "border", compact: false, icon: toggleIcon, onClick: () => { this._toggleTools(); }, text: "" }), h("calcite-action-bar", { class: `border margin-top-1-2 ${toolsClass}`, "expand-disabled": true, layout: this.layout }, this._getActionGroup("home", false, this._translations.home, () => void this._goHome()), this._getActionGroup("plus", false, this._translations.zoomIn, () => void this._zoomIn()), this._getActionGroup("minus", false, this._translations.zoomOut, () => void this._zoomOut()), this._getActionGroup("list", false, this._translations.list, () => this._showList()), this._getActionGroup("magnifying-glass", false, this._translations.search, () => this._search()), this._getActionGroup("expand", false, this._translations.expand, () => this._expand()), this._getActionGroup("basemap", false, this._translations.basemap, () => this._toggleBasemapPicker()))), h("basemap-gallery", { class: basemapClass, mapView: this.mapView, ref: (el) => { this._basemapElement = el; } }), h("map-search", { class: searchClass, mapView: this.mapView, ref: (el) => { this._searchElement = el; }, searchConfiguration: this.searchConfiguration })));
|
50
96
|
}
|
97
|
+
//--------------------------------------------------------------------------
|
98
|
+
//
|
99
|
+
// Functions (protected)
|
100
|
+
//
|
101
|
+
//--------------------------------------------------------------------------
|
51
102
|
/**
|
52
103
|
* Get a calcite action group for the current action
|
53
104
|
*
|
@@ -63,9 +114,15 @@ export class MapTools {
|
|
63
114
|
_getActionGroup(icon, disabled, tip, func) {
|
64
115
|
return (h("calcite-action-group", null, h("calcite-action", { alignment: "center", compact: false, disabled: disabled, icon: icon, id: icon, onClick: func, text: "" }, h("calcite-icon", { icon: "cheveron-up", scale: "s", slot: "icon" })), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": icon }, h("span", null, tip))));
|
65
116
|
}
|
66
|
-
|
67
|
-
|
68
|
-
|
117
|
+
/**
|
118
|
+
* Go to the exent that was first used when loading the map
|
119
|
+
*
|
120
|
+
* @returns void
|
121
|
+
*
|
122
|
+
* @protected
|
123
|
+
*/
|
124
|
+
async _goHome() {
|
125
|
+
await this.mapView.goTo(this._homeExtent);
|
69
126
|
}
|
70
127
|
// need to discuss this with the team
|
71
128
|
_showList() {
|
@@ -73,15 +130,44 @@ export class MapTools {
|
|
73
130
|
}
|
74
131
|
// Need to discuss this with the team
|
75
132
|
_search() {
|
76
|
-
|
133
|
+
this._showSearchWidget = !this._showSearchWidget;
|
134
|
+
this._showTools = false;
|
135
|
+
}
|
136
|
+
/**
|
137
|
+
* Fixed zoom in
|
138
|
+
*
|
139
|
+
* @returns void
|
140
|
+
*
|
141
|
+
* @protected
|
142
|
+
*/
|
143
|
+
async _zoomIn() {
|
144
|
+
await this._zoom(this.mapView.zoom + 1);
|
77
145
|
}
|
78
|
-
|
79
|
-
|
80
|
-
|
146
|
+
/**
|
147
|
+
* Fixed zoom out
|
148
|
+
*
|
149
|
+
* @returns void
|
150
|
+
*
|
151
|
+
* @protected
|
152
|
+
*/
|
153
|
+
async _zoomOut() {
|
154
|
+
await this._zoom(this.mapView.zoom - 1);
|
81
155
|
}
|
82
|
-
|
83
|
-
|
84
|
-
|
156
|
+
/**
|
157
|
+
* Zoom in/out at the maps current center point
|
158
|
+
*
|
159
|
+
* @param zoom Number to zoom level to go to
|
160
|
+
*
|
161
|
+
* @returns void
|
162
|
+
*
|
163
|
+
* @protected
|
164
|
+
*/
|
165
|
+
async _zoom(zoom) {
|
166
|
+
var _a;
|
167
|
+
await ((_a = this.mapView) === null || _a === void 0 ? void 0 : _a.goTo({
|
168
|
+
target: this.mapView.center,
|
169
|
+
zoom
|
170
|
+
}));
|
85
171
|
}
|
86
172
|
/**
|
87
173
|
* Show/Hide the basemap picker
|
@@ -91,7 +177,8 @@ export class MapTools {
|
|
91
177
|
* @protected
|
92
178
|
*/
|
93
179
|
_toggleBasemapPicker() {
|
94
|
-
this.
|
180
|
+
this._showBasemapWidget = !this._showBasemapWidget;
|
181
|
+
this._showTools = false;
|
95
182
|
}
|
96
183
|
/**
|
97
184
|
* Emit the expand map event
|
@@ -111,6 +198,10 @@ export class MapTools {
|
|
111
198
|
* @protected
|
112
199
|
*/
|
113
200
|
_toggleTools() {
|
201
|
+
if (!this._showTools) {
|
202
|
+
this._showBasemapWidget = false;
|
203
|
+
this._showSearchWidget = false;
|
204
|
+
}
|
114
205
|
this._showTools = !this._showTools;
|
115
206
|
}
|
116
207
|
/**
|
@@ -174,6 +265,27 @@ export class MapTools {
|
|
174
265
|
"tags": [],
|
175
266
|
"text": "esri/views/View: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html"
|
176
267
|
}
|
268
|
+
},
|
269
|
+
"searchConfiguration": {
|
270
|
+
"type": "unknown",
|
271
|
+
"mutable": false,
|
272
|
+
"complexType": {
|
273
|
+
"original": "ISearchConfiguration",
|
274
|
+
"resolved": "ISearchConfiguration",
|
275
|
+
"references": {
|
276
|
+
"ISearchConfiguration": {
|
277
|
+
"location": "import",
|
278
|
+
"path": "../../utils/interfaces",
|
279
|
+
"id": "src/utils/interfaces.ts::ISearchConfiguration"
|
280
|
+
}
|
281
|
+
}
|
282
|
+
},
|
283
|
+
"required": false,
|
284
|
+
"optional": false,
|
285
|
+
"docs": {
|
286
|
+
"tags": [],
|
287
|
+
"text": "ISearchConfiguration: Configuration details for the Search widget"
|
288
|
+
}
|
177
289
|
}
|
178
290
|
};
|
179
291
|
}
|
@@ -181,7 +293,8 @@ export class MapTools {
|
|
181
293
|
return {
|
182
294
|
"_translations": {},
|
183
295
|
"_showTools": {},
|
184
|
-
"
|
296
|
+
"_showBasemapWidget": {},
|
297
|
+
"_showSearchWidget": {}
|
185
298
|
};
|
186
299
|
}
|
187
300
|
static get events() {
|
@@ -209,4 +322,16 @@ export class MapTools {
|
|
209
322
|
}];
|
210
323
|
}
|
211
324
|
static get elementRef() { return "el"; }
|
325
|
+
static get watchers() {
|
326
|
+
return [{
|
327
|
+
"propName": "mapView",
|
328
|
+
"methodName": "mapViewWatchHandler"
|
329
|
+
}, {
|
330
|
+
"propName": "_showBasemapWidget",
|
331
|
+
"methodName": "_showBasemapWidgetWatchHandler"
|
332
|
+
}, {
|
333
|
+
"propName": "_showSearchWidget",
|
334
|
+
"methodName": "_showSearchWidgetWatchHandler"
|
335
|
+
}];
|
336
|
+
}
|
212
337
|
}
|
@@ -83,6 +83,9 @@
|
|
83
83
|
demo.mapInfos = [
|
84
84
|
...custom,
|
85
85
|
...[{
|
86
|
+
id: "ce3dec81bf714d3bb71da9691ab686d1",
|
87
|
+
name: "Popup Configured Map"
|
88
|
+
}, {
|
86
89
|
id: "863e4f6f2a7840db896cc1b1606d552d",
|
87
90
|
name: "IA map"
|
88
91
|
}, {
|
@@ -94,9 +97,6 @@
|
|
94
97
|
}, {
|
95
98
|
id: "f5b01c17a09941eaad63e7b4e6c7d880",
|
96
99
|
name: "Attachments Map"
|
97
|
-
}, {
|
98
|
-
id: "ce3dec81bf714d3bb71da9691ab686d1",
|
99
|
-
name: "Popup Configured Map"
|
100
100
|
}]
|
101
101
|
];
|
102
102
|
}
|
@@ -446,6 +446,8 @@ export interface IMediaCardValues {
|
|
446
446
|
export interface IMapInfo {
|
447
447
|
id: string;
|
448
448
|
name: string;
|
449
|
+
searchConfiguration?: ISearchConfiguration;
|
450
|
+
filters?: any[]; // TODO generate an interface for this once we know how it will be passed in
|
449
451
|
}
|
450
452
|
|
451
453
|
export interface IExportInfos {
|
package/dist/components/alert.js
CHANGED