@honua/react 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/columnar/apache-arrow.d.ts +17 -0
- package/columnar/apache-arrow.d.ts.map +1 -0
- package/columnar/apache-arrow.js +1036 -0
- package/columnar/batch-cache-conformance.d.ts +66 -0
- package/columnar/batch-cache-conformance.d.ts.map +1 -0
- package/columnar/batch-cache-conformance.js +317 -0
- package/columnar/batch-cache-indexeddb.d.ts +31 -0
- package/columnar/batch-cache-indexeddb.d.ts.map +1 -0
- package/columnar/batch-cache-indexeddb.js +148 -0
- package/columnar/batch-cache.d.ts +298 -0
- package/columnar/batch-cache.d.ts.map +1 -0
- package/columnar/batch-cache.js +757 -0
- package/columnar/geoarrow-aggregate.d.ts +178 -0
- package/columnar/geoarrow-aggregate.d.ts.map +1 -0
- package/columnar/geoarrow-aggregate.js +976 -0
- package/columnar/geoarrow-patch.d.ts +382 -0
- package/columnar/geoarrow-patch.d.ts.map +1 -0
- package/columnar/geoarrow-patch.js +1656 -0
- package/columnar/geoarrow-reproject.d.ts +22 -0
- package/columnar/geoarrow-reproject.d.ts.map +1 -0
- package/columnar/geoarrow-reproject.js +119 -0
- package/columnar/geoarrow-serialization.d.ts +68 -0
- package/columnar/geoarrow-serialization.d.ts.map +1 -0
- package/columnar/geoarrow-serialization.js +331 -0
- package/columnar/geoarrow-types.d.ts +271 -0
- package/columnar/geoarrow-types.d.ts.map +1 -0
- package/columnar/geoarrow-types.js +15 -0
- package/columnar/geoarrow.d.ts +52 -0
- package/columnar/geoarrow.d.ts.map +1 -0
- package/columnar/geoarrow.js +1469 -0
- package/columnar/index.d.ts +43 -0
- package/columnar/index.d.ts.map +1 -0
- package/columnar/index.js +29 -0
- package/columnar/operators.d.ts +70 -0
- package/columnar/operators.d.ts.map +1 -0
- package/columnar/operators.js +307 -0
- package/columnar/result.d.ts +369 -0
- package/columnar/result.d.ts.map +1 -0
- package/columnar/result.js +815 -0
- package/columnar/telemetry.d.ts +152 -0
- package/columnar/telemetry.d.ts.map +1 -0
- package/columnar/telemetry.js +265 -0
- package/columnar/transfer.d.ts +28 -0
- package/columnar/transfer.d.ts.map +1 -0
- package/columnar/transfer.js +669 -0
- package/columnar/types.d.ts +175 -0
- package/columnar/types.d.ts.map +1 -0
- package/columnar/types.js +22 -0
- package/columnar/worker.d.ts +157 -0
- package/columnar/worker.d.ts.map +1 -0
- package/columnar/worker.js +1059 -0
- package/connect-url-safety.d.ts +53 -0
- package/connect-url-safety.js +189 -0
- package/contract/pmtiles.d.ts +6 -5
- package/contract/pmtiles.d.ts.map +1 -1
- package/contract/pmtiles.js +30 -5
- package/contract/source.d.ts.map +1 -1
- package/contract/source.js +11 -8
- package/core/client.d.ts.map +1 -1
- package/core/client.js +87 -19
- package/core/deprecation-notice.d.ts +28 -0
- package/core/deprecation-notice.d.ts.map +1 -0
- package/core/deprecation-notice.js +22 -0
- package/core/esri-geojson.d.ts.map +1 -1
- package/core/esri-geojson.js +14 -8
- package/core/optional-grpc-peer.d.ts +15 -0
- package/core/optional-grpc-peer.d.ts.map +1 -0
- package/core/optional-grpc-peer.js +60 -0
- package/esri-compat/basemap-gallery.d.ts +2 -0
- package/esri-compat/basemap-gallery.d.ts.map +1 -1
- package/esri-compat/basemap-gallery.js +12 -0
- package/esri-compat/basemap.d.ts +4 -0
- package/esri-compat/basemap.d.ts.map +1 -1
- package/esri-compat/basemap.js +70 -0
- package/esri-compat/bookmarks.d.ts +2 -0
- package/esri-compat/bookmarks.d.ts.map +1 -1
- package/esri-compat/bookmarks.js +12 -0
- package/esri-compat/controls.d.ts +18 -0
- package/esri-compat/controls.d.ts.map +1 -1
- package/esri-compat/controls.js +120 -57
- package/esri-compat/directions.d.ts +4 -0
- package/esri-compat/directions.d.ts.map +1 -1
- package/esri-compat/directions.js +30 -20
- package/esri-compat/editor.d.ts +4 -0
- package/esri-compat/editor.d.ts.map +1 -1
- package/esri-compat/editor.js +16 -0
- package/esri-compat/esri-config.d.ts +2 -1
- package/esri-compat/esri-config.d.ts.map +1 -1
- package/esri-compat/feature-effect.d.ts +23 -0
- package/esri-compat/feature-effect.d.ts.map +1 -0
- package/esri-compat/feature-effect.js +12 -0
- package/esri-compat/feature-form.d.ts +6 -0
- package/esri-compat/feature-form.d.ts.map +1 -1
- package/esri-compat/feature-form.js +63 -0
- package/esri-compat/feature-layer.d.ts +21 -2
- package/esri-compat/feature-layer.d.ts.map +1 -1
- package/esri-compat/feature-layer.js +172 -1
- package/esri-compat/feature-table.d.ts +5 -0
- package/esri-compat/feature-table.d.ts.map +1 -1
- package/esri-compat/feature-table.js +23 -0
- package/esri-compat/identity-manager.d.ts +1 -1
- package/esri-compat/identity-manager.js +1 -1
- package/esri-compat/legend.d.ts +2 -0
- package/esri-compat/legend.d.ts.map +1 -1
- package/esri-compat/legend.js +98 -0
- package/esri-compat/locator.d.ts +1 -1
- package/esri-compat/locator.js +1 -1
- package/esri-compat/map-view-mount.d.ts +1 -0
- package/esri-compat/map-view-mount.d.ts.map +1 -1
- package/esri-compat/map-view-mount.js +46 -25
- package/esri-compat/map-view.d.ts +13 -0
- package/esri-compat/map-view.d.ts.map +1 -1
- package/esri-compat/map-view.js +94 -8
- package/esri-compat/map.d.ts +5 -1
- package/esri-compat/map.d.ts.map +1 -1
- package/esri-compat/map.js +10 -0
- package/esri-compat/measurement.d.ts +2 -0
- package/esri-compat/measurement.d.ts.map +1 -1
- package/esri-compat/measurement.js +14 -0
- package/esri-compat/point.d.ts +7 -0
- package/esri-compat/point.d.ts.map +1 -1
- package/esri-compat/point.js +33 -3
- package/esri-compat/popup.d.ts +2 -0
- package/esri-compat/popup.d.ts.map +1 -1
- package/esri-compat/popup.js +12 -0
- package/esri-compat/portal.d.ts +1 -1
- package/esri-compat/portal.js +1 -1
- package/esri-compat/print.d.ts +3 -0
- package/esri-compat/print.d.ts.map +1 -1
- package/esri-compat/print.js +15 -0
- package/esri-compat/search.d.ts +4 -0
- package/esri-compat/search.d.ts.map +1 -1
- package/esri-compat/search.js +25 -28
- package/esri-compat/sketch.d.ts +2 -0
- package/esri-compat/sketch.d.ts.map +1 -1
- package/esri-compat/sketch.js +12 -0
- package/esri-compat/widget-host.d.ts +46 -17
- package/esri-compat/widget-host.d.ts.map +1 -1
- package/esri-compat/widget-host.js +84 -20
- package/esri-compat/widget-shell-hosts.d.ts +61 -0
- package/esri-compat/widget-shell-hosts.d.ts.map +1 -0
- package/esri-compat/widget-shell-hosts.js +76 -0
- package/geocoding/index.d.ts +114 -0
- package/geocoding/index.d.ts.map +1 -0
- package/geocoding/index.js +293 -0
- package/geocoding/provider-http.d.ts +37 -0
- package/geocoding/provider-http.d.ts.map +1 -0
- package/geocoding/provider-http.js +93 -0
- package/geocoding/provider.d.ts +145 -0
- package/geocoding/provider.d.ts.map +1 -0
- package/geocoding/provider.js +41 -0
- package/geocoding/providers/honua.d.ts +28 -0
- package/geocoding/providers/honua.d.ts.map +1 -0
- package/geocoding/providers/honua.js +68 -0
- package/geocoding/providers/nominatim.d.ts +47 -0
- package/geocoding/providers/nominatim.d.ts.map +1 -0
- package/geocoding/providers/nominatim.js +105 -0
- package/geocoding/providers/pelias.d.ts +40 -0
- package/geocoding/providers/pelias.d.ts.map +1 -0
- package/geocoding/providers/pelias.js +115 -0
- package/geocoding/providers/photon.d.ts +39 -0
- package/geocoding/providers/photon.d.ts.map +1 -0
- package/geocoding/providers/photon.js +107 -0
- package/geometry/convert.d.ts +13 -0
- package/geometry/convert.d.ts.map +1 -0
- package/geometry/convert.js +12 -0
- package/geometry/index.d.ts +17 -0
- package/geometry/index.d.ts.map +1 -0
- package/geometry/index.js +15 -0
- package/geometry/internal.d.ts +25 -0
- package/geometry/internal.d.ts.map +1 -0
- package/geometry/internal.js +40 -0
- package/geometry/ops.d.ts +71 -0
- package/geometry/ops.d.ts.map +1 -0
- package/geometry/ops.js +147 -0
- package/geometry/project.d.ts +40 -0
- package/geometry/project.d.ts.map +1 -0
- package/geometry/project.js +88 -0
- package/geometry/types.d.ts +36 -0
- package/geometry/types.d.ts.map +1 -0
- package/geometry/types.js +12 -0
- package/kernel/renderer.d.ts +82 -0
- package/kernel/renderer.js +1 -0
- package/offline/digest.d.ts +15 -0
- package/offline/digest.js +58 -0
- package/offline/quota.d.ts +161 -0
- package/offline/quota.js +370 -0
- package/offline/types.d.ts +349 -0
- package/offline/types.js +75 -0
- package/package.json +14 -2
- package/realtime/odata-delta.d.ts +1 -1
- package/realtime/odata-delta.d.ts.map +1 -1
- package/realtime/odata-delta.js +38 -10
- package/widget-capabilities.d.ts +67 -0
- package/widget-capabilities.js +152 -0
|
@@ -53,10 +53,12 @@ export declare class BaseControlCompat {
|
|
|
53
53
|
}
|
|
54
54
|
export declare class HomeCompat extends BaseControlCompat {
|
|
55
55
|
viewpoint: HomeViewpointCompat;
|
|
56
|
+
private widgetHost;
|
|
56
57
|
protected get controlName(): string;
|
|
57
58
|
constructor(options?: HomeCompatOptions);
|
|
58
59
|
go(): Promise<void>;
|
|
59
60
|
reset(): void;
|
|
61
|
+
private pushWidgetHost;
|
|
60
62
|
}
|
|
61
63
|
export interface BasemapToggleCompatOptions {
|
|
62
64
|
view?: unknown;
|
|
@@ -69,9 +71,11 @@ export declare class BasemapToggleCompat extends BaseControlCompat {
|
|
|
69
71
|
readonly map: unknown;
|
|
70
72
|
activeBasemap: unknown;
|
|
71
73
|
nextBasemap: unknown;
|
|
74
|
+
private widgetHost;
|
|
72
75
|
protected get controlName(): string;
|
|
73
76
|
constructor(options?: BasemapToggleCompatOptions);
|
|
74
77
|
toggle(): unknown;
|
|
78
|
+
private pushWidgetHost;
|
|
75
79
|
}
|
|
76
80
|
export type ScaleBarUnitCompat = "metric" | "imperial" | "dual";
|
|
77
81
|
export interface ScaleBarCompatOptions {
|
|
@@ -84,10 +88,12 @@ export declare class ScaleBarCompat extends BaseControlCompat {
|
|
|
84
88
|
unit: ScaleBarUnitCompat;
|
|
85
89
|
scale: number | undefined;
|
|
86
90
|
text: string;
|
|
91
|
+
private widgetHost;
|
|
87
92
|
protected get controlName(): string;
|
|
88
93
|
constructor(options?: ScaleBarCompatOptions);
|
|
89
94
|
protected onLoad(): void;
|
|
90
95
|
refresh(): string;
|
|
96
|
+
private pushWidgetHost;
|
|
91
97
|
}
|
|
92
98
|
export interface LocateCompatOptions {
|
|
93
99
|
view?: unknown;
|
|
@@ -113,10 +119,12 @@ export declare class LocateCompat extends BaseControlCompat {
|
|
|
113
119
|
/** The latest locate result, so a directions stop can clone it. */
|
|
114
120
|
graphic: GraphicCompat | undefined;
|
|
115
121
|
private readonly locateProvider;
|
|
122
|
+
private widgetHost;
|
|
116
123
|
protected get controlName(): string;
|
|
117
124
|
constructor(options?: LocateCompatOptions);
|
|
118
125
|
attachContainer(element: HTMLElement): void;
|
|
119
126
|
locate(): Promise<LocatePositionCompat>;
|
|
127
|
+
private pushWidgetHost;
|
|
120
128
|
}
|
|
121
129
|
export interface CompassCompatOptions {
|
|
122
130
|
view?: unknown;
|
|
@@ -125,9 +133,12 @@ export interface CompassCompatOptions {
|
|
|
125
133
|
}
|
|
126
134
|
export declare class CompassCompat extends BaseControlCompat {
|
|
127
135
|
orientation: number;
|
|
136
|
+
private widgetHost;
|
|
128
137
|
protected get controlName(): string;
|
|
129
138
|
constructor(options?: CompassCompatOptions);
|
|
139
|
+
attachContainer(element: HTMLElement): void;
|
|
130
140
|
rotateTo(rotation: number): number;
|
|
141
|
+
private pushWidgetHost;
|
|
131
142
|
reset(): number;
|
|
132
143
|
goToNorth(): number;
|
|
133
144
|
}
|
|
@@ -139,12 +150,14 @@ export interface ZoomCompatOptions {
|
|
|
139
150
|
}
|
|
140
151
|
export declare class ZoomCompat extends BaseControlCompat {
|
|
141
152
|
readonly layout: "vertical" | "horizontal";
|
|
153
|
+
private widgetHost;
|
|
142
154
|
protected get controlName(): string;
|
|
143
155
|
constructor(options?: ZoomCompatOptions);
|
|
144
156
|
attachContainer(element: HTMLElement): void;
|
|
145
157
|
zoomIn(step?: number): number | undefined;
|
|
146
158
|
zoomOut(step?: number): number | undefined;
|
|
147
159
|
private adjustZoom;
|
|
160
|
+
private pushWidgetHost;
|
|
148
161
|
}
|
|
149
162
|
export interface FullscreenCompatOptions {
|
|
150
163
|
view?: unknown;
|
|
@@ -155,10 +168,12 @@ export interface FullscreenCompatOptions {
|
|
|
155
168
|
export declare class FullscreenCompat extends BaseControlCompat {
|
|
156
169
|
readonly element: HTMLElement | null;
|
|
157
170
|
active: boolean;
|
|
171
|
+
private widgetHost;
|
|
158
172
|
protected get controlName(): string;
|
|
159
173
|
constructor(options?: FullscreenCompatOptions);
|
|
160
174
|
enter(): void;
|
|
161
175
|
exit(): void;
|
|
176
|
+
private pushWidgetHost;
|
|
162
177
|
toggle(force?: boolean): boolean;
|
|
163
178
|
}
|
|
164
179
|
export interface AttributionCompatOptions {
|
|
@@ -173,10 +188,13 @@ export declare class AttributionCompat extends BaseControlCompat {
|
|
|
173
188
|
readonly map: unknown;
|
|
174
189
|
itemDelimiter: string;
|
|
175
190
|
attributions: string[];
|
|
191
|
+
private widgetHost;
|
|
176
192
|
protected get controlName(): string;
|
|
177
193
|
constructor(options?: AttributionCompatOptions);
|
|
194
|
+
attachContainer(element: HTMLElement): void;
|
|
178
195
|
addAttribution(value: string): void;
|
|
179
196
|
removeAttribution(value: string): boolean;
|
|
197
|
+
private pushWidgetHost;
|
|
180
198
|
getText(): string;
|
|
181
199
|
}
|
|
182
200
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/controls.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,uBAAuB,EAG7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/controls.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,E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Ub,IAAI,IAAI,IAAI;IAUnB,OAAO,CAAC,cAAc;IAQf,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO;CASxC;AAMD,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,qBAAa,iBAAkB,SAAQ,iBAAiB;IACtD,SAAgB,GAAG,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,EAAE,CAAC;IAC9B,OAAO,CAAC,UAAU,CAA8B;IAEhD,cAAuB,WAAW,IAAI,MAAM,CAE3C;gBAEkB,OAAO,GAAE,wBAA6B;IASlD,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAU3C,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAWnC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAahD,OAAO,CAAC,cAAc;IAQf,OAAO,IAAI,MAAM;CAMzB"}
|
package/esri-compat/controls.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { CompatEventBus, resolveCompatEventBus, safeInvokeCompatListener, } from "./event-bus.js";
|
|
2
2
|
import { GraphicCompat } from "./graphic.js";
|
|
3
|
+
import { bindHonuaWidgetHost, pushWidgetHostState } from "./widget-host.js";
|
|
4
|
+
/** Map construction replaces the view's children, so a later slot is a new container. */
|
|
5
|
+
function retargetWidgetHost(current, tagName, element, eventBus) {
|
|
6
|
+
current?.destroy();
|
|
7
|
+
return bindHonuaWidgetHost(tagName, element, eventBus);
|
|
8
|
+
}
|
|
3
9
|
export class BaseControlCompat {
|
|
4
10
|
view;
|
|
5
11
|
container;
|
|
@@ -85,6 +91,7 @@ export class BaseControlCompat {
|
|
|
85
91
|
// ---------------------------------------------------------------------------
|
|
86
92
|
export class HomeCompat extends BaseControlCompat {
|
|
87
93
|
viewpoint;
|
|
94
|
+
widgetHost;
|
|
88
95
|
get controlName() {
|
|
89
96
|
return "home";
|
|
90
97
|
}
|
|
@@ -94,6 +101,8 @@ export class HomeCompat extends BaseControlCompat {
|
|
|
94
101
|
center: extractViewCenter(options.view),
|
|
95
102
|
zoom: extractViewZoom(options.view),
|
|
96
103
|
};
|
|
104
|
+
this.widgetHost = bindHonuaWidgetHost("honua-home", this.container, this.eventBus);
|
|
105
|
+
this.pushWidgetHost();
|
|
97
106
|
}
|
|
98
107
|
async go() {
|
|
99
108
|
const target = {
|
|
@@ -115,12 +124,20 @@ export class HomeCompat extends BaseControlCompat {
|
|
|
115
124
|
};
|
|
116
125
|
this.notifyWatchers("viewpoint", this.viewpoint);
|
|
117
126
|
this.eventBus.emit("home.reset", this.viewpoint, this);
|
|
127
|
+
this.pushWidgetHost();
|
|
128
|
+
}
|
|
129
|
+
pushWidgetHost() {
|
|
130
|
+
pushWidgetHostState(this.widgetHost, {
|
|
131
|
+
view: this.view,
|
|
132
|
+
viewpoint: this.viewpoint,
|
|
133
|
+
});
|
|
118
134
|
}
|
|
119
135
|
}
|
|
120
136
|
export class BasemapToggleCompat extends BaseControlCompat {
|
|
121
137
|
map;
|
|
122
138
|
activeBasemap;
|
|
123
139
|
nextBasemap;
|
|
140
|
+
widgetHost;
|
|
124
141
|
get controlName() {
|
|
125
142
|
return "basemap-toggle";
|
|
126
143
|
}
|
|
@@ -130,6 +147,8 @@ export class BasemapToggleCompat extends BaseControlCompat {
|
|
|
130
147
|
this.map = map;
|
|
131
148
|
this.activeBasemap = extractMapBasemap(this.map);
|
|
132
149
|
this.nextBasemap = options.nextBasemap;
|
|
150
|
+
this.widgetHost = bindHonuaWidgetHost("honua-basemap-control", this.container, this.eventBus);
|
|
151
|
+
this.pushWidgetHost();
|
|
133
152
|
this.subscriptions.push(this.eventBus.on("map.basemap-changed", (event) => {
|
|
134
153
|
this.activeBasemap = extractPayloadBasemap(event.payload);
|
|
135
154
|
this.notifyWatchers("activeBasemap", this.activeBasemap);
|
|
@@ -150,13 +169,22 @@ export class BasemapToggleCompat extends BaseControlCompat {
|
|
|
150
169
|
activeBasemap: this.activeBasemap,
|
|
151
170
|
nextBasemap: this.nextBasemap,
|
|
152
171
|
}, this);
|
|
172
|
+
this.pushWidgetHost();
|
|
153
173
|
return this.activeBasemap;
|
|
154
174
|
}
|
|
175
|
+
pushWidgetHost() {
|
|
176
|
+
pushWidgetHostState(this.widgetHost, {
|
|
177
|
+
view: this.view,
|
|
178
|
+
mode: "toggle",
|
|
179
|
+
nextBasemap: this.nextBasemap,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
155
182
|
}
|
|
156
183
|
export class ScaleBarCompat extends BaseControlCompat {
|
|
157
184
|
unit;
|
|
158
185
|
scale;
|
|
159
186
|
text;
|
|
187
|
+
widgetHost;
|
|
160
188
|
get controlName() {
|
|
161
189
|
return "scalebar";
|
|
162
190
|
}
|
|
@@ -165,6 +193,7 @@ export class ScaleBarCompat extends BaseControlCompat {
|
|
|
165
193
|
this.unit = options.unit ?? "metric";
|
|
166
194
|
this.scale = undefined;
|
|
167
195
|
this.text = "";
|
|
196
|
+
this.widgetHost = bindHonuaWidgetHost("honua-scale-bar", this.container, this.eventBus);
|
|
168
197
|
this.subscriptions.push(this.eventBus.on("view.go-to", () => {
|
|
169
198
|
this.refresh();
|
|
170
199
|
}));
|
|
@@ -180,6 +209,7 @@ export class ScaleBarCompat extends BaseControlCompat {
|
|
|
180
209
|
this.notifyWatchers("scale", this.scale);
|
|
181
210
|
this.text = "";
|
|
182
211
|
this.notifyWatchers("text", this.text);
|
|
212
|
+
this.pushWidgetHost();
|
|
183
213
|
return this.text;
|
|
184
214
|
}
|
|
185
215
|
const mapScale = 591657527.591555 / 2 ** zoom;
|
|
@@ -188,8 +218,17 @@ export class ScaleBarCompat extends BaseControlCompat {
|
|
|
188
218
|
this.text = buildScaleBarText(mapScale, this.unit);
|
|
189
219
|
this.notifyWatchers("text", this.text);
|
|
190
220
|
this.eventBus.emit("scalebar.updated", { scale: mapScale, text: this.text, unit: this.unit }, this);
|
|
221
|
+
this.pushWidgetHost();
|
|
191
222
|
return this.text;
|
|
192
223
|
}
|
|
224
|
+
pushWidgetHost() {
|
|
225
|
+
pushWidgetHostState(this.widgetHost, {
|
|
226
|
+
view: this.view,
|
|
227
|
+
map: this.view,
|
|
228
|
+
unit: this.unit,
|
|
229
|
+
text: this.text,
|
|
230
|
+
});
|
|
231
|
+
}
|
|
193
232
|
}
|
|
194
233
|
export class LocateCompat extends BaseControlCompat {
|
|
195
234
|
zoom;
|
|
@@ -199,6 +238,7 @@ export class LocateCompat extends BaseControlCompat {
|
|
|
199
238
|
/** The latest locate result, so a directions stop can clone it. */
|
|
200
239
|
graphic;
|
|
201
240
|
locateProvider;
|
|
241
|
+
widgetHost;
|
|
202
242
|
get controlName() {
|
|
203
243
|
return "locate";
|
|
204
244
|
}
|
|
@@ -209,14 +249,21 @@ export class LocateCompat extends BaseControlCompat {
|
|
|
209
249
|
this.graphic = undefined;
|
|
210
250
|
this.viewModel = { state: "ready" };
|
|
211
251
|
this.locateProvider = options.locateProvider ?? getDefaultLocateProvider();
|
|
212
|
-
|
|
252
|
+
this.widgetHost = bindHonuaWidgetHost("honua-locate-control", this.container, this.eventBus);
|
|
253
|
+
this.pushWidgetHost();
|
|
213
254
|
}
|
|
214
255
|
attachContainer(element) {
|
|
256
|
+
if (this.container === element && this.widgetHost) {
|
|
257
|
+
this.pushWidgetHost();
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
215
260
|
this.container = element;
|
|
216
|
-
|
|
261
|
+
this.widgetHost = retargetWidgetHost(this.widgetHost, "honua-locate-control", element, this.eventBus);
|
|
262
|
+
this.pushWidgetHost();
|
|
217
263
|
}
|
|
218
264
|
async locate() {
|
|
219
265
|
this.viewModel.state = "disabled";
|
|
266
|
+
this.pushWidgetHost();
|
|
220
267
|
this.eventBus.emit("locate.start", undefined, this);
|
|
221
268
|
try {
|
|
222
269
|
const position = await this.locateProvider();
|
|
@@ -243,23 +290,43 @@ export class LocateCompat extends BaseControlCompat {
|
|
|
243
290
|
zoom: this.zoom,
|
|
244
291
|
}, this);
|
|
245
292
|
this.viewModel.state = "ready";
|
|
293
|
+
this.pushWidgetHost();
|
|
246
294
|
return position;
|
|
247
295
|
}
|
|
248
296
|
catch (error) {
|
|
249
297
|
this.viewModel.state = "ready";
|
|
298
|
+
this.pushWidgetHost();
|
|
250
299
|
this.eventBus.emit("locate.error", { error }, this);
|
|
251
300
|
throw error;
|
|
252
301
|
}
|
|
253
302
|
}
|
|
303
|
+
pushWidgetHost() {
|
|
304
|
+
pushWidgetHostState(this.widgetHost, {
|
|
305
|
+
view: this.view,
|
|
306
|
+
locateState: this.viewModel.state,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
254
309
|
}
|
|
255
310
|
export class CompassCompat extends BaseControlCompat {
|
|
256
311
|
orientation;
|
|
312
|
+
widgetHost;
|
|
257
313
|
get controlName() {
|
|
258
314
|
return "compass";
|
|
259
315
|
}
|
|
260
316
|
constructor(options = {}) {
|
|
261
317
|
super(options);
|
|
262
318
|
this.orientation = extractViewRotation(options.view) ?? 0;
|
|
319
|
+
this.widgetHost = bindHonuaWidgetHost("honua-compass", this.container, this.eventBus);
|
|
320
|
+
this.pushWidgetHost();
|
|
321
|
+
}
|
|
322
|
+
attachContainer(element) {
|
|
323
|
+
if (this.container === element && this.widgetHost) {
|
|
324
|
+
this.pushWidgetHost();
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
this.container = element;
|
|
328
|
+
this.widgetHost = retargetWidgetHost(this.widgetHost, "honua-compass", element, this.eventBus);
|
|
329
|
+
this.pushWidgetHost();
|
|
263
330
|
}
|
|
264
331
|
rotateTo(rotation) {
|
|
265
332
|
const next = Number.isFinite(rotation) ? rotation : this.orientation;
|
|
@@ -269,8 +336,12 @@ export class CompassCompat extends BaseControlCompat {
|
|
|
269
336
|
this.view.rotation = next;
|
|
270
337
|
}
|
|
271
338
|
this.eventBus.emit("compass.rotated", { rotation: next }, this);
|
|
339
|
+
this.pushWidgetHost();
|
|
272
340
|
return this.orientation;
|
|
273
341
|
}
|
|
342
|
+
pushWidgetHost() {
|
|
343
|
+
pushWidgetHostState(this.widgetHost, { view: this.view });
|
|
344
|
+
}
|
|
274
345
|
reset() {
|
|
275
346
|
const rotation = this.rotateTo(0);
|
|
276
347
|
this.eventBus.emit("compass.reset", { rotation }, this);
|
|
@@ -282,17 +353,24 @@ export class CompassCompat extends BaseControlCompat {
|
|
|
282
353
|
}
|
|
283
354
|
export class ZoomCompat extends BaseControlCompat {
|
|
284
355
|
layout;
|
|
356
|
+
widgetHost;
|
|
285
357
|
get controlName() {
|
|
286
358
|
return "zoom";
|
|
287
359
|
}
|
|
288
360
|
constructor(options = {}) {
|
|
289
361
|
super(options);
|
|
290
362
|
this.layout = options.layout ?? "vertical";
|
|
291
|
-
|
|
363
|
+
this.widgetHost = bindHonuaWidgetHost("honua-zoom", this.container, this.eventBus);
|
|
364
|
+
this.pushWidgetHost();
|
|
292
365
|
}
|
|
293
366
|
attachContainer(element) {
|
|
367
|
+
if (this.container === element && this.widgetHost) {
|
|
368
|
+
this.pushWidgetHost();
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
294
371
|
this.container = element;
|
|
295
|
-
|
|
372
|
+
this.widgetHost = retargetWidgetHost(this.widgetHost, "honua-zoom", element, this.eventBus);
|
|
373
|
+
this.pushWidgetHost();
|
|
296
374
|
}
|
|
297
375
|
zoomIn(step = 1) {
|
|
298
376
|
return this.adjustZoom(Math.abs(step));
|
|
@@ -315,65 +393,18 @@ export class ZoomCompat extends BaseControlCompat {
|
|
|
315
393
|
this.eventBus.emit("zoom.changed", { zoom: next, delta }, this);
|
|
316
394
|
return next;
|
|
317
395
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
: typeof container === "string" && typeof document !== "undefined"
|
|
324
|
-
? document.getElementById(container)
|
|
325
|
-
: null;
|
|
326
|
-
if (!element) {
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
element.querySelector(":scope > .honua-zoom")?.remove();
|
|
330
|
-
const bar = document.createElement("div");
|
|
331
|
-
bar.className = "honua-zoom";
|
|
332
|
-
bar.style.display = "flex";
|
|
333
|
-
bar.style.flexDirection = zoom.layout === "horizontal" ? "row" : "column";
|
|
334
|
-
bar.style.gap = "4px";
|
|
335
|
-
for (const [label, step] of [
|
|
336
|
-
["+", 1],
|
|
337
|
-
["−", -1],
|
|
338
|
-
]) {
|
|
339
|
-
const button = document.createElement("button");
|
|
340
|
-
button.type = "button";
|
|
341
|
-
button.textContent = label;
|
|
342
|
-
button.addEventListener("click", () => {
|
|
343
|
-
if (step > 0) {
|
|
344
|
-
zoom.zoomIn();
|
|
345
|
-
}
|
|
346
|
-
else {
|
|
347
|
-
zoom.zoomOut();
|
|
348
|
-
}
|
|
396
|
+
pushWidgetHost() {
|
|
397
|
+
pushWidgetHostState(this.widgetHost, {
|
|
398
|
+
view: this.view,
|
|
399
|
+
map: this.view,
|
|
400
|
+
layout: this.layout,
|
|
349
401
|
});
|
|
350
|
-
bar.append(button);
|
|
351
402
|
}
|
|
352
|
-
element.append(bar);
|
|
353
|
-
}
|
|
354
|
-
function mountLocateButton(locate) {
|
|
355
|
-
const container = locate.container;
|
|
356
|
-
const element = typeof HTMLElement !== "undefined" && container instanceof HTMLElement
|
|
357
|
-
? container
|
|
358
|
-
: typeof container === "string" && typeof document !== "undefined"
|
|
359
|
-
? document.getElementById(container)
|
|
360
|
-
: null;
|
|
361
|
-
if (!element) {
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
element.querySelector(":scope > .honua-locate")?.remove();
|
|
365
|
-
const button = document.createElement("button");
|
|
366
|
-
button.type = "button";
|
|
367
|
-
button.className = "honua-locate";
|
|
368
|
-
button.textContent = "Locate";
|
|
369
|
-
button.addEventListener("click", () => {
|
|
370
|
-
void locate.locate();
|
|
371
|
-
});
|
|
372
|
-
element.append(button);
|
|
373
403
|
}
|
|
374
404
|
export class FullscreenCompat extends BaseControlCompat {
|
|
375
405
|
element;
|
|
376
406
|
active;
|
|
407
|
+
widgetHost;
|
|
377
408
|
get controlName() {
|
|
378
409
|
return "fullscreen";
|
|
379
410
|
}
|
|
@@ -381,6 +412,8 @@ export class FullscreenCompat extends BaseControlCompat {
|
|
|
381
412
|
super(options);
|
|
382
413
|
this.element = options.element ?? null;
|
|
383
414
|
this.active = false;
|
|
415
|
+
this.widgetHost = bindHonuaWidgetHost("honua-fullscreen", this.container, this.eventBus);
|
|
416
|
+
this.pushWidgetHost();
|
|
384
417
|
}
|
|
385
418
|
enter() {
|
|
386
419
|
if (this.active) {
|
|
@@ -389,6 +422,7 @@ export class FullscreenCompat extends BaseControlCompat {
|
|
|
389
422
|
this.active = true;
|
|
390
423
|
this.notifyWatchers("active", this.active);
|
|
391
424
|
this.eventBus.emit("fullscreen.changed", { active: true }, this);
|
|
425
|
+
this.pushWidgetHost();
|
|
392
426
|
}
|
|
393
427
|
exit() {
|
|
394
428
|
if (!this.active) {
|
|
@@ -397,6 +431,14 @@ export class FullscreenCompat extends BaseControlCompat {
|
|
|
397
431
|
this.active = false;
|
|
398
432
|
this.notifyWatchers("active", this.active);
|
|
399
433
|
this.eventBus.emit("fullscreen.changed", { active: false }, this);
|
|
434
|
+
this.pushWidgetHost();
|
|
435
|
+
}
|
|
436
|
+
pushWidgetHost() {
|
|
437
|
+
pushWidgetHostState(this.widgetHost, {
|
|
438
|
+
view: this.view,
|
|
439
|
+
map: this.view,
|
|
440
|
+
active: this.active,
|
|
441
|
+
});
|
|
400
442
|
}
|
|
401
443
|
toggle(force) {
|
|
402
444
|
const next = force ?? !this.active;
|
|
@@ -413,6 +455,7 @@ export class AttributionCompat extends BaseControlCompat {
|
|
|
413
455
|
map;
|
|
414
456
|
itemDelimiter;
|
|
415
457
|
attributions;
|
|
458
|
+
widgetHost;
|
|
416
459
|
get controlName() {
|
|
417
460
|
return "attribution";
|
|
418
461
|
}
|
|
@@ -421,6 +464,17 @@ export class AttributionCompat extends BaseControlCompat {
|
|
|
421
464
|
this.map = options.map ?? extractViewMap(options.view);
|
|
422
465
|
this.itemDelimiter = options.itemDelimiter ?? " | ";
|
|
423
466
|
this.attributions = options.attributions ? [...options.attributions] : [];
|
|
467
|
+
this.widgetHost = bindHonuaWidgetHost("honua-attribution", this.container, this.eventBus);
|
|
468
|
+
this.pushWidgetHost();
|
|
469
|
+
}
|
|
470
|
+
attachContainer(element) {
|
|
471
|
+
if (this.container === element && this.widgetHost) {
|
|
472
|
+
this.pushWidgetHost();
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
this.container = element;
|
|
476
|
+
this.widgetHost = retargetWidgetHost(this.widgetHost, "honua-attribution", element, this.eventBus);
|
|
477
|
+
this.pushWidgetHost();
|
|
424
478
|
}
|
|
425
479
|
addAttribution(value) {
|
|
426
480
|
if (value.trim().length === 0) {
|
|
@@ -430,6 +484,7 @@ export class AttributionCompat extends BaseControlCompat {
|
|
|
430
484
|
this.notifyWatchers("attributions", this.attributions);
|
|
431
485
|
this.notifyWatchers("text", this.getText());
|
|
432
486
|
this.eventBus.emit("attribution.updated", { count: this.attributions.length }, this);
|
|
487
|
+
this.pushWidgetHost();
|
|
433
488
|
}
|
|
434
489
|
removeAttribution(value) {
|
|
435
490
|
const index = this.attributions.indexOf(value);
|
|
@@ -440,8 +495,16 @@ export class AttributionCompat extends BaseControlCompat {
|
|
|
440
495
|
this.notifyWatchers("attributions", this.attributions);
|
|
441
496
|
this.notifyWatchers("text", this.getText());
|
|
442
497
|
this.eventBus.emit("attribution.updated", { count: this.attributions.length }, this);
|
|
498
|
+
this.pushWidgetHost();
|
|
443
499
|
return true;
|
|
444
500
|
}
|
|
501
|
+
pushWidgetHost() {
|
|
502
|
+
pushWidgetHostState(this.widgetHost, {
|
|
503
|
+
view: this.view,
|
|
504
|
+
map: this.map,
|
|
505
|
+
attributions: this.attributions,
|
|
506
|
+
});
|
|
507
|
+
}
|
|
445
508
|
getText() {
|
|
446
509
|
if (this.attributions.length === 0) {
|
|
447
510
|
return "";
|
|
@@ -33,6 +33,7 @@ export declare class DirectionsCompat {
|
|
|
33
33
|
readonly layer: RouteLayerCompat;
|
|
34
34
|
route: RouteSolveResultCompat | undefined;
|
|
35
35
|
private readonly watchListeners;
|
|
36
|
+
private widgetHost;
|
|
36
37
|
constructor(options?: DirectionsCompatOptions);
|
|
37
38
|
load(): Promise<DirectionsCompat>;
|
|
38
39
|
when(callback?: (widget: DirectionsCompat) => void): Promise<DirectionsCompat>;
|
|
@@ -41,6 +42,9 @@ export declare class DirectionsCompat {
|
|
|
41
42
|
addStop(stop: RouteStopCompat): void;
|
|
42
43
|
clearStops(): void;
|
|
43
44
|
solve(): Promise<RouteSolveResultCompat | undefined>;
|
|
45
|
+
/** Shows a route result that already exists. Does not invent maneuvers from a polyline. */
|
|
46
|
+
setRoute(route: RouteSolveResultCompat | undefined): void;
|
|
47
|
+
private pushWidgetHost;
|
|
44
48
|
getSummary(): DirectionsSolveSummaryCompat | undefined;
|
|
45
49
|
destroy(): void;
|
|
46
50
|
private notifyWatchers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directions.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/directions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAmD,MAAM,gBAAgB,CAAC;AAEjG,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EAErB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAmB,KAAK,0BAA0B,EAA8B,MAAM,iBAAiB,CAAC;
|
|
1
|
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rB,SAAS,IAAI,IAAI,CAAC;QAClB,OAAO,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CAAC;KAC1C,CAAC;IAEF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAuD;gBAGnF,OAAO,GAAE;QACP,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,uBAAuB,CAAC,eAAe,CAAC,CAAC;KACrD;IAoBK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBrB,aAAa,IAAI,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC;IAuBtE,KAAK,IAAI,IAAI;CAIrB"}
|
|
@@ -3,6 +3,7 @@ import { CompatEventBus, resolveCompatEventBus, safeInvokeCompatListener } from
|
|
|
3
3
|
import { identityManager } from "./identity-manager.js";
|
|
4
4
|
import { RouteLayerCompat, routeStopFromUnknown, } from "./route-layer.js";
|
|
5
5
|
import { RouteTaskCompat, arcGisRouteServiceProvider } from "./route-task.js";
|
|
6
|
+
import { bindHonuaWidgetHost, pushWidgetHostState } from "./widget-host.js";
|
|
6
7
|
/** Default `routeServiceUrl` on Esri `DirectionsViewModel` for the 4.x widget apps. */
|
|
7
8
|
const DEFAULT_ROUTE_SERVICE_URL = "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World";
|
|
8
9
|
export class DirectionsCompat {
|
|
@@ -16,6 +17,7 @@ export class DirectionsCompat {
|
|
|
16
17
|
layer;
|
|
17
18
|
route;
|
|
18
19
|
watchListeners;
|
|
20
|
+
widgetHost;
|
|
19
21
|
constructor(options = {}) {
|
|
20
22
|
this.view = options.view;
|
|
21
23
|
this.container = options.container;
|
|
@@ -33,9 +35,10 @@ export class DirectionsCompat {
|
|
|
33
35
|
routeProvider: options.routeProvider ?? arcGisRouteServiceProvider(routeServiceUrl, options.apiKey),
|
|
34
36
|
eventBus: this.eventBus,
|
|
35
37
|
});
|
|
36
|
-
mountDirectionsPanel(this.container);
|
|
37
38
|
this.route = undefined;
|
|
38
39
|
this.watchListeners = new Map();
|
|
40
|
+
this.widgetHost = bindHonuaWidgetHost("honua-directions", this.container, this.eventBus);
|
|
41
|
+
this.pushWidgetHost();
|
|
39
42
|
}
|
|
40
43
|
async load() {
|
|
41
44
|
if (this.loaded) {
|
|
@@ -88,6 +91,7 @@ export class DirectionsCompat {
|
|
|
88
91
|
this.notifyWatchers("stops", this.layer.stops);
|
|
89
92
|
this.route = undefined;
|
|
90
93
|
this.notifyWatchers("route", this.route);
|
|
94
|
+
this.pushWidgetHost();
|
|
91
95
|
this.eventBus.emit("directions.stops-cleared", undefined, this);
|
|
92
96
|
}
|
|
93
97
|
async solve() {
|
|
@@ -96,16 +100,30 @@ export class DirectionsCompat {
|
|
|
96
100
|
const route = await this.layer.solve();
|
|
97
101
|
this.route = route;
|
|
98
102
|
this.notifyWatchers("route", this.route);
|
|
103
|
+
this.pushWidgetHost();
|
|
99
104
|
this.eventBus.emit("directions.solve-completed", { route }, this);
|
|
100
105
|
return route;
|
|
101
106
|
}
|
|
102
107
|
catch (error) {
|
|
103
108
|
this.route = undefined;
|
|
104
109
|
this.notifyWatchers("route", this.route);
|
|
110
|
+
this.pushWidgetHost();
|
|
105
111
|
this.eventBus.emit("directions.solve-error", { error }, this);
|
|
106
112
|
throw error;
|
|
107
113
|
}
|
|
108
114
|
}
|
|
115
|
+
/** Shows a route result that already exists. Does not invent maneuvers from a polyline. */
|
|
116
|
+
setRoute(route) {
|
|
117
|
+
this.route = route;
|
|
118
|
+
this.notifyWatchers("route", this.route);
|
|
119
|
+
this.pushWidgetHost();
|
|
120
|
+
}
|
|
121
|
+
pushWidgetHost() {
|
|
122
|
+
pushWidgetHostState(this.widgetHost, {
|
|
123
|
+
view: this.view,
|
|
124
|
+
route: directionRoute(this.route),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
109
127
|
getSummary() {
|
|
110
128
|
if (!this.route) {
|
|
111
129
|
return undefined;
|
|
@@ -213,25 +231,17 @@ async function readTravelModes(url, token) {
|
|
|
213
231
|
}
|
|
214
232
|
return (json.supportedTravelModes ?? []).filter((mode) => mode && typeof mode === "object");
|
|
215
233
|
}
|
|
216
|
-
function
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
if (typeof HTMLElement !== "undefined" && container instanceof HTMLElement) {
|
|
228
|
-
return container;
|
|
229
|
-
}
|
|
230
|
-
if (typeof container === "string" && typeof document !== "undefined") {
|
|
231
|
-
const element = document.getElementById(container);
|
|
232
|
-
return typeof HTMLElement !== "undefined" && element instanceof HTMLElement ? element : undefined;
|
|
233
|
-
}
|
|
234
|
-
return undefined;
|
|
234
|
+
function directionRoute(route) {
|
|
235
|
+
if (!route)
|
|
236
|
+
return undefined;
|
|
237
|
+
const withSteps = route;
|
|
238
|
+
const steps = withSteps.directionFeatures?.map((step) => ({ text: step.text, maneuver: step.text })) ?? withSteps.steps;
|
|
239
|
+
const summary = withSteps.summary ?? `${withSteps.totalLengthMeters} m`;
|
|
240
|
+
return {
|
|
241
|
+
summary,
|
|
242
|
+
steps,
|
|
243
|
+
polyline: withSteps.polyline ?? withSteps.path,
|
|
244
|
+
};
|
|
235
245
|
}
|
|
236
246
|
function tokenForRouteService(url, apiKey) {
|
|
237
247
|
if (apiKey) {
|
package/esri-compat/editor.d.ts
CHANGED
|
@@ -36,7 +36,10 @@ export declare class EditorCompat {
|
|
|
36
36
|
selectedFeature: Record<string, unknown> | null;
|
|
37
37
|
snappingOptions: SnappingOptionsCompat;
|
|
38
38
|
private readonly watchListeners;
|
|
39
|
+
private readonly widgetHost;
|
|
39
40
|
constructor(options?: EditorCompatOptions);
|
|
41
|
+
/** First configured layer, pushed into `<honua-editor>`. */
|
|
42
|
+
get layer(): unknown;
|
|
40
43
|
/** Replace the ArcGIS-shaped snapping options and notify watchers. */
|
|
41
44
|
setSnappingOptions(options: SnappingOptionsCompat): void;
|
|
42
45
|
/** The snapping options mapped onto the contract `SnappingConfig`. */
|
|
@@ -50,6 +53,7 @@ export declare class EditorCompat {
|
|
|
50
53
|
deleteFeatureFromWorkflow(feature?: unknown): boolean;
|
|
51
54
|
stopWorkflow(): void;
|
|
52
55
|
destroy(): void;
|
|
56
|
+
private pushWidgetHost;
|
|
53
57
|
private notifyWatchers;
|
|
54
58
|
}
|
|
55
59
|
//# sourceMappingURL=editor.d.ts.map
|