@arcgis/core 6.0.0-next.22 → 6.0.0-next.23
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/PopupTemplate.js +1 -1
- package/analysis/LineOfSightAnalysis.d.ts +1 -1
- package/analysis/LineOfSightAnalysisObserver.d.ts +5 -4
- package/analysis/LineOfSightAnalysisTarget.d.ts +4 -4
- package/analysis/Viewshed.d.ts +4 -4
- package/arcgisGlobal.d.ts +0 -5
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{3c277a0f099d67090d07.js → 02335385b1476fe322eb.js} +1 -1
- package/assets/esri/core/workers/chunks/{4911ce62421a6c3320b0.js → 13c64087be3b2985a21b.js} +1 -1
- package/assets/esri/core/workers/chunks/{8e19629899a5becf8e19.js → 150e7a7bd5df25693da7.js} +1 -1
- package/assets/esri/core/workers/chunks/2c0cb214fedb29487eef.js +1 -0
- package/assets/esri/core/workers/chunks/{2e096537a3a5555a4a93.js → 4cb751dc8d00bdaeb04c.js} +1 -1
- package/assets/esri/core/workers/chunks/517106048980a3cbe072.js +1 -0
- package/assets/esri/core/workers/chunks/{d08ff41e2a9bcd58b64a.js → 636cd05abfbdff19029e.js} +1 -1
- package/assets/esri/core/workers/chunks/{84940d8e14caf5a27e04.js → 64b360625c68cb863a08.js} +1 -1
- package/assets/esri/core/workers/chunks/{814751e705c05099f864.js → 7c75a8ee266c36baa902.js} +1 -1
- package/assets/esri/core/workers/chunks/947674b2ca8be65b9bcc.js +1 -0
- package/assets/esri/core/workers/chunks/{baed828b7846c0863289.js → 96c4ea9cfa3930f1c3fb.js} +21 -17
- package/assets/esri/core/workers/chunks/{8a485130781b49dbf608.js → 9d40786c5ceface786ba.js} +1 -1
- package/assets/esri/core/workers/chunks/{a35c69a4751d28c39907.js → 9e7c4eda135c4911b268.js} +1 -1
- package/assets/esri/core/workers/chunks/ad96132bc89671e595f3.js +1 -0
- package/assets/esri/themes/base/_core.scss +0 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Component.glsl.js +9 -12
- package/chunks/DefaultMaterial.glsl.js +4 -5
- package/chunks/Path.glsl.js +2 -4
- package/chunks/RealisticTree.glsl.js +3 -3
- package/chunks/SSAO.glsl.js +1 -2
- package/config.js +1 -1
- package/geometry/support/clipRay.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +0 -55
- package/kernel.js +1 -1
- package/layers/ElevationLayer.d.ts +6 -2
- package/layers/GeoJSONLayer.d.ts +2 -107
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/SceneLayer.d.ts +40 -16
- package/layers/ViewshedLayer.d.ts +10 -4
- package/layers/WMSLayer.d.ts +2 -69
- package/layers/mixins/TemporalLayer.d.ts +70 -48
- package/layers/mixins/TiledImagery.d.ts +0 -11
- package/package.json +2 -2
- package/popup/content.d.ts +38 -1
- package/popup/content.js +1 -1
- package/smartMapping/popup/support/clusterUtils.js +1 -1
- package/smartMapping/popup/support/utils.js +2 -2
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/regenerateUtils.js +1 -1
- package/support/timeUtils.d.ts +11 -0
- package/views/2d/engine/webgl/GlyphWorker.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/processor/AggregateStrategy.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/processor/bins/BinAdapter.js +1 -1
- package/views/2d/layers/features/processor/bins/BinLevelState.js +1 -1
- package/views/2d/layers/features/processor/clusters/ClusterAdapter.js +1 -1
- package/views/2d/layers/features/processor/clusters/ClusterLevelState.js +1 -1
- package/views/2d/layers/features/processor/tracks/TrackAdapter.js +1 -1
- package/views/2d/layers/features/processor/tracks/TrackLevelState.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ByReferenceTileSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ParquetSnapshotSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/StreamSourceChunk.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureFilterEvaluator.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/GraphicsReader.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +0 -1
- package/views/3d/environment/SunLighting.js +1 -1
- package/views/3d/environment/VirtualLighting.d.ts +0 -1
- package/views/3d/environment/VirtualLighting.js +1 -1
- package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +1 -1
- package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +1 -2
- package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +9 -4
- package/views/3d/webgl-engine/effects/snowcover/applySnow.glsl.js +18 -0
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/worldSizedRibbonLineIntersectionUtils.js +2 -0
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +2 -2
- package/views/layers/ViewshedLayerView.d.ts +2 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/Locate.d.ts +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/support/GeolocationPositioning.d.ts +1 -2
- package/assets/esri/core/workers/chunks/42045cf46497828cd3c0.js +0 -1
- package/assets/esri/core/workers/chunks/576248e9ae2654569420.js +0 -1
- package/assets/esri/core/workers/chunks/6059853ef3b6cddbe869.js +0 -1
- package/assets/esri/core/workers/chunks/a679207c3458cc0b1fec.js +0 -1
- package/assets/esri/themes/base/widgets/_DirectionalPad.scss +0 -85
- package/assets/esri/widgets/DirectionalPad/t9n/messages.ar.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.bg.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.bs.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.ca.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.cs.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.da.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.de.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.el.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.en.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.es.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.et.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.fi.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.fr.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.he.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.hr.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.hu.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.id.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.it.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.ja.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.ko.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.lt.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.lv.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.nl.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.no.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.pl.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.pt-BR.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.pt-PT.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.ro.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.ru.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.sk.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.sl.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.sr.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.sv.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.th.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.tr.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.uk.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.vi.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.zh-CN.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.zh-HK.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.zh-TW.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.ar.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.bg.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.bs.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.ca.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.cs.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.da.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.de.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.el.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.en.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.es.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.et.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.fi.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.fr.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.he.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.hr.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.hu.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.id.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.it.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.ja.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.ko.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.lt.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.lv.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.nl.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.no.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.pl.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.pt-BR.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.pt-PT.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.ro.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.ru.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.sk.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.sl.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.sr.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.sv.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.th.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.tr.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.uk.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.vi.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.zh-CN.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.zh-HK.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.zh-TW.json +0 -1
- package/views/2d/layers/features/FeatureSpatialIndex.js +0 -2
- package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +0 -2
- package/views/3d/webgl-engine/effects/snowcover/SnowCover.glsl.js +0 -12
- package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +0 -85
- package/widgets/DirectionalPad/DirectionalPadViewModel.js +0 -2
- package/widgets/DirectionalPad/VisibleElements.d.ts +0 -40
- package/widgets/DirectionalPad/VisibleElements.js +0 -2
- package/widgets/DirectionalPad/constants.js +0 -2
- package/widgets/DirectionalPad/css.js +0 -2
- package/widgets/DirectionalPad/types.d.ts +0 -27
- package/widgets/DirectionalPad/utils.js +0 -2
- package/widgets/DirectionalPad.d.ts +0 -156
- package/widgets/DirectionalPad.js +0 -2
- package/widgets/Track/TrackViewModel.d.ts +0 -131
- package/widgets/Track/TrackViewModel.js +0 -2
- package/widgets/Track/types.d.ts +0 -6
- package/widgets/Track.d.ts +0 -278
- package/widgets/Track.js +0 -2
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import type GeolocationPositioning from "../support/GeolocationPositioning.js";
|
|
2
|
-
import type { PositionFilterFunction } from "./types.js";
|
|
3
|
-
import type { GeolocationPositioningProperties } from "../support/GeolocationPositioning.js";
|
|
4
|
-
|
|
5
|
-
/** @deprecated since 5.2. Use the [Track component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/) instead. */
|
|
6
|
-
export interface TrackViewModelProperties extends GeolocationPositioningProperties, Partial<Pick<TrackViewModel, "error" | "positionFilterFunction" | "rotationEnabled">> {}
|
|
7
|
-
|
|
8
|
-
/** @deprecated since 5.2. Use the [TrackViewModelState type](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/types/#TrackViewModelState) from the Track component instead. */
|
|
9
|
-
export type TrackViewModelState = "error" | "disabled" | "ready" | "waiting" | "tracking" | "feature-unsupported";
|
|
10
|
-
|
|
11
|
-
/** @deprecated since version 5.1. Use the [Track component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/). */
|
|
12
|
-
export interface TrackViewModelEvents {
|
|
13
|
-
/**
|
|
14
|
-
* Fires after the [Track.start()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/#start) method is called and a position is found.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* track.on("track", ({ position }) => {
|
|
18
|
-
* const { longitude, latitude } = position.coords;
|
|
19
|
-
* console.log("Track", `${longitude.toFixed(4)}, ${latitude.toFixed(4)}`);
|
|
20
|
-
* });
|
|
21
|
-
*/
|
|
22
|
-
track: TrackViewModelTrackEvent;
|
|
23
|
-
/** Fires after the [Track.start()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/#start) method is called and an error is returned. */
|
|
24
|
-
"track-error": TrackViewModelTrackErrorEvent;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** @deprecated since 5.2. Use the Track component's [`arcgisComplete` event](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/#event-arcgisComplete) instead. */
|
|
28
|
-
export interface TrackViewModelTrackEvent {
|
|
29
|
-
/** Geolocation coordinates returned from the [Geolocation API](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/#geolocationOptions). */
|
|
30
|
-
position: GeolocationPosition;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** @deprecated since 5.2. Use the Track component's [`arcgisError` event](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/#event-arcgisError) instead. */
|
|
34
|
-
export interface TrackViewModelTrackErrorEvent {
|
|
35
|
-
/** The Error object returned if an error occurred while tracking. */
|
|
36
|
-
error: GeolocationPositionError | Error;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Provides the logic for the [Track](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/) component and [Track](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/) widget, which
|
|
41
|
-
* animates the [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/)
|
|
42
|
-
* to the user's location when clicked and tracks it as the location is updated.
|
|
43
|
-
*
|
|
44
|
-
* > [!WARNING]
|
|
45
|
-
* >
|
|
46
|
-
* > The Track widget is only available in [secure contexts](https://developer.mozilla.org/docs/Web/Security/Secure_Contexts), such as HTTPS.
|
|
47
|
-
* > Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that support
|
|
48
|
-
* > [Window.isSecureContext](https://developer.mozilla.org/docs/Web/API/isSecureContext#browser_compatibility).
|
|
49
|
-
* >
|
|
50
|
-
* > For additional information regarding this, visit the ArcGIS blog,
|
|
51
|
-
* > [Increased web API security in Google Chrome](https://blogs.esri.com/esri/arcgis/2016/04/14/increased-web-api-security-in-google-chrome/).
|
|
52
|
-
*
|
|
53
|
-
* @deprecated since version 5.1. Use the [Track component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
|
|
54
|
-
* @since 4.0
|
|
55
|
-
* @see [Track](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/) component
|
|
56
|
-
* @see [Track](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/) widget - _Deprecated since 4.32. Use the [Track component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/) instead._
|
|
57
|
-
* @see [Programming patterns: Widget viewModel pattern](https://developers.arcgis.com/javascript/latest/programming-patterns/#widget-viewmodel-pattern)
|
|
58
|
-
* @example
|
|
59
|
-
* let trackWidget = new Track({
|
|
60
|
-
* viewModel: { // autocasts as new TrackViewModel()
|
|
61
|
-
* view: view, // attaches the Track to the view
|
|
62
|
-
* }
|
|
63
|
-
* };
|
|
64
|
-
*/
|
|
65
|
-
export default class TrackViewModel extends GeolocationPositioning {
|
|
66
|
-
/**
|
|
67
|
-
* @deprecated
|
|
68
|
-
* Do not directly reference this property.
|
|
69
|
-
* Use EventNames and EventTypes helpers from \@arcgis/core/Evented
|
|
70
|
-
*/
|
|
71
|
-
"@eventTypes": TrackViewModelEvents;
|
|
72
|
-
constructor(properties?: TrackViewModelProperties);
|
|
73
|
-
/**
|
|
74
|
-
* Error that caused the last [track-error](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/TrackViewModel/#event:track-error) event to fire.
|
|
75
|
-
*
|
|
76
|
-
* @since 4.29
|
|
77
|
-
* @example
|
|
78
|
-
* if(track.viewModel.state === 'error')
|
|
79
|
-
* console.error(track.viewModel.error);
|
|
80
|
-
*/
|
|
81
|
-
accessor error: GeolocationPositionError | Error | null | undefined;
|
|
82
|
-
/**
|
|
83
|
-
* A function that is used as an expression to evaluate geolocation points, and returns a boolean
|
|
84
|
-
* value. If the function returns `true`, the widget will draw a graphic and navigate to the position.
|
|
85
|
-
* The widget will ignore `false` values and not draw a graphic and not navigate to the position.
|
|
86
|
-
*
|
|
87
|
-
* Example use cases include smoothing out geolocation anomalies and geofencing.
|
|
88
|
-
*
|
|
89
|
-
* @since 4.27
|
|
90
|
-
* @example
|
|
91
|
-
* // Exclude locations that full outside an extent.
|
|
92
|
-
* track.viewModel.positionFilterFunction = (value) => {
|
|
93
|
-
* const { longitude, latitude } = value.position.coords;
|
|
94
|
-
* const myLocation = new Point({ longitude, latitude });
|
|
95
|
-
* const geofenceExtent = new Extent({
|
|
96
|
-
* // whatever
|
|
97
|
-
* });
|
|
98
|
-
* return withinExecute(myLocation, geofenceExtent);
|
|
99
|
-
* };
|
|
100
|
-
*/
|
|
101
|
-
accessor positionFilterFunction: PositionFilterFunction | null | undefined;
|
|
102
|
-
/**
|
|
103
|
-
* Indicates whether the component will automatically rotate to the device heading based on
|
|
104
|
-
* the Geolocation APIs [`GeolocationCoordinates.heading`](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/heading)
|
|
105
|
-
* property. The map will not rotate if the speed is `0`,
|
|
106
|
-
* or if the device is unable to provide heading information.
|
|
107
|
-
*
|
|
108
|
-
* @default true
|
|
109
|
-
* @since 4.33
|
|
110
|
-
*/
|
|
111
|
-
rotationEnabled: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* The current state of the widget.
|
|
114
|
-
*
|
|
115
|
-
* @default "disabled"
|
|
116
|
-
*/
|
|
117
|
-
get state(): TrackViewModelState;
|
|
118
|
-
/**
|
|
119
|
-
* Indicates whether new positions are being watched.
|
|
120
|
-
*
|
|
121
|
-
* @default false
|
|
122
|
-
*/
|
|
123
|
-
get tracking(): boolean;
|
|
124
|
-
/**
|
|
125
|
-
* When executed, [tracking](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/TrackViewModel/#tracking) starts at the
|
|
126
|
-
* user's location.
|
|
127
|
-
*/
|
|
128
|
-
start(): void;
|
|
129
|
-
/** Stops tracking the user's location when executed. */
|
|
130
|
-
stop(): void;
|
|
131
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{deprecateUnnecessaryViewModel as t}from"../../core/deprecate.js";import n from"../../core/Logger.js";import{ignoreAbortErrors as r,debounce as i,isAbortError as a}from"../../core/promiseUtils.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import c from"../support/GeolocationPositioning.js";let l=class extends c{constructor(e){super(e),this._watchId=void 0,this._trackStartingTimeoutId=void 0,this._settingPosition=null,this._trackController=null,this.error=void 0,this.positionFilterFunction=null,e?.suppressDeprecationWarning||t(n.getLogger(this),`Track`,`arcgis-track`,{version:`5.1`})}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}destroy(){this._stopTracking()}get state(){return this._geolocationUsable?this.view&&!this.view.ready?`disabled`:this._settingPosition||this._trackStartingTimeoutId!==void 0?`waiting`:this.tracking?`tracking`:this.error==null?`ready`:`error`:`feature-unsupported`}get tracking(){return this._watchId!==void 0}start(){this.state!==`disabled`&&this.state!==`feature-unsupported`&&this._startTracking()}stop(){this.state!==`disabled`&&this.state!==`feature-unsupported`&&this._stopTracking()}_stopWatchingPosition(){this._watchId!==void 0&&(navigator.geolocation.clearWatch(this._watchId),this._watchId=void 0)}_stopTracking(){this._abortTrack(),this._clearWaitingTimer(),this._stopWatchingPosition(),this._clearGraphic()}_startTracking(){this._stopTracking();let e=i(async e=>{this._abortTrack();let t=new AbortController;this._trackController=t;let{timestamp:n,coords:r}=e,i={timestamp:n,coords:r.toJSON()};this.error=void 0;try{if(typeof this.positionFilterFunction==`function`&&!this.positionFilterFunction.call(null,{position:i})||(await this.updatePosition(e,t),this._trackController!==t))return;this._clearWaitingTimer(),this._addGraphic(),this.emit(`track`,{position:e}),this._trackController=null}catch(e){if(a(e))return;throw this._trackController=null,this._emitError(e),this._clearWaitingTimer(),e}},0);this._watchId=navigator.geolocation.watchPosition(t=>{this._settingPosition=e(t).catch(r)},this._handleWatchPositionError.bind(this),this.geolocationOptions??void 0),this._trackStartingTimeoutId=setTimeout(()=>{this._trackStartingTimeoutId=void 0},15e3)}_handleWatchPositionError(e){e.code===e.PERMISSION_DENIED&&this._stopTracking(),this._emitError(e)}_abortTrack(){this._trackController?.abort(),this._trackController=null}_clearWaitingTimer(){clearTimeout(this._trackStartingTimeoutId),this._trackStartingTimeoutId=void 0,this._settingPosition=null}_emitError(e){this.error=e,this.emit(`track-error`,{error:e})}};e([o()],l.prototype,`_watchId`,void 0),e([o()],l.prototype,`_trackStartingTimeoutId`,void 0),e([o()],l.prototype,`_settingPosition`,void 0),e([o()],l.prototype,`error`,void 0),e([o()],l.prototype,`positionFilterFunction`,void 0),e([o({readOnly:!0})],l.prototype,`state`,null),e([o({readOnly:!0})],l.prototype,`tracking`,null),e([o()],l.prototype,`start`,null),e([o()],l.prototype,`stop`,null),l=e([s(`esri.widgets.Track.TrackViewModel`)],l);const u=l;export{u as default};
|
package/widgets/Track/types.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param args - An object containing the position to be filtered.
|
|
3
|
-
* @deprecated since 5.2. Use the Track component's [`positionFilterFunction` property](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/#positionFilterFunction) and [PositionFilterFunction type](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/types/#PositionFilterFunction) instead.
|
|
4
|
-
* @since 5.0
|
|
5
|
-
*/
|
|
6
|
-
export type PositionFilterFunction = (args: { position: any; }) => boolean;
|
package/widgets/Track.d.ts
DELETED
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import type Graphic from "../Graphic.js";
|
|
2
|
-
import type Widget from "./Widget.js";
|
|
3
|
-
import type TrackViewModel from "./Track/TrackViewModel.js";
|
|
4
|
-
import type { Icon } from "@esri/calcite-components/components/calcite-icon";
|
|
5
|
-
import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
|
|
6
|
-
import type { WidgetProperties } from "./Widget.js";
|
|
7
|
-
import type { GoToOverride } from "./support/types.js";
|
|
8
|
-
import type { TrackViewModelEvents, TrackViewModelProperties } from "./Track/TrackViewModel.js";
|
|
9
|
-
import type { GraphicProperties } from "../Graphic.js";
|
|
10
|
-
|
|
11
|
-
export interface TrackProperties extends WidgetProperties, Partial<Pick<Track, "geolocationOptions" | "goToLocationEnabled" | "goToOverride" | "rotationEnabled" | "scale" | "view">> {
|
|
12
|
-
/**
|
|
13
|
-
* The graphic used to show the user's location on the map. Overriding this will disable
|
|
14
|
-
* the default graphic's heading indicator.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* const trackWidget = new Track({
|
|
18
|
-
* // Assign the track widget to a view
|
|
19
|
-
* view: view,
|
|
20
|
-
* // Overwrite the default symbol used for the
|
|
21
|
-
* // graphic placed at the location of the user
|
|
22
|
-
* graphic: new Graphic ({
|
|
23
|
-
* symbol: {
|
|
24
|
-
* // autocasts as new SimpleMarkerSymbol()
|
|
25
|
-
* type: "simple-marker",
|
|
26
|
-
* size: "12px",
|
|
27
|
-
* color: "blue",
|
|
28
|
-
* // autocasts as new SimpleLineSymbol()
|
|
29
|
-
* outline: {
|
|
30
|
-
* color: "#efefef",
|
|
31
|
-
* width: "1.5px"
|
|
32
|
-
* }
|
|
33
|
-
* }
|
|
34
|
-
* })
|
|
35
|
-
* });
|
|
36
|
-
*/
|
|
37
|
-
graphic?: GraphicProperties;
|
|
38
|
-
/**
|
|
39
|
-
* Icon displayed in the widget's button.
|
|
40
|
-
*
|
|
41
|
-
* @default "compass-north-circle"
|
|
42
|
-
* @since 4.28
|
|
43
|
-
* @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
|
|
44
|
-
* @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
|
|
45
|
-
*/
|
|
46
|
-
icon?: Icon["icon"] | null;
|
|
47
|
-
/**
|
|
48
|
-
* The widget's default label.
|
|
49
|
-
*
|
|
50
|
-
* @since 4.7
|
|
51
|
-
*/
|
|
52
|
-
label?: string | null;
|
|
53
|
-
/**
|
|
54
|
-
* The viewModel for this widget. This is a class that contains all the logic
|
|
55
|
-
* (properties and methods) that controls this widget's behavior. See the
|
|
56
|
-
* [TrackViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/TrackViewModel/) class to access
|
|
57
|
-
* all properties and methods on the widget.
|
|
58
|
-
*/
|
|
59
|
-
viewModel?: TrackViewModelProperties;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/** @deprecated since version 4.32. Use the [Track component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/). */
|
|
63
|
-
export interface TrackEvents extends TrackViewModelEvents {}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Provides a simple button that animates the [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/)
|
|
67
|
-
* to the user's location when clicked. The view rotates based on device heading.
|
|
68
|
-
* While tracking, the default button looks like the following:
|
|
69
|
-
*
|
|
70
|
-
* 
|
|
71
|
-
*
|
|
72
|
-
* The default heading symbol will display when speed is greater than zero and the browser
|
|
73
|
-
* provides heading information:
|
|
74
|
-
*
|
|
75
|
-
* 
|
|
76
|
-
*
|
|
77
|
-
* You can use the view's [DefaultUI](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/) to add widgets
|
|
78
|
-
* to the view's user interface via the `ui` property.
|
|
79
|
-
*
|
|
80
|
-
* ```js
|
|
81
|
-
* let trackWidget = new Track({
|
|
82
|
-
* view: view
|
|
83
|
-
* });
|
|
84
|
-
*
|
|
85
|
-
* view.ui.add(trackWidget, "top-left");
|
|
86
|
-
* ```
|
|
87
|
-
*
|
|
88
|
-
* > [!WARNING]
|
|
89
|
-
* >
|
|
90
|
-
* > The Track widget is only available in [secure contexts](https://developer.mozilla.org/docs/Web/Security/Secure_Contexts), such as HTTPS.
|
|
91
|
-
* > Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that support
|
|
92
|
-
* > [Window.isSecureContext](https://developer.mozilla.org/docs/Web/API/isSecureContext#browser_compatibility).
|
|
93
|
-
* >
|
|
94
|
-
* > For additional information regarding this, visit the ArcGIS blog,
|
|
95
|
-
* > [Increased Web API security in Google Chrome](https://blogs.esri.com/esri/arcgis/2016/04/14/increased-web-api-security-in-google-chrome/).
|
|
96
|
-
* >
|
|
97
|
-
* > **Known Limitations**
|
|
98
|
-
* >
|
|
99
|
-
* > - The heading symbol is not currently supported in 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/)s.
|
|
100
|
-
* > - The Track widget does not work concurrently with the [Locate](https://developers.arcgis.com/javascript/latest/references/core/widgets/Locate/) widget. Only one of the widgets can be used at a time.
|
|
101
|
-
*
|
|
102
|
-
* @deprecated since version 4.32. Use the [Track component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-track/) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
|
|
103
|
-
* @since 4.0
|
|
104
|
-
* @see [TrackViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/TrackViewModel/)
|
|
105
|
-
* @see [DefaultUI](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/)
|
|
106
|
-
*/
|
|
107
|
-
export default class Track extends Widget {
|
|
108
|
-
/**
|
|
109
|
-
* @deprecated
|
|
110
|
-
* Do not directly reference this property.
|
|
111
|
-
* Use EventNames and EventTypes helpers from \@arcgis/core/Evented
|
|
112
|
-
*/
|
|
113
|
-
"@eventTypes": TrackEvents;
|
|
114
|
-
/**
|
|
115
|
-
* @example
|
|
116
|
-
* // typical usage
|
|
117
|
-
* let track = new Track({
|
|
118
|
-
* view: view
|
|
119
|
-
* });
|
|
120
|
-
*/
|
|
121
|
-
constructor(properties?: TrackProperties);
|
|
122
|
-
/**
|
|
123
|
-
* An object used for setting optional position parameters. Refer to the
|
|
124
|
-
* [Geolocation API Specification](https://www.w3.org/TR/geolocation/#position_options_interface)
|
|
125
|
-
* for details on using these parameters.
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* const track = new Track({
|
|
129
|
-
* view: view,
|
|
130
|
-
* // Set optional position parameters
|
|
131
|
-
* geolocationOptions: {
|
|
132
|
-
* maximumAge: 0,
|
|
133
|
-
* timeout: 15000,
|
|
134
|
-
* enableHighAccuracy: true
|
|
135
|
-
* }
|
|
136
|
-
* });
|
|
137
|
-
*/
|
|
138
|
-
accessor geolocationOptions: PositionOptions | null | undefined;
|
|
139
|
-
/**
|
|
140
|
-
* Indicates whether the widget will automatically navigate the view to the user's position
|
|
141
|
-
* when a geolocation result is found. Set to `false` to disable this behavior,
|
|
142
|
-
* leaving full control to the developer.
|
|
143
|
-
*
|
|
144
|
-
* @default true
|
|
145
|
-
*/
|
|
146
|
-
accessor goToLocationEnabled: boolean;
|
|
147
|
-
/**
|
|
148
|
-
* This function provides the ability to override either the
|
|
149
|
-
* [MapView goTo()](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#goTo) or
|
|
150
|
-
* [SceneView goTo()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#goTo) methods.
|
|
151
|
-
*
|
|
152
|
-
* @since 4.8
|
|
153
|
-
* @see [MapView.goTo()](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#goTo)
|
|
154
|
-
* @see [SceneView.goTo()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#goTo)
|
|
155
|
-
* @example
|
|
156
|
-
* // The following snippet uses Search but can be applied to any
|
|
157
|
-
* // widgets that support the goToOverride property.
|
|
158
|
-
* search.goToOverride = function(view, goToParams) {
|
|
159
|
-
* goToParams.options = {
|
|
160
|
-
* duration: updatedDuration
|
|
161
|
-
* };
|
|
162
|
-
* return view.goTo(goToParams.target, goToParams.options);
|
|
163
|
-
* };
|
|
164
|
-
*/
|
|
165
|
-
accessor goToOverride: GoToOverride | null | undefined;
|
|
166
|
-
/**
|
|
167
|
-
* The graphic used to show the user's location on the map. Overriding this will disable
|
|
168
|
-
* the default graphic's heading indicator.
|
|
169
|
-
*
|
|
170
|
-
* @example
|
|
171
|
-
* const trackWidget = new Track({
|
|
172
|
-
* // Assign the track widget to a view
|
|
173
|
-
* view: view,
|
|
174
|
-
* // Overwrite the default symbol used for the
|
|
175
|
-
* // graphic placed at the location of the user
|
|
176
|
-
* graphic: new Graphic ({
|
|
177
|
-
* symbol: {
|
|
178
|
-
* // autocasts as new SimpleMarkerSymbol()
|
|
179
|
-
* type: "simple-marker",
|
|
180
|
-
* size: "12px",
|
|
181
|
-
* color: "blue",
|
|
182
|
-
* // autocasts as new SimpleLineSymbol()
|
|
183
|
-
* outline: {
|
|
184
|
-
* color: "#efefef",
|
|
185
|
-
* width: "1.5px"
|
|
186
|
-
* }
|
|
187
|
-
* }
|
|
188
|
-
* })
|
|
189
|
-
* });
|
|
190
|
-
*/
|
|
191
|
-
get graphic(): Graphic;
|
|
192
|
-
set graphic(value: GraphicProperties);
|
|
193
|
-
/**
|
|
194
|
-
* Icon displayed in the widget's button.
|
|
195
|
-
*
|
|
196
|
-
* @default "compass-north-circle"
|
|
197
|
-
* @since 4.28
|
|
198
|
-
* @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
|
|
199
|
-
* @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
|
|
200
|
-
*/
|
|
201
|
-
get icon(): Icon["icon"];
|
|
202
|
-
set icon(value: Icon["icon"] | null | undefined);
|
|
203
|
-
/**
|
|
204
|
-
* The widget's default label.
|
|
205
|
-
*
|
|
206
|
-
* @since 4.7
|
|
207
|
-
*/
|
|
208
|
-
get label(): string;
|
|
209
|
-
set label(value: string | null | undefined);
|
|
210
|
-
/**
|
|
211
|
-
* Indicates whether the widget will automatically rotate to the device heading based on
|
|
212
|
-
* the Geolocation APIs [`GeolocationCoordinates.heading`](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/heading)
|
|
213
|
-
* property. The map will not rotate if the speed is `0`,
|
|
214
|
-
* or if the device is unable to provide heading information.
|
|
215
|
-
*
|
|
216
|
-
* Set to `false` to disable this behavior.
|
|
217
|
-
*
|
|
218
|
-
* @default true
|
|
219
|
-
* @since 4.27
|
|
220
|
-
*/
|
|
221
|
-
accessor rotationEnabled: boolean;
|
|
222
|
-
/**
|
|
223
|
-
* Indicates the [scale](https://developers.arcgis.com/documentation/mapping-apis-and-services/reference/zoom-levels-and-scale/) to set on the view when navigating to the position of the geolocated
|
|
224
|
-
* result, after a location is returned from the [@track](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/#event-track) event.
|
|
225
|
-
*
|
|
226
|
-
* By default, the view will navigate to a scale of `2500` for 3D and `4514` for 2D.
|
|
227
|
-
* To override the default in 2D, set the `scale` property and also set [snapToZoom](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#constraints) to `false`.
|
|
228
|
-
* For 2D views the value should be within the [effectiveMinScale](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#constraints)
|
|
229
|
-
* and [effectiveMaxScale](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#constraints).
|
|
230
|
-
*
|
|
231
|
-
* @since 4.7
|
|
232
|
-
* @example
|
|
233
|
-
* const mapView = new MapView({
|
|
234
|
-
* map: map,
|
|
235
|
-
* container: "viewDiv",
|
|
236
|
-
* // Turn off snapToZoom
|
|
237
|
-
* constraints: {
|
|
238
|
-
* snapToZoom: false
|
|
239
|
-
* }
|
|
240
|
-
* });
|
|
241
|
-
*
|
|
242
|
-
* mapView.when(() => {
|
|
243
|
-
* // Create an instance of the Track widget
|
|
244
|
-
* let track = new Track({
|
|
245
|
-
* view: mapView,
|
|
246
|
-
* // Set a new default scale
|
|
247
|
-
* scale: 5000
|
|
248
|
-
* });
|
|
249
|
-
*
|
|
250
|
-
* // Add widget to the view's UI
|
|
251
|
-
* mapView.ui.add(track, "top-left");
|
|
252
|
-
* });
|
|
253
|
-
*/
|
|
254
|
-
accessor scale: number | null | undefined;
|
|
255
|
-
/**
|
|
256
|
-
* Indicates whether the widget is watching for new positions.
|
|
257
|
-
*
|
|
258
|
-
* @default false
|
|
259
|
-
*/
|
|
260
|
-
get tracking(): boolean;
|
|
261
|
-
/** A reference to the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). Set this to link the widget to a specific view. */
|
|
262
|
-
accessor view: MapViewOrSceneView | null | undefined;
|
|
263
|
-
/**
|
|
264
|
-
* The viewModel for this widget. This is a class that contains all the logic
|
|
265
|
-
* (properties and methods) that controls this widget's behavior. See the
|
|
266
|
-
* [TrackViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/TrackViewModel/) class to access
|
|
267
|
-
* all properties and methods on the widget.
|
|
268
|
-
*/
|
|
269
|
-
get viewModel(): TrackViewModel;
|
|
270
|
-
set viewModel(value: TrackViewModelProperties);
|
|
271
|
-
/**
|
|
272
|
-
* When executed, the widget will start [tracking](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/#tracking) the
|
|
273
|
-
* user's location. Only start the widget on a [user gesture](https://html.spec.whatwg.org/#tracking-user-activation) such as a click event.
|
|
274
|
-
*/
|
|
275
|
-
start(): void;
|
|
276
|
-
/** Stops tracking the user's location when executed. */
|
|
277
|
-
stop(): void;
|
|
278
|
-
}
|
package/widgets/Track.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{deprecateWidget as n}from"../core/deprecate.js";import r from"../core/Logger.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import o from"./Widget.js";import{loadCalciteComponents as s}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{messageBundle as l,vmEvent as u,tsx as d}from"./support/widget.js";import f from"./Track/TrackViewModel.js";const p={base:`esri-track`};let m=class extends o{constructor(e,t){super(e,t),this.messages=null,this.viewModel=new f({suppressDeprecationWarning:!0}),this._toggleTracking=()=>{let e=this.viewModel;e&&e.state!==`feature-unsupported`&&e.state!==`disabled`&&(e.state===`tracking`||e.state===`waiting`?this.viewModel.stop():this.viewModel.start())},n(r.getLogger(this),`Track`,`arcgis-track`,{version:`4.32`})}loadDependencies(){return s({button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),tooltip:()=>import(`@esri/calcite-components/dist/components/calcite-tooltip`)})}get geolocationOptions(){return this.viewModel.geolocationOptions}set geolocationOptions(e){this.viewModel.geolocationOptions=e}get goToLocationEnabled(){return this.viewModel.goToLocationEnabled}set goToLocationEnabled(e){this.viewModel.goToLocationEnabled=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return`compass-north-circle`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get rotationEnabled(){return this.viewModel.rotationEnabled}set rotationEnabled(e){this.viewModel.rotationEnabled=e}get scale(){return this.viewModel.scale}set scale(e){this.viewModel.scale=e}get tracking(){return this.viewModel.tracking}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}start(){this.viewModel.start()}stop(){this.viewModel.stop()}render(){let{viewModel:e,messages:t,icon:n}=this,r=e?.state,i=r===`tracking`,a=this._localizeError(this.viewModel?.error),o=(i?t?.stopTracking:t?.startTracking)??``,s=r===`feature-unsupported`,l=(r===`tracking`?`pause`:void 0)??n;return d(`div`,{class:this.classes(p.base,c.widget)},!s&&d(`calcite-button`,{class:c.widgetButton,disabled:r===`disabled`,iconStart:l,kind:`neutral`,label:o,loading:r===`waiting`,title:o,onclick:this._toggleTracking}),a?d(`calcite-tooltip`,{open:!0,overlayPositioning:`fixed`,referenceElement:this.container,topLayerDisabled:this.topLayerDisabled},a):null)}_localizeError(e){if(e instanceof GeolocationPositionError)return e.code===GeolocationPositionError.PERMISSION_DENIED?this.messages?.permissionError:e.code===GeolocationPositionError.TIMEOUT?this.messages?.timeoutError:this.messages?.positionUnavailable;if(e instanceof Error)return e.message}};e([i()],m.prototype,`geolocationOptions`,null),e([i()],m.prototype,`goToLocationEnabled`,null),e([i()],m.prototype,`goToOverride`,null),e([i({type:t})],m.prototype,`graphic`,null),e([i()],m.prototype,`icon`,null),e([i()],m.prototype,`label`,null),e([i(),l(`esri/widgets/Track/t9n/Track`)],m.prototype,`messages`,void 0),e([i()],m.prototype,`rotationEnabled`,null),e([i()],m.prototype,`scale`,null),e([i({readOnly:!0})],m.prototype,`tracking`,null),e([i()],m.prototype,`view`,null),e([i({type:f}),u([`track`,`track-error`])],m.prototype,`viewModel`,void 0),m=e([a(`esri.widgets.Track`)],m);const h=m;export{h as default};
|