Class: GotoXY

<script type="text/javascript">
  var dojoConfig = {
    async: true,
    packages: [{
      name: "dijits",
      location: location.pathname.replace(/\/[^/]+$/, '') + '/dijit'
    }]
  }
</script>

require(["dijits/GotoXY"], function(GotoXY) { /* code goes here */ });

Description

The GotoXY widget provides the ability to enter coordinate pairs in a pre-defined coordinate string to zoom the map to and place a marker on the map at those coordinates.

Note: This widget requires a Geometry Service that uses an ArcGIS Server (versions 10.3.1 or higher) service url.

It is recommended that you create a geometry service for use within your applications. View the Geometry Services help topic in the Server Resource Center for details on creating and publishing a geometry service. Esri hosts a geometry service on sampleserver6 to support samples published in the Resource Center. You are welcome to use this service for development and testing purposes.

Sample

Sample that uses this class.

Constructors

Name Summary
new GotoXY(params, srcNodeRef) Creates a new GotoXY widget.

CSS

Name Description
clearBtnCls Specify the style used for the GotoXY clear button.
GotoXY Specify the style used for the GotoXY widget.

Methods

Name Return type Summary
clearResult() None Remove the GotoXY graphics and clear the input text box.
Constructor Details

new GotoXY(params, srcNodeRef)

Creates a new GotoXY widget. The GotoXY constructor should be called after the map is loaded, for example in the map's .on("load") event. (Added at v3.10)
Parameters:
<Object> params Required See options list for parameters.
<Node | String> srcNodeRef Required Reference or id of the HTML element where the widget should be rendered.
params properties:
<Object[]> units Required The array of units to be used by this widget. Required properties are: type, example, label. Optional properties are: default and wkid. Valid values for type are: "DMS", "DDM", "DD", "CUSTOM". The example property will be used as the placeholder text in the widgets text input box. The label property is the text that will be shown in the widgets drop down menu. The default property is used to specify the default coordinate option for the widget at startup. The wkid property is used in conjunction with the CUSTOM type to enable you to use a coordinates system other than WGS84.
<Map> map Required Reference to the map. The map parameter is required.
<MarkerSymbol> pointSymbol Optional Marker symbol used to draw the points. The default symbol, is a 16x26 picture marker symbol with a vertical offset of 12 pixels.
<Number> zoomScale Optional The scale the ma will zoom to when the coordinates are found.
<String> GeometryService Optional The URL of a geometry service that has a minimum version of 10.3.1.
Sample:
require([
 
"esri/map", "dijits/GotoXY", ...
], function(Map, GotoXY, ... ) {
 
var map = new Map( ... );
 
var gotoXYDijit = new GotoXY({
    map
: map,
    units
: [
      {
        type: 'DMS',
        example: '33 42 29.23 N, 085 49 22.29 W',
        label: 'Degrees Minutes Seconds',
        default: 'true'
      }
    ]
  }, dom.byId('gtDiv'));
 
...
});
Method Details

clearResult()

Remove the GotoXY graphic and clears the text input box. (Added at v2.4)