3

Hopefully something silly I'm overlooking. I started building my map with this sample code

But once I started using my own data, it isn't appearing correctly on the map. Example: These coordinates [38.90309, -77.05070999] in Washington DC show up somewhere in Antartica, as do the other US coordinates.

I've read a little about specifying the coordinate system that is being used, and it seems that maybe that is the problem. But I can't find any documentation about how to do that in the JavaScript API.

Vince
20.5k16 gold badges49 silver badges65 bronze badges
asked Jun 12, 2018 at 15:33

2 Answers 2

2

Your coordinates are incorrect.

Correct answer is

view.center = [-77.05070999, 38.90309];

https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference

answered Jun 12, 2018 at 15:49
2

You probably just have the values reversed. When dealing with a point, ESRI expects the longitude(x) to be first, and latitude(y) to be second. [-77.0363403, 38.8894801]

answered Jun 12, 2018 at 15:43
1
  • 1
    Holy cannoli! :) That's the best thing I've heard all day. You're right! Can't tell I'm new at this, huh? Commented Jun 12, 2018 at 15:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.