Very appreciate someone can help my question here. I just start working with WAB builder customized widget. I have a Georgia State plane coordinate as a base map. Once a user click on map to get a point, I need to project to a Geographic coordinate. The widget has no error but when goes to the geometry service project function. It does not give me any call back basically nothing. Please see where I got wrong. It bugs me for several days. Thanks lots.
Solved! Go to Solution.
There's a problem with your module/function argument agreement. The misplaced GraphicsLayer argument throws everything off
define(['dojo/_base/declare',
'jimu/BaseWidget',
'dojo/_base/lang',
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
'esri/Color',
'esri/graphic',
'esri/layers/GraphicsLayer',
"esri/tasks/GeometryService",
"esri/geometry/Point",
"esri/SpatialReference",
"esri/tasks/ProjectParameters",
'esri/map'],
function(declare,
BaseWidget,
lang,
SimpleMarkerSymbol,
SimpleLineSymbol,
Color,
Graphic,
GraphicsLayer, //moved
GeometryService,
Point,
SpatialReference,
ProjectParameters,
map)
Have you tried using float for the latitude longitude? I recently had a similar process and the values I was passing were string instead of float (performed with "esri/geometry/projection" instead of Geometry service).
Thanks you RyanDickinson. I will see whether I can try projection instead of geometry service. I used wkitID which is number I think.
There's a problem with your module/function argument agreement. The misplaced GraphicsLayer argument throws everything off
define(['dojo/_base/declare',
'jimu/BaseWidget',
'dojo/_base/lang',
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
'esri/Color',
'esri/graphic',
'esri/layers/GraphicsLayer',
"esri/tasks/GeometryService",
"esri/geometry/Point",
"esri/SpatialReference",
"esri/tasks/ProjectParameters",
'esri/map'],
function(declare,
BaseWidget,
lang,
SimpleMarkerSymbol,
SimpleLineSymbol,
Color,
Graphic,
GraphicsLayer, //moved
GeometryService,
Point,
SpatialReference,
ProjectParameters,
map)
Thanks KenBuja that order of graphicslayer function does cause issue. The gsv seems working. However it is really strange that if you define the projection with inputSR. The output projected point is off a bit like several degrees somehow. But when you use input point just as evt.mapPoint. It works perfectly. Looks like you cannot define again when you use your own projected layer as basemap in AGOLINE. Nowhere ESRI mentioned this.