I am using a Map service on ARcGIS Server 10.4.1 which is in this format
Spatial Reference: 102100 (3857)
Single Fused Map Cache: false
Initial Extent:
Full Extent:
Units: esriMeters
Now when I query the service it returns the data in Meter format which I can not display back them on the map as new graphics. Can you please let me know how I can change the service configuration or OutUnit in ArcGIS JavaScript API to be in Decimal Degree
Make sure you remove the outSR from your esriRequest.
Ok Here is a better answer:
Hard- coding and adding a Point like DD is working
var point = new Point(-88.1681599642482, 41.796253348566786);
var pointGraphic = new esri.Graphic(point);
graphicsLayerTraceNetworkJunctions.add(pointGraphic);
But same point in Meter Unit not displaying on the map
var point = new Point(-9814834.6714, 5130507.876800001);
var pointGraphic = new esri.Graphic(point);
graphicsLayerTraceNetworkJunctions.add(pointGraphic);
and as you can see I am getting all point in Meter!
I'm having the same exact problem. I am copying point geometries from a featurelayer in WebMercator, and putting the points into graphics and adding that to the map. The featurelayer points show up just fine. The graphic points only show up if I override the x/y values with lat-long coordinates. I've been trying to use this:
var point2 = webMercatorUtils.webMercatorToGeographic(point.geometry),
but that throws this error: "Cannot read property 'clone' of undefined".
Kevin,
What is the class type of the point?
Point.geometry would mean to me that poin is a graphic is that correct.
I figured it out. Original points were generic type "point". webMercatorToGeographic did not work, but xyToLngLat did. Don't understand why, but for now my problem is solved:
for (var i = 0; i < response.features.length; i++) {
textSymbol.text = response.features.attributes.Origin
var point = {
type: "point",
x: response.features.geometry.x,
y: response.features.geometry.y
}
var newXY = webMercatorUtils.xyToLngLat(point.x, point.y)
var point2 = {
type: "point",
x: newXY[0],
y: newXY[1]
}
var pointGraphic = new Graphic({
geometry: point2,
symbol: textSymbol
});
GLCopy.graphics.add(pointGraphic);
};
//after all graphics are added:
map.add(GLCopy);