@honua/sdk-esri-compat 0.0.6-alpha.0
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/README.md +5 -0
- package/contract/edit-session.d.ts +203 -0
- package/contract/edit-session.d.ts.map +1 -0
- package/contract/edit-session.js +717 -0
- package/contract/index.d.ts +20 -0
- package/contract/index.d.ts.map +1 -0
- package/contract/index.js +15 -0
- package/contract/jobs.d.ts +115 -0
- package/contract/jobs.d.ts.map +1 -0
- package/contract/jobs.js +22 -0
- package/contract/source.d.ts +138 -0
- package/contract/source.d.ts.map +1 -0
- package/contract/source.js +3364 -0
- package/contract/spatial-aggregation.d.ts +312 -0
- package/contract/spatial-aggregation.d.ts.map +1 -0
- package/contract/spatial-aggregation.js +196 -0
- package/contract/types.d.ts +542 -0
- package/contract/types.d.ts.map +1 -0
- package/contract/types.js +171 -0
- package/core/batch.d.ts +37 -0
- package/core/batch.d.ts.map +1 -0
- package/core/batch.js +78 -0
- package/core/cache-state.d.ts +76 -0
- package/core/cache-state.d.ts.map +1 -0
- package/core/cache-state.js +84 -0
- package/core/client.d.ts +289 -0
- package/core/client.d.ts.map +1 -0
- package/core/client.js +2625 -0
- package/core/errors.d.ts +68 -0
- package/core/errors.d.ts.map +1 -0
- package/core/errors.js +116 -0
- package/core/grpc-adapter.d.ts +23 -0
- package/core/grpc-adapter.d.ts.map +1 -0
- package/core/grpc-adapter.js +704 -0
- package/core/odata.d.ts +347 -0
- package/core/odata.d.ts.map +1 -0
- package/core/odata.js +837 -0
- package/core/ogc-conformance.d.ts +35 -0
- package/core/ogc-conformance.d.ts.map +1 -0
- package/core/ogc-conformance.js +121 -0
- package/core/ogc-maps.d.ts +45 -0
- package/core/ogc-maps.d.ts.map +1 -0
- package/core/ogc-maps.js +53 -0
- package/core/ogc-processes.d.ts +92 -0
- package/core/ogc-processes.d.ts.map +1 -0
- package/core/ogc-processes.js +325 -0
- package/core/ogc-tiles.d.ts +55 -0
- package/core/ogc-tiles.d.ts.map +1 -0
- package/core/ogc-tiles.js +81 -0
- package/core/pbf-decoder.d.ts +28 -0
- package/core/pbf-decoder.d.ts.map +1 -0
- package/core/pbf-decoder.js +627 -0
- package/core/query-builder.d.ts +261 -0
- package/core/query-builder.d.ts.map +1 -0
- package/core/query-builder.js +538 -0
- package/core/spatial-filter.d.ts +93 -0
- package/core/spatial-filter.d.ts.map +1 -0
- package/core/spatial-filter.js +153 -0
- package/core/stac.d.ts +43 -0
- package/core/stac.d.ts.map +1 -0
- package/core/stac.js +116 -0
- package/core/surfaces.d.ts +464 -0
- package/core/surfaces.d.ts.map +1 -0
- package/core/surfaces.js +1322 -0
- package/core/types.d.ts +1238 -0
- package/core/types.d.ts.map +1 -0
- package/core/types.js +13 -0
- package/core/wfs-capabilities.d.ts +143 -0
- package/core/wfs-capabilities.d.ts.map +1 -0
- package/core/wfs-capabilities.js +478 -0
- package/core/wfs-filter.d.ts +118 -0
- package/core/wfs-filter.d.ts.map +1 -0
- package/core/wfs-filter.js +586 -0
- package/core/wfs.d.ts +219 -0
- package/core/wfs.d.ts.map +1 -0
- package/core/wfs.js +406 -0
- package/core/wms-capabilities.d.ts +110 -0
- package/core/wms-capabilities.d.ts.map +1 -0
- package/core/wms-capabilities.js +566 -0
- package/core/wms-types.d.ts +128 -0
- package/core/wms-types.d.ts.map +1 -0
- package/core/wms-types.js +32 -0
- package/core/wms.d.ts +108 -0
- package/core/wms.d.ts.map +1 -0
- package/core/wms.js +182 -0
- package/core/wmts-capabilities.d.ts +82 -0
- package/core/wmts-capabilities.d.ts.map +1 -0
- package/core/wmts-capabilities.js +409 -0
- package/core/wmts.d.ts +80 -0
- package/core/wmts.d.ts.map +1 -0
- package/core/wmts.js +173 -0
- package/esri-compat/basemap-gallery.d.ts +38 -0
- package/esri-compat/basemap-gallery.d.ts.map +1 -0
- package/esri-compat/basemap-gallery.js +159 -0
- package/esri-compat/basemap-layer-list.d.ts +35 -0
- package/esri-compat/basemap-layer-list.d.ts.map +1 -0
- package/esri-compat/basemap-layer-list.js +139 -0
- package/esri-compat/basemap.d.ts +32 -0
- package/esri-compat/basemap.d.ts.map +1 -0
- package/esri-compat/basemap.js +84 -0
- package/esri-compat/bookmarks.d.ts +36 -0
- package/esri-compat/bookmarks.d.ts.map +1 -0
- package/esri-compat/bookmarks.js +108 -0
- package/esri-compat/class-breaks-renderer.d.ts +50 -0
- package/esri-compat/class-breaks-renderer.d.ts.map +1 -0
- package/esri-compat/class-breaks-renderer.js +164 -0
- package/esri-compat/color.d.ts +22 -0
- package/esri-compat/color.d.ts.map +1 -0
- package/esri-compat/color.js +106 -0
- package/esri-compat/controls.d.ts +174 -0
- package/esri-compat/controls.d.ts.map +1 -0
- package/esri-compat/controls.js +479 -0
- package/esri-compat/coordinate-conversion.d.ts +41 -0
- package/esri-compat/coordinate-conversion.d.ts.map +1 -0
- package/esri-compat/coordinate-conversion.js +125 -0
- package/esri-compat/directions.d.ts +45 -0
- package/esri-compat/directions.d.ts.map +1 -0
- package/esri-compat/directions.js +123 -0
- package/esri-compat/editor.d.ts +47 -0
- package/esri-compat/editor.d.ts.map +1 -0
- package/esri-compat/editor.js +170 -0
- package/esri-compat/esri-config.d.ts +16 -0
- package/esri-compat/esri-config.d.ts.map +1 -0
- package/esri-compat/esri-config.js +23 -0
- package/esri-compat/esri-request.d.ts +17 -0
- package/esri-compat/esri-request.d.ts.map +1 -0
- package/esri-compat/esri-request.js +66 -0
- package/esri-compat/event-bus.d.ts +106 -0
- package/esri-compat/event-bus.d.ts.map +1 -0
- package/esri-compat/event-bus.js +90 -0
- package/esri-compat/expand.d.ts +36 -0
- package/esri-compat/expand.d.ts.map +1 -0
- package/esri-compat/expand.js +97 -0
- package/esri-compat/extent.d.ts +43 -0
- package/esri-compat/extent.d.ts.map +1 -0
- package/esri-compat/extent.js +140 -0
- package/esri-compat/feature-form.d.ts +64 -0
- package/esri-compat/feature-form.d.ts.map +1 -0
- package/esri-compat/feature-form.js +137 -0
- package/esri-compat/feature-layer.d.ts +173 -0
- package/esri-compat/feature-layer.d.ts.map +1 -0
- package/esri-compat/feature-layer.js +655 -0
- package/esri-compat/feature-set.d.ts +32 -0
- package/esri-compat/feature-set.d.ts.map +1 -0
- package/esri-compat/feature-set.js +80 -0
- package/esri-compat/feature-table.d.ts +141 -0
- package/esri-compat/feature-table.d.ts.map +1 -0
- package/esri-compat/feature-table.js +500 -0
- package/esri-compat/feature-templates.d.ts +41 -0
- package/esri-compat/feature-templates.d.ts.map +1 -0
- package/esri-compat/feature-templates.js +97 -0
- package/esri-compat/feature.d.ts +33 -0
- package/esri-compat/feature.d.ts.map +1 -0
- package/esri-compat/feature.js +83 -0
- package/esri-compat/graphic.d.ts +46 -0
- package/esri-compat/graphic.d.ts.map +1 -0
- package/esri-compat/graphic.js +103 -0
- package/esri-compat/graphics-layer.d.ts +49 -0
- package/esri-compat/graphics-layer.d.ts.map +1 -0
- package/esri-compat/graphics-layer.js +185 -0
- package/esri-compat/group-layer.d.ts +48 -0
- package/esri-compat/group-layer.d.ts.map +1 -0
- package/esri-compat/group-layer.js +212 -0
- package/esri-compat/identify.d.ts +71 -0
- package/esri-compat/identify.d.ts.map +1 -0
- package/esri-compat/identify.js +299 -0
- package/esri-compat/identity-manager.d.ts +31 -0
- package/esri-compat/identity-manager.d.ts.map +1 -0
- package/esri-compat/identity-manager.js +115 -0
- package/esri-compat/label-class.d.ts +31 -0
- package/esri-compat/label-class.d.ts.map +1 -0
- package/esri-compat/label-class.js +102 -0
- package/esri-compat/layer-list.d.ts +77 -0
- package/esri-compat/layer-list.d.ts.map +1 -0
- package/esri-compat/layer-list.js +342 -0
- package/esri-compat/legend.d.ts +53 -0
- package/esri-compat/legend.d.ts.map +1 -0
- package/esri-compat/legend.js +254 -0
- package/esri-compat/map-image-layer.d.ts +162 -0
- package/esri-compat/map-image-layer.d.ts.map +1 -0
- package/esri-compat/map-image-layer.js +704 -0
- package/esri-compat/map-view.d.ts +315 -0
- package/esri-compat/map-view.d.ts.map +1 -0
- package/esri-compat/map-view.js +1110 -0
- package/esri-compat/map.d.ts +47 -0
- package/esri-compat/map.d.ts.map +1 -0
- package/esri-compat/map.js +209 -0
- package/esri-compat/measurement-2d.d.ts +61 -0
- package/esri-compat/measurement-2d.d.ts.map +1 -0
- package/esri-compat/measurement-2d.js +184 -0
- package/esri-compat/measurement.d.ts +45 -0
- package/esri-compat/measurement.d.ts.map +1 -0
- package/esri-compat/measurement.js +193 -0
- package/esri-compat/oauth-info.d.ts +35 -0
- package/esri-compat/oauth-info.d.ts.map +1 -0
- package/esri-compat/oauth-info.js +115 -0
- package/esri-compat/picture-marker-symbol.d.ts +35 -0
- package/esri-compat/picture-marker-symbol.d.ts.map +1 -0
- package/esri-compat/picture-marker-symbol.js +126 -0
- package/esri-compat/point.d.ts +31 -0
- package/esri-compat/point.d.ts.map +1 -0
- package/esri-compat/point.js +102 -0
- package/esri-compat/polygon.d.ts +31 -0
- package/esri-compat/polygon.d.ts.map +1 -0
- package/esri-compat/polygon.js +107 -0
- package/esri-compat/polyline.d.ts +31 -0
- package/esri-compat/polyline.d.ts.map +1 -0
- package/esri-compat/polyline.js +107 -0
- package/esri-compat/popup-template.d.ts +55 -0
- package/esri-compat/popup-template.d.ts.map +1 -0
- package/esri-compat/popup-template.js +128 -0
- package/esri-compat/popup.d.ts +54 -0
- package/esri-compat/popup.d.ts.map +1 -0
- package/esri-compat/popup.js +312 -0
- package/esri-compat/print.d.ts +47 -0
- package/esri-compat/print.d.ts.map +1 -0
- package/esri-compat/print.js +105 -0
- package/esri-compat/query.d.ts +46 -0
- package/esri-compat/query.d.ts.map +1 -0
- package/esri-compat/query.js +119 -0
- package/esri-compat/reactive-utils.d.ts +23 -0
- package/esri-compat/reactive-utils.d.ts.map +1 -0
- package/esri-compat/reactive-utils.js +178 -0
- package/esri-compat/request.d.ts +41 -0
- package/esri-compat/request.d.ts.map +1 -0
- package/esri-compat/request.js +253 -0
- package/esri-compat/route-layer.d.ts +59 -0
- package/esri-compat/route-layer.d.ts.map +1 -0
- package/esri-compat/route-layer.js +223 -0
- package/esri-compat/route-task.d.ts +88 -0
- package/esri-compat/route-task.d.ts.map +1 -0
- package/esri-compat/route-task.js +225 -0
- package/esri-compat/scene-view.d.ts +41 -0
- package/esri-compat/scene-view.d.ts.map +1 -0
- package/esri-compat/scene-view.js +68 -0
- package/esri-compat/search.d.ts +112 -0
- package/esri-compat/search.d.ts.map +1 -0
- package/esri-compat/search.js +820 -0
- package/esri-compat/simple-fill-symbol.d.ts +27 -0
- package/esri-compat/simple-fill-symbol.d.ts.map +1 -0
- package/esri-compat/simple-fill-symbol.js +85 -0
- package/esri-compat/simple-line-symbol.d.ts +27 -0
- package/esri-compat/simple-line-symbol.d.ts.map +1 -0
- package/esri-compat/simple-line-symbol.js +85 -0
- package/esri-compat/simple-marker-symbol.d.ts +29 -0
- package/esri-compat/simple-marker-symbol.d.ts.map +1 -0
- package/esri-compat/simple-marker-symbol.js +92 -0
- package/esri-compat/simple-renderer.d.ts +29 -0
- package/esri-compat/simple-renderer.d.ts.map +1 -0
- package/esri-compat/simple-renderer.js +92 -0
- package/esri-compat/sketch.d.ts +64 -0
- package/esri-compat/sketch.d.ts.map +1 -0
- package/esri-compat/sketch.js +227 -0
- package/esri-compat/spatial-reference.d.ts +31 -0
- package/esri-compat/spatial-reference.d.ts.map +1 -0
- package/esri-compat/spatial-reference.js +102 -0
- package/esri-compat/swipe.d.ts +34 -0
- package/esri-compat/swipe.d.ts.map +1 -0
- package/esri-compat/swipe.js +93 -0
- package/esri-compat/table-list.d.ts +36 -0
- package/esri-compat/table-list.d.ts.map +1 -0
- package/esri-compat/table-list.js +126 -0
- package/esri-compat/text-symbol.d.ts +37 -0
- package/esri-compat/text-symbol.d.ts.map +1 -0
- package/esri-compat/text-symbol.js +123 -0
- package/esri-compat/tile-layer.d.ts +52 -0
- package/esri-compat/tile-layer.d.ts.map +1 -0
- package/esri-compat/tile-layer.js +167 -0
- package/esri-compat/time-slider.d.ts +70 -0
- package/esri-compat/time-slider.d.ts.map +1 -0
- package/esri-compat/time-slider.js +208 -0
- package/esri-compat/track.d.ts +51 -0
- package/esri-compat/track.d.ts.map +1 -0
- package/esri-compat/track.js +174 -0
- package/esri-compat/unique-value-renderer.d.ts +41 -0
- package/esri-compat/unique-value-renderer.d.ts.map +1 -0
- package/esri-compat/unique-value-renderer.js +127 -0
- package/esri-compat/url.d.ts +12 -0
- package/esri-compat/url.d.ts.map +1 -0
- package/esri-compat/url.js +54 -0
- package/esri-compat/web-map.d.ts +14 -0
- package/esri-compat/web-map.d.ts.map +1 -0
- package/esri-compat/web-map.js +24 -0
- package/gen/honua/v1/feature_service_pb.d.ts +918 -0
- package/gen/honua/v1/feature_service_pb.d.ts.map +1 -0
- package/gen/honua/v1/feature_service_pb.js +375 -0
- package/index.d.ts +130 -0
- package/index.js +65 -0
- package/package.json +22 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CompatEventBus } from "./event-bus.js";
|
|
2
|
+
export interface TrackPositionCompat {
|
|
3
|
+
coords: {
|
|
4
|
+
latitude: number;
|
|
5
|
+
longitude: number;
|
|
6
|
+
accuracy?: number;
|
|
7
|
+
heading?: number | null;
|
|
8
|
+
speed?: number | null;
|
|
9
|
+
};
|
|
10
|
+
timestamp?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface TrackCompatOptions {
|
|
13
|
+
view?: unknown;
|
|
14
|
+
container?: unknown;
|
|
15
|
+
eventBus?: CompatEventBus;
|
|
16
|
+
tracking?: boolean;
|
|
17
|
+
goToLocationEnabled?: boolean;
|
|
18
|
+
useHeadingEnabled?: boolean;
|
|
19
|
+
rotationEnabled?: boolean;
|
|
20
|
+
scale?: number;
|
|
21
|
+
trackProvider?: () => Promise<TrackPositionCompat>;
|
|
22
|
+
}
|
|
23
|
+
export type TrackLoadStatusCompat = "not-loaded" | "loading" | "loaded";
|
|
24
|
+
export interface TrackHandleCompat {
|
|
25
|
+
remove(): void;
|
|
26
|
+
}
|
|
27
|
+
export declare class TrackCompat {
|
|
28
|
+
readonly view: unknown;
|
|
29
|
+
readonly container: unknown;
|
|
30
|
+
readonly eventBus: CompatEventBus;
|
|
31
|
+
loaded: boolean;
|
|
32
|
+
loadStatus: TrackLoadStatusCompat;
|
|
33
|
+
tracking: boolean;
|
|
34
|
+
readonly goToLocationEnabled: boolean;
|
|
35
|
+
readonly useHeadingEnabled: boolean;
|
|
36
|
+
readonly rotationEnabled: boolean;
|
|
37
|
+
readonly scale: number | undefined;
|
|
38
|
+
position: TrackPositionCompat | undefined;
|
|
39
|
+
private readonly watchListeners;
|
|
40
|
+
private readonly trackProvider;
|
|
41
|
+
constructor(options?: TrackCompatOptions);
|
|
42
|
+
load(): Promise<TrackCompat>;
|
|
43
|
+
when(callback?: (widget: TrackCompat) => void): Promise<TrackCompat>;
|
|
44
|
+
watch(propertyName: string, listener: (value: unknown) => void): TrackHandleCompat;
|
|
45
|
+
start(): Promise<TrackPositionCompat>;
|
|
46
|
+
stop(): void;
|
|
47
|
+
toggle(force?: boolean): Promise<boolean>;
|
|
48
|
+
destroy(): void;
|
|
49
|
+
private notifyWatchers;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=track.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/track.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAmD,MAAM,gBAAgB,CAAC;AAEjG,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACvB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACpD;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,qBAAa,WAAW;IACtB,SAAgB,IAAI,EAAE,OAAO,CAAC;IAC9B,SAAgB,SAAS,EAAE,OAAO,CAAC;IACnC,SAAgB,QAAQ,EAAE,cAAc,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,qBAAqB,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IACzB,SAAgB,mBAAmB,EAAE,OAAO,CAAC;IAC7C,SAAgB,iBAAiB,EAAE,OAAO,CAAC;IAC3C,SAAgB,eAAe,EAAE,OAAO,CAAC;IACzC,SAAgB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACjD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6C;IAE5E,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqC;gBAEhD,OAAO,GAAE,kBAAuB;IAgBtC,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC;IAgB5B,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC;IAQ1E,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,iBAAiB;IAe5E,KAAK,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAoD3C,IAAI,IAAI,IAAI;IASN,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAW/C,OAAO,IAAI,IAAI;IAItB,OAAO,CAAC,cAAc;CAUvB"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { CompatEventBus, resolveCompatEventBus, safeInvokeCompatListener } from "./event-bus.js";
|
|
2
|
+
export class TrackCompat {
|
|
3
|
+
view;
|
|
4
|
+
container;
|
|
5
|
+
eventBus;
|
|
6
|
+
loaded;
|
|
7
|
+
loadStatus;
|
|
8
|
+
tracking;
|
|
9
|
+
goToLocationEnabled;
|
|
10
|
+
useHeadingEnabled;
|
|
11
|
+
rotationEnabled;
|
|
12
|
+
scale;
|
|
13
|
+
position;
|
|
14
|
+
watchListeners;
|
|
15
|
+
trackProvider;
|
|
16
|
+
constructor(options = {}) {
|
|
17
|
+
this.view = options.view;
|
|
18
|
+
this.container = options.container;
|
|
19
|
+
this.eventBus = options.eventBus ?? resolveCompatEventBus(options.view) ?? new CompatEventBus();
|
|
20
|
+
this.loaded = false;
|
|
21
|
+
this.loadStatus = "not-loaded";
|
|
22
|
+
this.tracking = options.tracking ?? false;
|
|
23
|
+
this.goToLocationEnabled = options.goToLocationEnabled ?? true;
|
|
24
|
+
this.useHeadingEnabled = options.useHeadingEnabled ?? false;
|
|
25
|
+
this.rotationEnabled = options.rotationEnabled ?? false;
|
|
26
|
+
this.scale = options.scale;
|
|
27
|
+
this.position = undefined;
|
|
28
|
+
this.trackProvider = options.trackProvider ?? getDefaultTrackProvider();
|
|
29
|
+
this.watchListeners = new Map();
|
|
30
|
+
}
|
|
31
|
+
async load() {
|
|
32
|
+
if (this.loaded) {
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
this.loadStatus = "loading";
|
|
36
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
37
|
+
this.eventBus.emit("track.loading", undefined, this);
|
|
38
|
+
this.loaded = true;
|
|
39
|
+
this.notifyWatchers("loaded", this.loaded);
|
|
40
|
+
this.loadStatus = "loaded";
|
|
41
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
42
|
+
this.eventBus.emit("track.loaded", undefined, this);
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
async when(callback) {
|
|
46
|
+
const widget = await this.load();
|
|
47
|
+
if (callback) {
|
|
48
|
+
callback(widget);
|
|
49
|
+
}
|
|
50
|
+
return widget;
|
|
51
|
+
}
|
|
52
|
+
watch(propertyName, listener) {
|
|
53
|
+
let listeners = this.watchListeners.get(propertyName);
|
|
54
|
+
if (!listeners) {
|
|
55
|
+
listeners = new Set();
|
|
56
|
+
this.watchListeners.set(propertyName, listeners);
|
|
57
|
+
}
|
|
58
|
+
listeners.add(listener);
|
|
59
|
+
return {
|
|
60
|
+
remove: () => {
|
|
61
|
+
listeners?.delete(listener);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
async start() {
|
|
66
|
+
this.tracking = true;
|
|
67
|
+
this.notifyWatchers("tracking", this.tracking);
|
|
68
|
+
this.eventBus.emit("track.start", undefined, this);
|
|
69
|
+
try {
|
|
70
|
+
const position = await this.trackProvider();
|
|
71
|
+
this.position = position;
|
|
72
|
+
this.notifyWatchers("position", this.position);
|
|
73
|
+
const center = [position.coords.longitude, position.coords.latitude];
|
|
74
|
+
if (this.goToLocationEnabled) {
|
|
75
|
+
const target = { center };
|
|
76
|
+
if (typeof this.scale === "number" && Number.isFinite(this.scale)) {
|
|
77
|
+
target.scale = this.scale;
|
|
78
|
+
}
|
|
79
|
+
if (isGoToProvider(this.view)) {
|
|
80
|
+
await this.view.goTo(target);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
applyViewCenterScale(this.view, target);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (this.rotationEnabled &&
|
|
87
|
+
this.useHeadingEnabled &&
|
|
88
|
+
typeof position.coords.heading === "number" &&
|
|
89
|
+
Number.isFinite(position.coords.heading) &&
|
|
90
|
+
isRecord(this.view)) {
|
|
91
|
+
this.view.rotation = position.coords.heading;
|
|
92
|
+
}
|
|
93
|
+
this.eventBus.emit("track.position", {
|
|
94
|
+
position,
|
|
95
|
+
center,
|
|
96
|
+
tracking: this.tracking,
|
|
97
|
+
}, this);
|
|
98
|
+
return position;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
this.tracking = false;
|
|
102
|
+
this.notifyWatchers("tracking", this.tracking);
|
|
103
|
+
this.eventBus.emit("track.error", { error }, this);
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
stop() {
|
|
108
|
+
if (!this.tracking) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
this.tracking = false;
|
|
112
|
+
this.notifyWatchers("tracking", this.tracking);
|
|
113
|
+
this.eventBus.emit("track.stop", undefined, this);
|
|
114
|
+
}
|
|
115
|
+
async toggle(force) {
|
|
116
|
+
const next = force ?? !this.tracking;
|
|
117
|
+
if (!next) {
|
|
118
|
+
this.stop();
|
|
119
|
+
return this.tracking;
|
|
120
|
+
}
|
|
121
|
+
await this.start();
|
|
122
|
+
return this.tracking;
|
|
123
|
+
}
|
|
124
|
+
destroy() {
|
|
125
|
+
this.watchListeners.clear();
|
|
126
|
+
}
|
|
127
|
+
notifyWatchers(propertyName, value) {
|
|
128
|
+
const listeners = this.watchListeners.get(propertyName);
|
|
129
|
+
if (!listeners) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
for (const listener of listeners) {
|
|
133
|
+
safeInvokeCompatListener(listener, value);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function isGoToProvider(value) {
|
|
138
|
+
return isRecord(value) && typeof value.goTo === "function";
|
|
139
|
+
}
|
|
140
|
+
function applyViewCenterScale(view, target) {
|
|
141
|
+
if (!isRecord(view)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
view.center = target.center;
|
|
145
|
+
if (typeof target.scale === "number") {
|
|
146
|
+
view.scale = target.scale;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function getDefaultTrackProvider() {
|
|
150
|
+
return () => new Promise((resolve, reject) => {
|
|
151
|
+
const geolocation = globalThis.navigator?.geolocation;
|
|
152
|
+
if (!geolocation || typeof geolocation.getCurrentPosition !== "function") {
|
|
153
|
+
reject(new Error("Geolocation API is unavailable; provide trackProvider."));
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
geolocation.getCurrentPosition((position) => {
|
|
157
|
+
resolve({
|
|
158
|
+
coords: {
|
|
159
|
+
latitude: position.coords.latitude,
|
|
160
|
+
longitude: position.coords.longitude,
|
|
161
|
+
accuracy: position.coords.accuracy,
|
|
162
|
+
heading: position.coords.heading,
|
|
163
|
+
speed: position.coords.speed,
|
|
164
|
+
},
|
|
165
|
+
timestamp: position.timestamp,
|
|
166
|
+
});
|
|
167
|
+
}, (error) => {
|
|
168
|
+
reject(error);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
function isRecord(value) {
|
|
173
|
+
return typeof value === "object" && value !== null;
|
|
174
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface UniqueValueInfoCompat {
|
|
2
|
+
value: string | number;
|
|
3
|
+
symbol?: unknown;
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface UniqueValueRendererCompatOptions {
|
|
8
|
+
field?: string;
|
|
9
|
+
field2?: string;
|
|
10
|
+
field3?: string;
|
|
11
|
+
defaultSymbol?: unknown;
|
|
12
|
+
defaultLabel?: string;
|
|
13
|
+
uniqueValueInfos?: UniqueValueInfoCompat[];
|
|
14
|
+
}
|
|
15
|
+
export type UniqueValueRendererLoadStatusCompat = "not-loaded" | "loading" | "loaded";
|
|
16
|
+
export interface UniqueValueRendererHandleCompat {
|
|
17
|
+
remove(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class UniqueValueRendererCompat {
|
|
20
|
+
loaded: boolean;
|
|
21
|
+
loadStatus: UniqueValueRendererLoadStatusCompat;
|
|
22
|
+
field: string | undefined;
|
|
23
|
+
field2: string | undefined;
|
|
24
|
+
field3: string | undefined;
|
|
25
|
+
defaultSymbol: unknown;
|
|
26
|
+
defaultLabel: string | undefined;
|
|
27
|
+
uniqueValueInfos: UniqueValueInfoCompat[];
|
|
28
|
+
private readonly watchListeners;
|
|
29
|
+
constructor(options?: UniqueValueRendererCompatOptions);
|
|
30
|
+
load(): Promise<UniqueValueRendererCompat>;
|
|
31
|
+
when(callback?: (renderer: UniqueValueRendererCompat) => void): Promise<UniqueValueRendererCompat>;
|
|
32
|
+
watch(propertyName: string, listener: (value: unknown) => void): UniqueValueRendererHandleCompat;
|
|
33
|
+
update(options: UniqueValueRendererCompatOptions): void;
|
|
34
|
+
addUniqueValueInfo(info: UniqueValueInfoCompat): void;
|
|
35
|
+
removeUniqueValueInfo(value: string | number): boolean;
|
|
36
|
+
clone(): UniqueValueRendererCompat;
|
|
37
|
+
toJSON(): UniqueValueRendererCompatOptions;
|
|
38
|
+
destroy(): void;
|
|
39
|
+
private notifyWatchers;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=unique-value-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unique-value-renderer.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/unique-value-renderer.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gCAAgC;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAC5C;AAED,MAAM,MAAM,mCAAmC,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEtF,MAAM,WAAW,+BAA+B;IAC9C,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,qBAAa,yBAAyB;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,mCAAmC,CAAC;IAChD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,gBAAgB,EAAE,qBAAqB,EAAE,CAAC;IACjD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6C;gBAEzD,OAAO,GAAE,gCAAqC;IAYpD,IAAI,IAAI,OAAO,CAAC,yBAAyB,CAAC;IAc1C,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,yBAAyB,KAAK,IAAI,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAQxG,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,+BAA+B;IAehG,MAAM,CAAC,OAAO,EAAE,gCAAgC,GAAG,IAAI;IA2BvD,kBAAkB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAKrD,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO;IAUtD,KAAK,IAAI,yBAAyB;IAIlC,MAAM,IAAI,gCAAgC;IAW1C,OAAO,IAAI,IAAI;IAItB,OAAO,CAAC,cAAc;CAUvB"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { safeInvokeCompatListener } from "./event-bus.js";
|
|
2
|
+
export class UniqueValueRendererCompat {
|
|
3
|
+
loaded;
|
|
4
|
+
loadStatus;
|
|
5
|
+
field;
|
|
6
|
+
field2;
|
|
7
|
+
field3;
|
|
8
|
+
defaultSymbol;
|
|
9
|
+
defaultLabel;
|
|
10
|
+
uniqueValueInfos;
|
|
11
|
+
watchListeners;
|
|
12
|
+
constructor(options = {}) {
|
|
13
|
+
this.loaded = false;
|
|
14
|
+
this.loadStatus = "not-loaded";
|
|
15
|
+
this.field = options.field;
|
|
16
|
+
this.field2 = options.field2;
|
|
17
|
+
this.field3 = options.field3;
|
|
18
|
+
this.defaultSymbol = options.defaultSymbol;
|
|
19
|
+
this.defaultLabel = options.defaultLabel;
|
|
20
|
+
this.uniqueValueInfos = options.uniqueValueInfos ? options.uniqueValueInfos.map(cloneUniqueValueInfo) : [];
|
|
21
|
+
this.watchListeners = new Map();
|
|
22
|
+
}
|
|
23
|
+
async load() {
|
|
24
|
+
if (this.loaded) {
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
this.loadStatus = "loading";
|
|
28
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
29
|
+
this.loaded = true;
|
|
30
|
+
this.notifyWatchers("loaded", this.loaded);
|
|
31
|
+
this.loadStatus = "loaded";
|
|
32
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
async when(callback) {
|
|
36
|
+
const renderer = await this.load();
|
|
37
|
+
if (callback) {
|
|
38
|
+
callback(renderer);
|
|
39
|
+
}
|
|
40
|
+
return renderer;
|
|
41
|
+
}
|
|
42
|
+
watch(propertyName, listener) {
|
|
43
|
+
let listeners = this.watchListeners.get(propertyName);
|
|
44
|
+
if (!listeners) {
|
|
45
|
+
listeners = new Set();
|
|
46
|
+
this.watchListeners.set(propertyName, listeners);
|
|
47
|
+
}
|
|
48
|
+
listeners.add(listener);
|
|
49
|
+
return {
|
|
50
|
+
remove: () => {
|
|
51
|
+
listeners?.delete(listener);
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
update(options) {
|
|
56
|
+
if (options.field !== undefined) {
|
|
57
|
+
this.field = options.field;
|
|
58
|
+
this.notifyWatchers("field", this.field);
|
|
59
|
+
}
|
|
60
|
+
if (options.field2 !== undefined) {
|
|
61
|
+
this.field2 = options.field2;
|
|
62
|
+
this.notifyWatchers("field2", this.field2);
|
|
63
|
+
}
|
|
64
|
+
if (options.field3 !== undefined) {
|
|
65
|
+
this.field3 = options.field3;
|
|
66
|
+
this.notifyWatchers("field3", this.field3);
|
|
67
|
+
}
|
|
68
|
+
if (options.defaultSymbol !== undefined) {
|
|
69
|
+
this.defaultSymbol = options.defaultSymbol;
|
|
70
|
+
this.notifyWatchers("defaultSymbol", this.defaultSymbol);
|
|
71
|
+
}
|
|
72
|
+
if (options.defaultLabel !== undefined) {
|
|
73
|
+
this.defaultLabel = options.defaultLabel;
|
|
74
|
+
this.notifyWatchers("defaultLabel", this.defaultLabel);
|
|
75
|
+
}
|
|
76
|
+
if (options.uniqueValueInfos !== undefined) {
|
|
77
|
+
this.uniqueValueInfos = options.uniqueValueInfos.map(cloneUniqueValueInfo);
|
|
78
|
+
this.notifyWatchers("uniqueValueInfos", this.uniqueValueInfos);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
addUniqueValueInfo(info) {
|
|
82
|
+
this.uniqueValueInfos.push(cloneUniqueValueInfo(info));
|
|
83
|
+
this.notifyWatchers("uniqueValueInfos", this.uniqueValueInfos);
|
|
84
|
+
}
|
|
85
|
+
removeUniqueValueInfo(value) {
|
|
86
|
+
const index = this.uniqueValueInfos.findIndex((item) => item.value === value);
|
|
87
|
+
if (index < 0) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
this.uniqueValueInfos.splice(index, 1);
|
|
91
|
+
this.notifyWatchers("uniqueValueInfos", this.uniqueValueInfos);
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
clone() {
|
|
95
|
+
return new UniqueValueRendererCompat(this.toJSON());
|
|
96
|
+
}
|
|
97
|
+
toJSON() {
|
|
98
|
+
return {
|
|
99
|
+
field: this.field,
|
|
100
|
+
field2: this.field2,
|
|
101
|
+
field3: this.field3,
|
|
102
|
+
defaultSymbol: this.defaultSymbol,
|
|
103
|
+
defaultLabel: this.defaultLabel,
|
|
104
|
+
uniqueValueInfos: this.uniqueValueInfos.map(cloneUniqueValueInfo),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
destroy() {
|
|
108
|
+
this.watchListeners.clear();
|
|
109
|
+
}
|
|
110
|
+
notifyWatchers(propertyName, value) {
|
|
111
|
+
const listeners = this.watchListeners.get(propertyName);
|
|
112
|
+
if (!listeners) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
for (const listener of listeners) {
|
|
116
|
+
safeInvokeCompatListener(listener, value);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function cloneUniqueValueInfo(info) {
|
|
121
|
+
return {
|
|
122
|
+
value: info.value,
|
|
123
|
+
symbol: info.symbol,
|
|
124
|
+
label: info.label,
|
|
125
|
+
description: info.description,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ParsedFeatureLayerUrl {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
serviceId: string;
|
|
4
|
+
layerId: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ParsedMapServiceUrl {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
serviceId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function parseFeatureLayerUrl(url: string): ParsedFeatureLayerUrl;
|
|
11
|
+
export declare function parseMapServiceUrl(url: string): ParsedMapServiceUrl;
|
|
12
|
+
//# sourceMappingURL=url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/url.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAQD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAkBvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAanE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const ABSOLUTE_URL_RE = /^[A-Za-z][A-Za-z\d+.-]*:\/\//;
|
|
2
|
+
const PROTOCOL_RELATIVE_URL_RE = /^\/\//;
|
|
3
|
+
const RELATIVE_URL_BASE = "https://honua.invalid";
|
|
4
|
+
const FEATURE_LAYER_PATH_RE = /^(?<prefix>.*)\/rest\/services\/(?<serviceId>[^/]+)\/FeatureServer\/(?<layerId>\d+)\/?$/;
|
|
5
|
+
const MAP_SERVICE_PATH_RE = /^(?<prefix>.*)\/rest\/services\/(?<serviceId>[^/]+)\/MapServer(?:\/\d+)?\/?$/;
|
|
6
|
+
export function parseFeatureLayerUrl(url) {
|
|
7
|
+
const { parsed, absolute } = parseServiceUrl(url);
|
|
8
|
+
const match = parsed.pathname.match(FEATURE_LAYER_PATH_RE);
|
|
9
|
+
if (!match || !match.groups) {
|
|
10
|
+
throw new Error("Invalid FeatureLayer URL. Expected .../rest/services/{serviceId}/FeatureServer/{layerId}");
|
|
11
|
+
}
|
|
12
|
+
const serviceId = decodeURIComponent(match.groups.serviceId);
|
|
13
|
+
const layerId = Number.parseInt(match.groups.layerId, 10);
|
|
14
|
+
if (Number.isNaN(layerId)) {
|
|
15
|
+
throw new Error("FeatureLayer URL contains an invalid numeric layerId.");
|
|
16
|
+
}
|
|
17
|
+
const prefix = match.groups.prefix || "";
|
|
18
|
+
const baseUrl = absolute
|
|
19
|
+
? `${parsed.protocol}//${parsed.host}${prefix}`.replace(/\/+$/, "")
|
|
20
|
+
: prefix.replace(/\/+$/, "");
|
|
21
|
+
return { baseUrl, serviceId, layerId };
|
|
22
|
+
}
|
|
23
|
+
export function parseMapServiceUrl(url) {
|
|
24
|
+
const { parsed, absolute } = parseServiceUrl(url);
|
|
25
|
+
const match = parsed.pathname.match(MAP_SERVICE_PATH_RE);
|
|
26
|
+
if (!match || !match.groups) {
|
|
27
|
+
throw new Error("Invalid MapServer URL. Expected .../rest/services/{serviceId}/MapServer");
|
|
28
|
+
}
|
|
29
|
+
const serviceId = decodeURIComponent(match.groups.serviceId);
|
|
30
|
+
const prefix = match.groups.prefix || "";
|
|
31
|
+
const baseUrl = absolute
|
|
32
|
+
? `${parsed.protocol}//${parsed.host}${prefix}`.replace(/\/+$/, "")
|
|
33
|
+
: prefix.replace(/\/+$/, "");
|
|
34
|
+
return { baseUrl, serviceId };
|
|
35
|
+
}
|
|
36
|
+
function parseServiceUrl(url) {
|
|
37
|
+
if (ABSOLUTE_URL_RE.test(url)) {
|
|
38
|
+
return {
|
|
39
|
+
parsed: new URL(url),
|
|
40
|
+
absolute: true,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (PROTOCOL_RELATIVE_URL_RE.test(url)) {
|
|
44
|
+
return {
|
|
45
|
+
parsed: new URL(`https:${url}`),
|
|
46
|
+
absolute: true,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const normalized = url.startsWith("/") ? url : `/${url}`;
|
|
50
|
+
return {
|
|
51
|
+
parsed: new URL(normalized, RELATIVE_URL_BASE),
|
|
52
|
+
absolute: false,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MapCompat, type MapCompatHandle, type MapCompatOptions, type MapLoadStatusCompat } from "./map.js";
|
|
2
|
+
export interface WebMapCompatOptions extends MapCompatOptions {
|
|
3
|
+
portalItem?: unknown;
|
|
4
|
+
}
|
|
5
|
+
export type WebMapLoadStatusCompat = MapLoadStatusCompat;
|
|
6
|
+
export type WebMapHandleCompat = MapCompatHandle;
|
|
7
|
+
export declare class WebMapCompat extends MapCompat {
|
|
8
|
+
constructor(options?: WebMapCompatOptions);
|
|
9
|
+
load(): Promise<WebMapCompat>;
|
|
10
|
+
when(callback?: (map: WebMapCompat) => void): Promise<WebMapCompat>;
|
|
11
|
+
watch(propertyName: string, listener: (value: unknown) => void): WebMapHandleCompat;
|
|
12
|
+
setPortalItem(portalItem: unknown): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=web-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-map.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/web-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE5G,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACzD,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAEjD,qBAAa,YAAa,SAAQ,SAAS;gBACtB,OAAO,GAAE,mBAAwB;IAIvC,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC;IAK7B,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC;IAQzE,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,kBAAkB;IAInF,aAAa,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI;CAIhD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MapCompat } from "./map.js";
|
|
2
|
+
export class WebMapCompat extends MapCompat {
|
|
3
|
+
constructor(options = {}) {
|
|
4
|
+
super(options);
|
|
5
|
+
}
|
|
6
|
+
async load() {
|
|
7
|
+
await super.load();
|
|
8
|
+
return this;
|
|
9
|
+
}
|
|
10
|
+
async when(callback) {
|
|
11
|
+
const map = await this.load();
|
|
12
|
+
if (callback) {
|
|
13
|
+
callback(map);
|
|
14
|
+
}
|
|
15
|
+
return map;
|
|
16
|
+
}
|
|
17
|
+
watch(propertyName, listener) {
|
|
18
|
+
return super.watch(propertyName, listener);
|
|
19
|
+
}
|
|
20
|
+
setPortalItem(portalItem) {
|
|
21
|
+
super.setPortalItem(portalItem);
|
|
22
|
+
this.eventBus.emit("web-map.portal-item-changed", { portalItem }, this);
|
|
23
|
+
}
|
|
24
|
+
}
|