@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,201 @@
|
|
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
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
7
|
+
import { l as loadModules } from './loadModules.js';
|
8
|
+
|
9
|
+
const mapSearchCss = ":host{display:block}.search-widget{width:100% !important;border:1px solid var(--calcite-ui-border-input)}";
|
10
|
+
|
11
|
+
const MapSearch = /*@__PURE__*/ proxyCustomElement(class MapSearch extends HTMLElement {
|
12
|
+
constructor() {
|
13
|
+
super();
|
14
|
+
this.__registerHost();
|
15
|
+
this.__attachShadow();
|
16
|
+
this.mapView = undefined;
|
17
|
+
this.popupEnabled = false;
|
18
|
+
this.resultGraphicEnabled = false;
|
19
|
+
this.searchConfiguration = undefined;
|
20
|
+
this.searchTerm = undefined;
|
21
|
+
this.searchWidget = undefined;
|
22
|
+
}
|
23
|
+
//--------------------------------------------------------------------------
|
24
|
+
//
|
25
|
+
// Watch handlers
|
26
|
+
//
|
27
|
+
//--------------------------------------------------------------------------
|
28
|
+
/**
|
29
|
+
* Called each time the searchConfiguration prop is changed.
|
30
|
+
*
|
31
|
+
* @returns Promise when complete
|
32
|
+
*/
|
33
|
+
async watchSearchConfigurationHandler() {
|
34
|
+
this._initSearchWidget();
|
35
|
+
}
|
36
|
+
/**
|
37
|
+
* Called each time the mapView prop is changed.
|
38
|
+
*
|
39
|
+
* @returns Promise when complete
|
40
|
+
*/
|
41
|
+
async mapViewWatchHandler() {
|
42
|
+
await this.mapView.when(() => {
|
43
|
+
this._initSearchWidget();
|
44
|
+
});
|
45
|
+
}
|
46
|
+
//--------------------------------------------------------------------------
|
47
|
+
//
|
48
|
+
// Methods (public)
|
49
|
+
//
|
50
|
+
//--------------------------------------------------------------------------
|
51
|
+
//--------------------------------------------------------------------------
|
52
|
+
//
|
53
|
+
// Events (public)
|
54
|
+
//
|
55
|
+
//--------------------------------------------------------------------------
|
56
|
+
//--------------------------------------------------------------------------
|
57
|
+
//
|
58
|
+
// Functions (lifecycle)
|
59
|
+
//
|
60
|
+
//--------------------------------------------------------------------------
|
61
|
+
/**
|
62
|
+
* StencilJS: Called once just after the component is first connected to the DOM.
|
63
|
+
*/
|
64
|
+
async componentWillLoad() {
|
65
|
+
await this._initModules();
|
66
|
+
}
|
67
|
+
/**
|
68
|
+
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
69
|
+
*/
|
70
|
+
async componentDidLoad() {
|
71
|
+
return this._initSearchWidget();
|
72
|
+
}
|
73
|
+
/**
|
74
|
+
* Renders the component.
|
75
|
+
*/
|
76
|
+
render() {
|
77
|
+
return (h(Host, null, h("div", { class: "search-widget", ref: (el) => { this._searchElement = el; } })));
|
78
|
+
}
|
79
|
+
//--------------------------------------------------------------------------
|
80
|
+
//
|
81
|
+
// Functions (protected)
|
82
|
+
//
|
83
|
+
//--------------------------------------------------------------------------
|
84
|
+
/**
|
85
|
+
* Load esri javascript api modules
|
86
|
+
*
|
87
|
+
* @returns Promise resolving when function is done
|
88
|
+
*
|
89
|
+
* @protected
|
90
|
+
*/
|
91
|
+
async _initModules() {
|
92
|
+
const [Search, FeatureLayer] = await loadModules([
|
93
|
+
"esri/widgets/Search",
|
94
|
+
"esri/layers/FeatureLayer"
|
95
|
+
]);
|
96
|
+
this.Search = Search;
|
97
|
+
this.FeatureLayer = FeatureLayer;
|
98
|
+
}
|
99
|
+
/**
|
100
|
+
* Initialize the search widget
|
101
|
+
*
|
102
|
+
* @protected
|
103
|
+
*/
|
104
|
+
_initSearchWidget() {
|
105
|
+
if (this.mapView && this._searchElement && !this.searchWidget) {
|
106
|
+
let searchOptions = {
|
107
|
+
view: this.mapView,
|
108
|
+
container: this._searchElement,
|
109
|
+
searchTerm: this.searchTerm
|
110
|
+
};
|
111
|
+
if (this.searchConfiguration) {
|
112
|
+
const searchConfiguration = this._getSearchConfig(this.searchConfiguration, this.mapView);
|
113
|
+
searchOptions = Object.assign({}, searchConfiguration);
|
114
|
+
}
|
115
|
+
this.searchWidget = new this.Search(searchOptions);
|
116
|
+
this.searchWidget.popupEnabled = this.popupEnabled;
|
117
|
+
this.searchWidget.resultGraphicEnabled = this.resultGraphicEnabled;
|
118
|
+
}
|
119
|
+
else {
|
120
|
+
if (this.searchWidget) {
|
121
|
+
this.searchWidget.view = this.mapView;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
/**
|
126
|
+
* Initialize the search widget based on user defined configuration
|
127
|
+
*
|
128
|
+
* @param searchConfiguration search configuration defined by the user
|
129
|
+
* @param view the current map view
|
130
|
+
*
|
131
|
+
* @protected
|
132
|
+
*/
|
133
|
+
_getSearchConfig(searchConfiguration, view) {
|
134
|
+
const INCLUDE_DEFAULT_SOURCES = "includeDefaultSources";
|
135
|
+
const sources = searchConfiguration.sources;
|
136
|
+
if ((sources === null || sources === void 0 ? void 0 : sources.length) > 0) {
|
137
|
+
searchConfiguration[INCLUDE_DEFAULT_SOURCES] = false;
|
138
|
+
sources.forEach((source) => {
|
139
|
+
var _a, _b;
|
140
|
+
const isLayerSource = source.hasOwnProperty("layer");
|
141
|
+
if (isLayerSource) {
|
142
|
+
const layerSource = source;
|
143
|
+
const layerId = (_a = layerSource.layer) === null || _a === void 0 ? void 0 : _a.id;
|
144
|
+
const layerFromMap = layerId ? view.map.findLayerById(layerId) : null;
|
145
|
+
const layerUrl = (_b = layerSource === null || layerSource === void 0 ? void 0 : layerSource.layer) === null || _b === void 0 ? void 0 : _b.url;
|
146
|
+
if (layerFromMap) {
|
147
|
+
layerSource.layer = layerFromMap;
|
148
|
+
}
|
149
|
+
else if (layerUrl) {
|
150
|
+
layerSource.layer = new this.FeatureLayer(layerUrl);
|
151
|
+
}
|
152
|
+
}
|
153
|
+
});
|
154
|
+
sources === null || sources === void 0 ? void 0 : sources.forEach((source) => {
|
155
|
+
const isLocatorSource = source.hasOwnProperty("locator");
|
156
|
+
if (isLocatorSource) {
|
157
|
+
const locatorSource = source;
|
158
|
+
if ((locatorSource === null || locatorSource === void 0 ? void 0 : locatorSource.name) === "ArcGIS World Geocoding Service") {
|
159
|
+
const outFields = locatorSource.outFields || ["Addr_type", "Match_addr", "StAddr", "City"];
|
160
|
+
locatorSource.outFields = outFields;
|
161
|
+
locatorSource.singleLineFieldName = "SingleLine";
|
162
|
+
}
|
163
|
+
locatorSource.url = locatorSource.url;
|
164
|
+
delete locatorSource.url;
|
165
|
+
}
|
166
|
+
});
|
167
|
+
}
|
168
|
+
else {
|
169
|
+
searchConfiguration = Object.assign(Object.assign({}, searchConfiguration), { includeDefaultSources: true });
|
170
|
+
}
|
171
|
+
return searchConfiguration;
|
172
|
+
}
|
173
|
+
static get watchers() { return {
|
174
|
+
"searchConfiguration": ["watchSearchConfigurationHandler"],
|
175
|
+
"mapView": ["mapViewWatchHandler"]
|
176
|
+
}; }
|
177
|
+
static get style() { return mapSearchCss; }
|
178
|
+
}, [1, "map-search", {
|
179
|
+
"mapView": [16],
|
180
|
+
"popupEnabled": [4, "popup-enabled"],
|
181
|
+
"resultGraphicEnabled": [4, "result-graphic-enabled"],
|
182
|
+
"searchConfiguration": [16],
|
183
|
+
"searchTerm": [1, "search-term"],
|
184
|
+
"searchWidget": [16]
|
185
|
+
}]);
|
186
|
+
function defineCustomElement() {
|
187
|
+
if (typeof customElements === "undefined") {
|
188
|
+
return;
|
189
|
+
}
|
190
|
+
const components = ["map-search"];
|
191
|
+
components.forEach(tagName => { switch (tagName) {
|
192
|
+
case "map-search":
|
193
|
+
if (!customElements.get(tagName)) {
|
194
|
+
customElements.define(tagName, MapSearch);
|
195
|
+
}
|
196
|
+
break;
|
197
|
+
} });
|
198
|
+
}
|
199
|
+
defineCustomElement();
|
200
|
+
|
201
|
+
export { MapSearch as M, defineCustomElement as d };
|
@@ -6,14 +6,16 @@
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
7
7
|
import { g as getLocaleComponentStrings } from './locale.js';
|
8
8
|
import { b as EExpandType } from './interfaces.js';
|
9
|
-
import { d as defineCustomElement$
|
10
|
-
import { d as defineCustomElement$
|
11
|
-
import { d as defineCustomElement$
|
12
|
-
import { d as defineCustomElement$
|
13
|
-
import { d as defineCustomElement$
|
14
|
-
import { d as defineCustomElement$
|
15
|
-
import { d as defineCustomElement$
|
16
|
-
import { d as defineCustomElement$
|
9
|
+
import { d as defineCustomElement$a } from './basemap-gallery2.js';
|
10
|
+
import { d as defineCustomElement$9 } from './action.js';
|
11
|
+
import { d as defineCustomElement$8 } from './action-bar.js';
|
12
|
+
import { d as defineCustomElement$7 } from './action-group.js';
|
13
|
+
import { d as defineCustomElement$6 } from './action-menu.js';
|
14
|
+
import { d as defineCustomElement$5 } from './icon.js';
|
15
|
+
import { d as defineCustomElement$4 } from './loader.js';
|
16
|
+
import { d as defineCustomElement$3 } from './popover.js';
|
17
|
+
import { d as defineCustomElement$2 } from './tooltip.js';
|
18
|
+
import { d as defineCustomElement$1 } from './map-search2.js';
|
17
19
|
|
18
20
|
const mapToolsCss = ":host{display:block}.display-none{display:none}.border{border:1px solid var(--calcite-ui-border-3)}.margin-top-1-2{margin-top:0.5rem}";
|
19
21
|
|
@@ -25,9 +27,53 @@ const MapTools = /*@__PURE__*/ proxyCustomElement(class MapTools extends HTMLEle
|
|
25
27
|
this.expandMap = createEvent(this, "expandMap", 7);
|
26
28
|
this.layout = "vertical";
|
27
29
|
this.mapView = undefined;
|
30
|
+
this.searchConfiguration = undefined;
|
28
31
|
this._translations = undefined;
|
29
32
|
this._showTools = true;
|
30
|
-
this.
|
33
|
+
this._showBasemapWidget = false;
|
34
|
+
this._showSearchWidget = false;
|
35
|
+
}
|
36
|
+
//--------------------------------------------------------------------------
|
37
|
+
//
|
38
|
+
// Watch handlers
|
39
|
+
//
|
40
|
+
//--------------------------------------------------------------------------
|
41
|
+
/**
|
42
|
+
* Store the home extent when the map view changes
|
43
|
+
*/
|
44
|
+
async mapViewWatchHandler() {
|
45
|
+
await this.mapView.when(() => {
|
46
|
+
this._homeExtent = this.mapView.extent;
|
47
|
+
});
|
48
|
+
}
|
49
|
+
/**
|
50
|
+
* When the _showBasemapWidget property is true display the basemap gallery
|
51
|
+
*/
|
52
|
+
async _showBasemapWidgetWatchHandler(v) {
|
53
|
+
if (v) {
|
54
|
+
this.mapView.ui.add(this._basemapElement.basemapWidget, {
|
55
|
+
position: "top-right",
|
56
|
+
index: 1
|
57
|
+
});
|
58
|
+
}
|
59
|
+
else {
|
60
|
+
this.mapView.ui.remove(this._basemapElement.basemapWidget);
|
61
|
+
}
|
62
|
+
}
|
63
|
+
/**
|
64
|
+
* When the _showSearchWidget property is true display the search widget
|
65
|
+
*/
|
66
|
+
async _showSearchWidgetWatchHandler(v) {
|
67
|
+
console.log("_showSearchWidget changed");
|
68
|
+
if (v) {
|
69
|
+
this.mapView.ui.add(this._searchElement.searchWidget, {
|
70
|
+
position: "top-right",
|
71
|
+
index: 1
|
72
|
+
});
|
73
|
+
}
|
74
|
+
else {
|
75
|
+
this.mapView.ui.remove(this._searchElement.searchWidget);
|
76
|
+
}
|
31
77
|
}
|
32
78
|
//--------------------------------------------------------------------------
|
33
79
|
//
|
@@ -46,8 +92,15 @@ const MapTools = /*@__PURE__*/ proxyCustomElement(class MapTools extends HTMLEle
|
|
46
92
|
render() {
|
47
93
|
const toggleIcon = this._showTools ? "chevrons-up" : "chevrons-down";
|
48
94
|
const toolsClass = this._showTools ? "" : "display-none";
|
49
|
-
|
95
|
+
const searchClass = this._showSearchWidget ? "" : "display-none";
|
96
|
+
const basemapClass = this._showBasemapWidget ? "" : "display-none";
|
97
|
+
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
98
|
}
|
99
|
+
//--------------------------------------------------------------------------
|
100
|
+
//
|
101
|
+
// Functions (protected)
|
102
|
+
//
|
103
|
+
//--------------------------------------------------------------------------
|
51
104
|
/**
|
52
105
|
* Get a calcite action group for the current action
|
53
106
|
*
|
@@ -63,9 +116,15 @@ const MapTools = /*@__PURE__*/ proxyCustomElement(class MapTools extends HTMLEle
|
|
63
116
|
_getActionGroup(icon, disabled, tip, func) {
|
64
117
|
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
118
|
}
|
66
|
-
|
67
|
-
|
68
|
-
|
119
|
+
/**
|
120
|
+
* Go to the exent that was first used when loading the map
|
121
|
+
*
|
122
|
+
* @returns void
|
123
|
+
*
|
124
|
+
* @protected
|
125
|
+
*/
|
126
|
+
async _goHome() {
|
127
|
+
await this.mapView.goTo(this._homeExtent);
|
69
128
|
}
|
70
129
|
// need to discuss this with the team
|
71
130
|
_showList() {
|
@@ -73,15 +132,44 @@ const MapTools = /*@__PURE__*/ proxyCustomElement(class MapTools extends HTMLEle
|
|
73
132
|
}
|
74
133
|
// Need to discuss this with the team
|
75
134
|
_search() {
|
76
|
-
|
135
|
+
this._showSearchWidget = !this._showSearchWidget;
|
136
|
+
this._showTools = false;
|
77
137
|
}
|
78
|
-
|
79
|
-
|
80
|
-
|
138
|
+
/**
|
139
|
+
* Fixed zoom in
|
140
|
+
*
|
141
|
+
* @returns void
|
142
|
+
*
|
143
|
+
* @protected
|
144
|
+
*/
|
145
|
+
async _zoomIn() {
|
146
|
+
await this._zoom(this.mapView.zoom + 1);
|
147
|
+
}
|
148
|
+
/**
|
149
|
+
* Fixed zoom out
|
150
|
+
*
|
151
|
+
* @returns void
|
152
|
+
*
|
153
|
+
* @protected
|
154
|
+
*/
|
155
|
+
async _zoomOut() {
|
156
|
+
await this._zoom(this.mapView.zoom - 1);
|
81
157
|
}
|
82
|
-
|
83
|
-
|
84
|
-
|
158
|
+
/**
|
159
|
+
* Zoom in/out at the maps current center point
|
160
|
+
*
|
161
|
+
* @param zoom Number to zoom level to go to
|
162
|
+
*
|
163
|
+
* @returns void
|
164
|
+
*
|
165
|
+
* @protected
|
166
|
+
*/
|
167
|
+
async _zoom(zoom) {
|
168
|
+
var _a;
|
169
|
+
await ((_a = this.mapView) === null || _a === void 0 ? void 0 : _a.goTo({
|
170
|
+
target: this.mapView.center,
|
171
|
+
zoom
|
172
|
+
}));
|
85
173
|
}
|
86
174
|
/**
|
87
175
|
* Show/Hide the basemap picker
|
@@ -91,7 +179,8 @@ const MapTools = /*@__PURE__*/ proxyCustomElement(class MapTools extends HTMLEle
|
|
91
179
|
* @protected
|
92
180
|
*/
|
93
181
|
_toggleBasemapPicker() {
|
94
|
-
this.
|
182
|
+
this._showBasemapWidget = !this._showBasemapWidget;
|
183
|
+
this._showTools = false;
|
95
184
|
}
|
96
185
|
/**
|
97
186
|
* Emit the expand map event
|
@@ -111,6 +200,10 @@ const MapTools = /*@__PURE__*/ proxyCustomElement(class MapTools extends HTMLEle
|
|
111
200
|
* @protected
|
112
201
|
*/
|
113
202
|
_toggleTools() {
|
203
|
+
if (!this._showTools) {
|
204
|
+
this._showBasemapWidget = false;
|
205
|
+
this._showSearchWidget = false;
|
206
|
+
}
|
114
207
|
this._showTools = !this._showTools;
|
115
208
|
}
|
116
209
|
/**
|
@@ -124,66 +217,84 @@ const MapTools = /*@__PURE__*/ proxyCustomElement(class MapTools extends HTMLEle
|
|
124
217
|
this._translations = messages[0];
|
125
218
|
}
|
126
219
|
get el() { return this; }
|
220
|
+
static get watchers() { return {
|
221
|
+
"mapView": ["mapViewWatchHandler"],
|
222
|
+
"_showBasemapWidget": ["_showBasemapWidgetWatchHandler"],
|
223
|
+
"_showSearchWidget": ["_showSearchWidgetWatchHandler"]
|
224
|
+
}; }
|
127
225
|
static get style() { return mapToolsCss; }
|
128
226
|
}, [1, "map-tools", {
|
129
227
|
"layout": [1],
|
130
228
|
"mapView": [16],
|
229
|
+
"searchConfiguration": [16],
|
131
230
|
"_translations": [32],
|
132
231
|
"_showTools": [32],
|
133
|
-
"
|
232
|
+
"_showBasemapWidget": [32],
|
233
|
+
"_showSearchWidget": [32]
|
134
234
|
}]);
|
135
235
|
function defineCustomElement() {
|
136
236
|
if (typeof customElements === "undefined") {
|
137
237
|
return;
|
138
238
|
}
|
139
|
-
const components = ["map-tools", "calcite-action", "calcite-action-bar", "calcite-action-group", "calcite-action-menu", "calcite-icon", "calcite-loader", "calcite-popover", "calcite-tooltip"];
|
239
|
+
const components = ["map-tools", "basemap-gallery", "calcite-action", "calcite-action-bar", "calcite-action-group", "calcite-action-menu", "calcite-icon", "calcite-loader", "calcite-popover", "calcite-tooltip", "map-search"];
|
140
240
|
components.forEach(tagName => { switch (tagName) {
|
141
241
|
case "map-tools":
|
142
242
|
if (!customElements.get(tagName)) {
|
143
243
|
customElements.define(tagName, MapTools);
|
144
244
|
}
|
145
245
|
break;
|
246
|
+
case "basemap-gallery":
|
247
|
+
if (!customElements.get(tagName)) {
|
248
|
+
defineCustomElement$a();
|
249
|
+
}
|
250
|
+
break;
|
146
251
|
case "calcite-action":
|
147
252
|
if (!customElements.get(tagName)) {
|
148
|
-
defineCustomElement$
|
253
|
+
defineCustomElement$9();
|
149
254
|
}
|
150
255
|
break;
|
151
256
|
case "calcite-action-bar":
|
152
257
|
if (!customElements.get(tagName)) {
|
153
|
-
defineCustomElement$
|
258
|
+
defineCustomElement$8();
|
154
259
|
}
|
155
260
|
break;
|
156
261
|
case "calcite-action-group":
|
157
262
|
if (!customElements.get(tagName)) {
|
158
|
-
defineCustomElement$
|
263
|
+
defineCustomElement$7();
|
159
264
|
}
|
160
265
|
break;
|
161
266
|
case "calcite-action-menu":
|
162
267
|
if (!customElements.get(tagName)) {
|
163
|
-
defineCustomElement$
|
268
|
+
defineCustomElement$6();
|
164
269
|
}
|
165
270
|
break;
|
166
271
|
case "calcite-icon":
|
167
272
|
if (!customElements.get(tagName)) {
|
168
|
-
defineCustomElement$
|
273
|
+
defineCustomElement$5();
|
169
274
|
}
|
170
275
|
break;
|
171
276
|
case "calcite-loader":
|
172
277
|
if (!customElements.get(tagName)) {
|
173
|
-
defineCustomElement$
|
278
|
+
defineCustomElement$4();
|
174
279
|
}
|
175
280
|
break;
|
176
281
|
case "calcite-popover":
|
177
282
|
if (!customElements.get(tagName)) {
|
178
|
-
defineCustomElement$
|
283
|
+
defineCustomElement$3();
|
179
284
|
}
|
180
285
|
break;
|
181
286
|
case "calcite-tooltip":
|
287
|
+
if (!customElements.get(tagName)) {
|
288
|
+
defineCustomElement$2();
|
289
|
+
}
|
290
|
+
break;
|
291
|
+
case "map-search":
|
182
292
|
if (!customElements.get(tagName)) {
|
183
293
|
defineCustomElement$1();
|
184
294
|
}
|
185
295
|
break;
|
186
296
|
} });
|
187
297
|
}
|
298
|
+
defineCustomElement();
|
188
299
|
|
189
300
|
export { MapTools as M, defineCustomElement as d };
|
package/dist/components/menu.js
CHANGED
package/dist/components/panel.js
CHANGED
package/dist/components/scrim.js
CHANGED
package/dist/components/shell.js
CHANGED