Layer using 26917 SpatialReference issue

227
1
Jump to solution
06-24-2020 05:22 PM
by Anonymous User
Not applicable

I am trying to make use of the MapView's goTo function when adding a new layer to a map, but it does not seem to work. When the layer is added, itThe wkid of the layer is 26917 (NAD83), and I have tried others that correspond to that (4326, 4269, etc.), but they don't work either. I have used my code on layers that use wkid 3857 and that works fine, but for some reason can't get it to work with this one (Note:

For more context, here is my code:

var mapExtent = new Extent(extent.xmin, extent.ymin, extent.xmax, extent.ymax, new SpatialReference({ wkid: 4326, latestWkid: 4326 }));
view.goTo(mapExtent);

Output:

My MapView's spatial reference is set to 3857, but as far as I am aware, that cannot be changed. Any help or tips would be great!

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Michael,

   The goto function requires that the target coordinates be in the same spatial reference as the view. So you will have to project your data to 102100/3857 first. Normally if you are querying the data you can request that the returned geometry is in 102100 by using the outSpatialReference propery of the Query class.

View solution in original post

1 Reply
RobertScheitlin__GISP
MVP Esteemed Contributor

Michael,

   The goto function requires that the target coordinates be in the same spatial reference as the view. So you will have to project your data to 102100/3857 first. Normally if you are querying the data you can request that the returned geometry is in 102100 by using the outSpatialReference propery of the Query class.