A problem on moving cursor to get points' information

Discussion created by sailitang on Oct 16, 2013
Latest reply on Oct 17, 2013 by JGravois-esristaff

I am using the code to read a database to get some points xy coordinates and using the following code to put these points to the map. Stpointcoord is xy coordinates array. I used to get the coordinate from the database and transfer these coordinate string to javascript.

var srLatLon = new SpatialReference({ wkid: 4326 });
for (var i = 0; i < stpointcoord.length; i = i + 2) {
     var x = stpointcoord[i];
     var y = stpointcoord[i + 1];
     stpoint = new Point(x, y, srLatLon);
     arrayUtils.forEach([stpoint], function (result) {
     //add point to the map

      graphic = new Graphic(result, createSymbol(initColor, "6"));;

The map is attached. Now I would like users to move the cursor over a point and then the point information is shown by infowindow. But the problem is that the xy coordinates I am using evt.mapPoint to get are not accurate and there is at most 500000 difference. For example, St.Paul???s xy coordinate in the database is 2617213,7485938, but I get the coordinate which is 3070882, 7012354 when I move my cursor over the point. So the information window shows wrong information. Could you tell me why the coordinates have big difference and how I can fix it. Thanks.