Provides the logic for the CoordinateConversion widget.
Constructors
-
new CoordinateConversionViewModel(properties)
-
Parameterproperties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
Collection<Conversion> | A Collection containing every Conversion that the widget is currently displaying. more details | CoordinateConversionViewModel | |
Point | Describes the location of the coordinates currently displayed by the widget as a Point. more details | CoordinateConversionViewModel | |
String | The name of the class. more details | Accessor | |
Collection<Format> | A Collection containing every Format that the widget is capable of displaying. more details | CoordinateConversionViewModel | |
GoToOverride | This function provides the ability to override either the MapView goTo() or SceneView goTo() methods. more details | CoordinateConversionViewModel | |
SimpleMarkerSymbol|PictureMarkerSymbol | This symbol is used to visualize the location currently described by the widget when | CoordinateConversionViewModel | |
String | Describes the current mode of the widget. more details | CoordinateConversionViewModel | |
String | The view model's state. more details | CoordinateConversionViewModel | |
Boolean | If this property is set to | CoordinateConversionViewModel | |
String | This property determines whether sessionStorage or localStorage will be used to store widget state. more details | CoordinateConversionViewModel | |
MapView|SceneView | A reference to the MapView or SceneView. more details | CoordinateConversionViewModel |
Property Details
-
conversions Collection<Conversion>
-
A Collection containing every Conversion that the widget is currently displaying.
Example// conversions can be set with an array of strings where each string is a format's name coordinateConversion.conversions = ["mgrs"];
-
currentLocation Point
-
Describes the location of the coordinates currently displayed by the widget as a Point. Setting this property will update all conversions.
-
The name of the class. The declared class name is formatted as
esri.folder.className
.
-
formats Collection<Format>
-
A Collection containing every Format that the widget is capable of displaying.
The default formats are
basemap
,dd
,ddm
,dms
,mgrs
,usng
,utm
, andxy
.
-
goToOverride GoToOverrideSince: ArcGIS Maps SDK for JavaScript 4.8
-
This function provides the ability to override either the MapView goTo() or SceneView goTo() methods.
Example// The following snippet uses the Search widget but can be applied to any // widgets that support the goToOverride property. search.goToOverride = function(view, goToParams) { goToParams.options.duration = updatedDuration; return view.goTo(goToParams.target, goToParams.options); };
-
-
This symbol is used to visualize the location currently described by the widget when
capture
mode is active.
-
mode String
-
Describes the current mode of the widget.
- While in
live
mode, the widget will update as the cursor moves. - While in
capture
mode, the widget will update on mouse click and display a graphic marking the current location.
Possible Values:"live"|"capture"
- Default Value:live
- While in
-
state Stringreadonly
-
The view model's state.
Possible Values:"ready"|"loading"|"disabled"
- Default Value:disabled
-
storageEnabled BooleanSince: ArcGIS Maps SDK for JavaScript 4.20
-
If this property is set to
true
, sessionStorage or localStorage (depending on storageType) will be used to hydrate and persist the CoordinateConversion widget's state.- Default Value:true
-
storageType StringSince: ArcGIS Maps SDK for JavaScript 4.23
-
This property determines whether sessionStorage or localStorage will be used to store widget state.
Possible Values:"session"|"local"
- Default Value:"session"
- See also
Method Overview
Name | Return Type | Summary | Class |
---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object. more details | Accessor | ||
Promise<Position> | Attempt to convert a point into a Position. more details | CoordinateConversionViewModel | |
Boolean | Returns true if a named group of handles exist. more details | Accessor | |
Removes a group of handles owned by the object. more details | Accessor | ||
Promise<Point> | Attempt to convert a string into a Point. more details | CoordinateConversionViewModel | |
Promise<Conversion[]> | Update the input conversions based on the input point. more details | CoordinateConversionViewModel |
Method Details
-
addHandles(handleOrHandles, groupKey)inheritedSince: ArcGIS Maps SDK for JavaScript 4.25
-
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles const handle = reactiveUtils.when( () => !view.updating, () => { wkidSelect.disabled = false; }, { once: true } ); this.addHandles(handle); // Destroy the object this.destroy();
ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed.
groupKey *optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
-
Attempt to convert a point into a Position.
Parameterspoint PointThe point to convert.
format FormatThe format that describes how the point should be converted.
ReturnsType Description Promise<Position> When resolved, returns a Position.
-
Since: ArcGIS Maps SDK for JavaScript 4.25
-
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType Description Boolean Returns true
if a named group of handles exist.Example// Remove a named group of handles if they exist. if (obj.hasHandles("watch-view-updates")) { obj.removeHandles("watch-view-updates"); }
-
removeHandles(groupKey)inheritedSince: ArcGIS Maps SDK for JavaScript 4.25
-
Removes a group of handles owned by the object.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");
-
Attempt to convert a string into a Point. The format of the string must be specified. A Collection of available formats can be obtained from the formats property.
Parameterscoordinate StringThe coordinate string.
format FormatSpecifies the format of the input coordinate.
ReturnsType Description Promise<Point> When resolved, returns a Point.
-
updateConversions(conversions, location){Promise<Conversion[]>}
-
Update the input conversions based on the input point.
Parametersconversions Conversion[]An array of Conversions to be updated.
location PointA point that will be used to update each input conversion.
ReturnsType Description Promise<Conversion[]> When resolved, returns an array of Conversions with updated Positions.