i am using arcgis javascript apis 3.5 and my code is
function init() {
map = new esri.Map("mapDiv", {
basemap: "streets",
center: [-112.07102547942392, 46.75909704205151],
zoom: 12,
slider: false
});
var featureLayer = new esri.layers.FeatureLayer("http://abc/arcgis/rest/services/MTARNG/MapServer/0", {
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
outFields: ["*"]
});
and for search in this layer i am using findtask. code is here
findTask = new esri.tasks.FindTask("http://abc/arcgis/rest/services/MTARNG/MapServer");
findParams = new esri.tasks.FindParameters();
findParams.returnGeometry = true;
findParams.layerIds = [0];
findParams.searchFields = ["LOCATION", "PROJECT_PARCEL_NAME"];
findParams.searchText = "north portion";
findTask.execute(findParams, showResults);
function showResults(results) {
var markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 1), new dojo.Color([0, 255, 0, 0.25]));
map.graphics.clear();
dojo.forEach(results, function (result) {
var graphic = result.feature;
if (graphic.geometry != null) {
switch (graphic.geometry.type) {
case "point":
graphic.setSymbol(markerSymbol);
break;
}
}
map.graphics.add(graphic);
});
}
So it is adding the features in map but in wrong place like in the image ![In the image features are in different place and graphics are in different place][1]
sory i dont have enough reputation point to post image? Please check my photo i have replace the image with my photo
I analysis then i came to know that result of wkid is responsible. i checked the wkid. my layers has wkid number "26912" and graphicslayer has wkid number 4326.
so what i will do, i just try to change the wkid but it is not working. i am working on right way or anything else i have to do.
thanks in advance.