I am trying to create a graphic on the map and grab its Latitude and Longitude values. To do so, I need to project from State Plane to WGS84 (wkid=4326).
1. When I try to create a new GeometryService, I get an error saying "GeometryService is not a constructor".
In my require statement, I'm using
"esri/rest/geometryService",
"esri/rest/support/ProjectParameters",
In my function statement, I'm using
GeometryService,
ProjectParameters,
This is the line that causes the error "GeometryService is not a constructor":
const myGeometryService = new GeometryService("https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
2. If I change my function statement to lower case g:
geometryService,
ProjectParameters,
This is the line that causes a different error "Identifier 'geometryService' has already been declared"
const myGeometryService = new geometryService("https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
What am I doing wrong?
Note: I've also tried URL "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer"