AnsweredAssumed Answered

Add point different spatialReference show up incorrect place? api arcgis javascript

Question asked by sinharcgis on Dec 13, 2016
Latest reply on Dec 15, 2016 by sinharcgis

I use services arcgis onlie as basemap of application World_Topo_Map (MapServer) 

I query featues ( features is point and  point  in spatialReference VN_2000) from my services  add them to the map; but not incorrect place.

Project my service

      XMin: 385598.2612

 

      YMin: 1140834.1165

 

      XMax: 489255.87930000003

 

      YMax: 1304237.5362

 

    Spatial Reference: PROJCS["VN-2000",GEOGCS["GCS_VN_2000",DATUM["D_VN_2000",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",107.75],PARAMETER["Scale_Factor",0.9999],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]],VERTCS["Hon_Dau_1992",VDATUM["Hon_Dau_1992"],PARAMETER["Vertical_Shift",0.0],PARAMETER["Direction",1.0],UNIT["Meter",1.0]]

 

 

My code below:

var querytimkiem = new Query();
var strSearch = dom.byId("inputSearch").value.toString().toLowerCase();
var array = strSearch.split(" ");
var strSearch = "";
for (i = 0; i < array.length; i++) {
if (strSearch != "") {
strSearch += " And ";
}
strSearch += " (lower(TEN) LIKE'%" + array[i] + "%')";
}
querytimkiem.where = "(" + strSearch + ")";
querytimkiem.returnGeometry = true;
querytimkiem.outSpatialReference = { wkid: 102100 }
var qttimkiem = new QueryTask("Url");
qttimkiem.execute(querytimkiem, searchCongTrinhCallBack);

 

function searchCongTrinhCallBack(featureSet) {
var symbolXem = new esri.symbol.PictureMarkerSymbol({
"angle": 0,
"xoffset": 0,
"yoffset": 10,
"type": "esriPMS",
"url": "Images/GreenPin1LargeB.png",
"contentType": "image/png",
"width": 27,
"height": 27
});

 

var graphic;
var params;

var outSR = new esri.SpatialReference({
wkid: 102100
});
var resultFeatures = featureSet.features;
var geometryService = new esri.tasks.GeometryService("url");
for (var i = 0, il = resultFeatures.length; i < il; i++) {
var pont = new Point(resultFeatures[i].geometry);
params = new ProjectParameters();
params.geometries = [pont];
params.outSR = outSR;
geometryService.project(params, function (outputpoint) {
var pont = new Point(outputpoint[0].x, outputpoint[0].y, outSR);
graphic = new esri.Graphic(pont, symbolXem);
map.graphics.add(graphic);
});

}

}

Outcomes