Using ESRI JSAPI Search dijit with lat/lon coordinates

1124
3
Jump to solution
05-22-2018 12:04 PM
JoanneMcGraw
Occasional Contributor III

The documentation for this widget suggests the "value" could be "a string, geometry, suggest candidate object, or an array of [latitude,longitude]."

Using it though, if I enter the lat/lon string "45.4215,-75.6972", I am taken to the coast of Antartica. If I enter "-75.6972,45.4215", I am taken to Ottawa, Ontario...which is where I expected "45.4215,-75.6972" to take me.

I get that it is interpreting the values provided as x,y (and if I provided web mercator coordinates, this would be fine) but don't people usually give lat,lon coordinates in that order (that is, y/x)? Should I expect to be able to provide lat,lon?

Am I crazy or should I be contacting ESRI Support about a possible bug here...?

Tags (2)
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Joanne,

   ESRI is a GIS company so the way that they expect coordinates to be entered is the proper GIS way of (X and Y) Not the Y and X. It is not a bug it is the GIS Standard.

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Joanne,

   ESRI is a GIS company so the way that they expect coordinates to be entered is the proper GIS way of (X and Y) Not the Y and X. It is not a bug it is the GIS Standard.

0 Kudos
NathanMellor
Occasional Contributor

That answer is insufficient based on the behavior I see now.

We are using search widget with 3.2X

If I enter 45.4215,-75.6972 it takes me to Ottawa Ontario.

If I enter -75.6972,45.4215 it ALSO takes me to Ottawa Ontario.

So if someone WANTS to go to the coast of Antartica, they are out of luck, huh?

Likewise if I enter "5.1,51.5" it takes me to the same place as if I enter "51.5,5.1"

That can't be explained by ESRI wanting coordinates in X,Y order. 

It looks like you are second guessing the order in which coordinates are entered.

Can you explain how it should work?

RobertScheitlin__GISP
MVP Emeritus

The search widget tries to determine the coordinate order based on the values entered automatically. But if you need to specify the order (like in your test case) then you simply use: X:45.421500 Y:-75.697200 in the search widget.

ArcGIS JS Search Widget - searching by latitude, longitude - Geographic Information Systems Stack Ex... 

0 Kudos