Thanks for your help, I think I'm getting close now.Here is the code I am using:After I click the download button on my cart I get an Error message saying:Error: esri.config.defaults.io.proxyUrl is not setI've googled this and looked for help but I'm not sure how to get around this and what causes it.Any ideas?
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]), 1); 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); cartstuff.push(graphic); break; case "polyline": graphic.setSymbol(fLineSymbol); cartstuff.push(graphic); break; case "polygon": graphic.setSymbol(fPolygonSymbol); break; } map.graphics.add(graphic); }); }; function doFind(text) { params.searchText = text; find.execute(params, showTResults); } function download(){ var clipLayers = []; var seismicCount = (jQuery("#selectedSeismicTable").getGridParam("reccount")); var wellCount = (jQuery("#selectedSWellTable").getGridParam("reccount")); if (seismicCount > 0) { clipLayers.push('2D Seismic'); for (i = 1; i < seismicCount + 1; i++) { var ref = $('#selectedSeismicTable').getCell(i, 1); doFind(ref); } }; if ((jQuery("#selectedRPTable").getGridParam("reccount")) > 0) { clipLayers.push('Regional Profiles'); }; if ((jQuery("#selectedWellTable").getGridParam("reccount")) > 0) { clipLayers.push('Wells'); for (i = 1; i < wellCount + 1; i++) { var ref = $('#selectedWellTable').getCell(i, 1); //alert(ref); doFind(ref); } }; var clipFeatureSet = new esri.tasks.FeatureSet(); clipFeatureSet.features = cartstuff; var params = { "Layers_to_Clip": clipLayers, "Area_of_Interest": clipFeatureSet, "Feature_Format": "Shapefile - SHP - .shp" } gp.submitJob(params, completeCallback, statusCallback, function(error){ alert(error); }); } function completeCallback(jobInfo){ if(jobInfo.jobStatus !== "esriJobFailed"){ gp.getResultData(jobInfo.jobId,"Output_Zip_File", downloadFile); } } function statusCallback(jobInfo) { var status = jobInfo.jobStatus; if(status === "esriJobFailed"){ alert(status); } else if (status === "esriJobSucceeded"){ } } function downloadFile(outputFile){ map.graphics.clear(); var theurl = outputFile.value.url; window.location = theurl; }
Hzhu,Thank you for you prompt response. I tried something similar to this but I only want the lines that the user has selected and not others around in and around them, is there a way that I can remove the unwanted lines from the selection, without the process being too time consuming? As I have over 8000 lines and the cart only has a capacity of 25 lines.Hopefully this makes sense and you can help me further.Many thanks,Ben
Hello,I am trying to create a variation of the 'Clip and Ship' Extract Data task that instead of having an AOI being passed in the params has a list of the Unique Feature Values.The idea behind what I am try to do is to implement and kind of cart system where users add lines to the cart (JQuery table) from over a wide geographic area and then when they have collected all of the lines they are interested in, they simply click download and the Extract Data Geoprocessing Task runs on the server and clips and ships a zip file containing a shapefile of the lines they had in the cart.Can anyone give me any ideas as to how to edit the python script or the Extract Data model to allow this?Many thanks,Ben Sayers
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.