I mean in your ExtractData model. Modify your AOI parameter ->Data Type -> Import schema and symbology from:. The polygon feature class (your schema) should have SR as 27700. What happen is that even though you draw or add a AOI on the web map and your mxd (both has WKID 10200), its internal SR is still 27700 so that your AOI and cliped layer are in the same SR-27700.
I tried that and unfortunately I still can't get this working. I know have a layer in my MXD called AOI with the SRID 27700 and I have used this as the Import schema and symbology from part of the Extract Data Task model.Using Firebug, I think the problem is with passing the AOI geometry from the graphics. Is this the way to do it:
function showTResults(results){
dojo.forEach(results, function(result) {
var graphic = result.feature;
var fMarkerSymbol = 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]));
var fLineSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH, new dojo.Color([255, 0, 0]), 3);
var fPolygonSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_NONE, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.25]));
switch (graphic.geometry.type) {
case "point":
graphic.setSymbol(fMarkerSymbol);
break;
case "polyline":
graphic.setSymbol(fLineSymbol);
break;
case "polygon":
graphic.setSymbol(fPolygonSymbol);
break;
}
map.graphics.add(graphic);
})
ext = esri.graphicsExtent(graphics);
function doFind(textSearch) {
params.searchText = textSearch;
find.execute(params, showTResults);
}
function download(){
var clipLayers = [];
var seismicCount = (jQuery("#selectedSeismicTable").getGridParam("reccount"));
var wellCount = (jQuery("#selectedWellTable").getGridParam("reccount"));
var rpCount = (jQuery("#selectedRPTable").getGridParam("reccount"));
if (seismicCount > 0) {
clipLayers.push('2D Seismic');
for (i = 1; i < seismicCount + 1; i++) {
var ref = $('#selectedSeismicTable').getCell(i, 1);
//alert(ref);
doFind(ref);
}
};
if (rpCount > 0) {
clipLayers.push('Regional Profiles');
for (i = 1; i < rpCount + 1; i++) {
var ref = $('#selectedRPTable').getCell(i, 1);
// alert(ref);
doFind(ref);
}
};
if (wellCount > 0) {
clipLayers.push('Wells');
for (i = 1; i < wellCount + 1; i++) {
var ref = $('#selectedWellTable').getCell(i, 1);
// alert(ref);
doFind(ref);
}
};
var dlFormat = 'Shapefile - SHP - .shp';
var params2 = {
"Layers_to_Clip": clipLayers,
"Area_of_Interest": ext,
"Feature_Format": dlFormat
}
esri.show(loading);
gp.submitJob(params2, completeCallback, statusCallback, function(error){
alert(error);
esri.hide(loading)
});
}
Thank you for your continued help. I know I'm so close to getting this working but somethings not quite right.