Select to view content in your preferred language

Coordinates Problem

1223
2
Jump to solution
01-02-2018 02:43 PM
NaciDilekli
Frequent Contributor

I am observing a strange behavior with my JS (ver 3.13) based site. What I do (used to do to be more precise) is doing a query based on the login and generate bookmarks dynamically. This used to work a few months ago, and it stopped working for some reason.

1) Read extents from a map service (Geographic Coordinate System: GCS_WGS_1984, Datum: D_WGS_1984, WKID: 4326).

2) Convert the extents to WKID: 102100 using esri/geometry/webMercatorUtils . Otherwise, it would give me this error: "cannot be converted to spatial reference of the map (wkid: 102100)"

3) Build bookmarks with projected extents.

Now I have two problems (I am really asking for the second problem mainly):

1) I am not able to project the extent object. This used to work a few months ago, so I am confused. I can get around this by converting to points or polygon, doing the projection and then converting back to extent, however, this method requires me to enter the WKID and the second problem prevents that. 

2) The extent objects that I read have unusual coordinates. When I view the coordinates in ArcMap, they range between -180 to +180. When I read the state of Oklahoma extent, for example, it looks like the following:

spatialReference:
{wkt: "PROJCS["Albers_Equal_Area_Conic_USGS_CONUS_NAD83",…TER["Latitude_Of_Origin",23.0],UNIT["Meter",1.0]]"}
type:"extent"{xmax:141320.96667405692, xmin:-620900.8297257517, ymax:1573499.24031829, ymin:1173102.526342012}

So what I understand is that features that return from the attribute query have been projected, although not to WKID:102100. It is certainly not 4326. It doesn't have the WKID feature, only wkt. I looked up Albers_Equal_Area_Conic_USGS_CONUS_NAD83, but did not find any associated WKIDs. I can't tell what WKID I should enter. I tried entering WKID:102100 but then my Oklahoma features ended up in West Africa.

What might be the solution here? Thanks.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Naci,

   Are you specifying the outSpatialRefernce of the query object?

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Naci,

   Are you specifying the outSpatialRefernce of the query object?

0 Kudos
NaciDilekli
Frequent Contributor

It was so simple, thanks!!

0 Kudos