Hello,I was working with a samplehttp://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/find_map_datagrid.htmlbut for my school project I have to use ArcServer base map so I tried but did not work so far.Any one can tell me what did I do wrong please?Thank you,JackWant to change fromfunction init() {
dojo.connect(grid, "onRowClick", onRowClickHandler);
center = [-83.266, 42.568];
zoom = 11;
map = new esri.Map("map", {
basemap: "streets",
center: center,
zoom: zoom
});
//Create Find Task using the URL of the map service to search
findTask = new esri.tasks.FindTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/TaxParcel/TaxParcelQuery/MapServer/");
dojo.connect(map, "onLoad", function() {
//Create the find parameters
findParams = new esri.tasks.FindParameters();
findParams.returnGeometry = true;
findParams.layerIds = [0];
findParams.searchFields = ["OWNERNME1","OWNERNME2"];
findParams.outSpatialReference = map.spatialReference;
console.log("find sr: ", findParams.outSpatialReference);
});
}
TOfunction init() {
dojo.connect(grid, "onRowClick", onRowClickHandler);
var initExtent = new esri.geometry.Extent({"xmin":1076363,"ymin":3109863,"xmax":1084228,"ymax":3113693,"spatialReference":{"wkid":32139}});
map = new esri.Map("map",{
infoWindow:popup,
extent:initExtent,logo: false,
zoom: 2,
sliderStyle: "large"
});
//dojo.connect(map,"onLoad",mapReady);
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://localhost:6080/arcgis/rest/services/COR/basemap/MapServer");
map.addLayer(basemap);
//Create Find Task using the URL of the map service to search
findTask = new esri.tasks.FindTask("http://localhost:6080/arcgis/rest/services/COR/intmap/MapServer");
dojo.connect(map, "onLoad", function() {
//Create the find parameters
findParams = new esri.tasks.FindParameters();
findParams.returnGeometry = true;
findParams.layerIds = [0,1,2,3];
findParams.searchFields = ["Number","Name","Abbrev"];
findParams.outSpatialReference = map.spatialReference;
console.log("find sr: ", findParams.outSpatialReference);
});
}
The server is working fine and also without changing basemap findtask is working as well.