Problem adding graphics layer

448
4
01-18-2018 03:11 PM
BrandonPrice
Occasional Contributor

Hello,

I am querying attribute table values of a highway layer to return the geometry for sections of the highway. The user searches for the section of the highway they want in a dropdown menu and click a run button. When the run button is clicked, the graphics layer added doesn't not show up in the right location. Maybe it the spatial reference?

This is the code for the spatial reference:

let postMileMarkerPolyline = new Polyline({
paths: finalPaths,
spatialReference: app.map.spatialReference
});

app.map has a wkid of 102100 and the layer that I am using to show graphics has a wkid of 102645. Not sure if this matters.

Thanks,

Brandon

https://community.esri.com/community/developers/web-developers?sr=search&searchId=8098f230-4728-4d14...

https://community.esri.com/community/gis/web-gis?sr=search&searchId=8098f230-4728-4d14-b341-cd447f2d...

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Brandon,


  Your query needs to specify the outSpatialRefece property to be the maps spatial reference.

BrandonPrice
Occasional Contributor

Even if the original layer of my graphics layer is not the same as the map?

0 Kudos
BrandonPrice
Occasional Contributor

That's the way I have it now, but it still is in the wrong location

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Are you sure you have the property spelled correctly and it is in the proper CaSe? I misspelled it in my previous reply. When using that property ArcGIS server will reproject the results before returning then.

0 Kudos