CoordinateConversionViewModel

require(["esri/widgets/CoordinateConversion/CoordinateConversionViewModel"], function(CoordinateVM) { /* code goes here */ });
Class: esri/widgets/CoordinateConversion/CoordinateConversionViewModel
Inheritance: CoordinateConversionViewModel Accessor
Since: ArcGIS API for JavaScript 4.7

Provides the logic for the CoordinateConversion widget.

See also:

Constructors

new CoordinateConversionViewModel(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
Collection<Conversion>

A Collection containing every Conversion that the widget is currently displaying.

more details
more detailsCoordinateConversionViewModel
Point

Describes the location of the coordinates currently displayed by the widget as a Point.

more details
more detailsCoordinateConversionViewModel
String

The name of the class.

more details
more detailsAccessor
Collection<Format>

A Collection containing every Format that the widget is capable of displaying.

more details
more detailsCoordinateConversionViewModel
GoToOverride

This function provides the ability to override either the MapView goTo() or SceneView goTo() methods.

more details
more detailsCoordinateConversionViewModel
SimpleMarkerSymbol|PictureMarkerSymbol

This symbol is used to visualize the location currently described by the widget when capture mode is active.

more details
more detailsCoordinateConversionViewModel
String

Describes the current mode of the widget.

more details
more detailsCoordinateConversionViewModel
Number

The number of milliseconds of delay before conversion requests will be sent to the GeometryService.

more details
more detailsCoordinateConversionViewModel
String

The view model's state.

more details
more detailsCoordinateConversionViewModel
MapView|SceneView

A reference to the MapView or SceneView.

more details
more detailsCoordinateConversionViewModel

Property Details

conversions Collection<Conversion>

A Collection containing every Conversion that the widget is currently displaying.

currentLocation Point

Describes the location of the coordinates currently displayed by the widget as a Point. Setting this property will update all conversions.

declaredClass Stringreadonly inherited

The name of the class. The declared class name is formatted as esri.folder.className.

A Collection containing every Format that the widget is capable of displaying.

The default formats are basemap, dd, ddm, dms, mgrs, usng, utm, and xy.

goToOverride GoToOverride
Since: ArcGIS API for JavaScript 4.8

This function provides the ability to override either the MapView goTo() or SceneView goTo() methods.

See also:
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.

Possible Values: live | capture

  • 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.
Default Value:live
requestDelay Number

The number of milliseconds of delay before conversion requests will be sent to the GeometryService. This only affects conversions that cannot be performed in the browser.

Default Value:300
state Stringreadonly

The view model's state.

Possible Values: ready | loading | disabled

Default Value:disabled

A reference to the MapView or SceneView. Set this to link the widget to a specific view.

Method Overview

NameReturn TypeSummaryClass
Promise<Position>

Attempt to convert a point into a Position.

more details
more detailsCoordinateConversionViewModel
Promise<Point>

Attempt to convert a string into a Point.

more details
more detailsCoordinateConversionViewModel
Promise<Conversion[]>

Update the input conversions based on the input point.

more details
more detailsCoordinateConversionViewModel

Method Details

convert(point, format){Promise<Position>}

Attempt to convert a point into a Position.

Parameters:
point Point

The point to convert.

format Format

The format that describes how the point should be converted.

Returns:
TypeDescription
Promise<Position>When resolved, returns a Position.
reverseConvert(coordinate, format){Promise<Point>}

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.

Parameters:
coordinate String

The coordinate string.

format Format

Specifies the format of the input coordinate.

Returns:
TypeDescription
Promise<Point>When resolved, returns a Point.
updateConversions(location, conversions){Promise<Conversion[]>}

Update the input conversions based on the input point.

Parameters:
location Point

A point that will be used to update each input conversion.

conversions Conversion[]

An array of Conversions to be updated.

Returns:
TypeDescription
Promise<Conversion[]>When resolved, returns an array of Conversions with updated Positions.

Type Definitions

Position

Describes a point in terms of a location, a Point, and a coordinate, a string.

Properties:
location Point

A point geometry representing the location described by the conversion.

coordinate String

A string representing the location.

API Reference search results

NameTypeModule
Loading...