i makes a model called Interoplation which used idw and contour tool. of course i hava changed the input type featureclass to feature dataset; and i published it to arcgis server; but i can not use it. this is the code, it will throw an error which is called the error cannot catched. it says "throw "Could not load cross-domain resources: "" gp = new esri.tasks.Geoprocessor("http://172.17.70.2/ArcGIS/rest/services/Interoplation/GPServer/Interoplation"); gp.setOutputSpatialReference({ "wkid": 4610 }); esriConfig.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx"; esriConfig.defaults.io.alwaysUseProxy = false; var pt1 = new esri.geometry.Point(120, 30, new esri.SpatialReference({ wkid: 4610 })); var pt2 = new esri.geometry.Point(120, 30.01, new esri.SpatialReference({ wkid: 4610 })); var pt3 = new esri.geometry.Point(120.01, 30, new esri.SpatialReference({ wkid: 4610 })); var arr1 = { "value": 5 }; var arr2 = { "value": 20 }; var arr3 = { "value": 18 }; // var gr1 = new esri.Graphic(pt1, "", arr1, ""); // var gr2 = new esri.Graphic(pt2, "", arr2, ""); // var gr3 = new esri.Graphic(pt3, "", arr3, "");
var gr1 = new esri.Graphic(pt1); var gr2 = new esri.Graphic(pt2); var gr3 = new esri.Graphic(pt3); var features = []; features.push(gr1); features.push(gr2); features.push(gr3); var featureSet = new esri.tasks.FeatureSet(); featureSet.features = features; var params = {"Input_point_features":featureSet,"Z_value_field":"Id","Contour_interval":5};
gp.execute(params);
dojo.connect(gp, "onExecuteComplete", function (results, messages) { var feature = results[0].value.features[0]; var symbol = new esri.symbol.SimpleFillSymbol("none", new esri.symbol.SimpleLineSymbol("dashdot", new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.25])); feature.setSymbol(symbol); map.graphics.add(feature);
i also use url to access the service, and also failed; it's parameter is Input_point_features ,Z_value_field,Contour_interval;i pass the values is {"geometryType":"esriGeometryPoint","spatialReference":{"wkid":4610},"features":[{"geometry":{"x":120,"y":30},"attributes":{"Id":50}},{"geometry":{"x":119.556105,"y":26.826634},"attributes":{"Id":70}},{"geometry":{"x":122.71363,"y":25.750527},"attributes":{"Id":34}},{"geometry":{"x":123.492391,"y":28.143449},"attributes":{"Id":2}},{"geometry":{"x":124.483543,"y":30.196548},"attributes":{"Id":12}},{"geometry":{"x":124.483543,"y":30.196548},"attributes":{"Id":12}},{"geometry":{"x":124.483543,"y":30.196548},"attributes":{"Id":12}},{"geometry":{"x":125.403897,"y":26.6992},"attributes":{"Id":45}},{"geometry":{"x":118.862299,"y":32.405399},"attributes":{"Id":9}},{"geometry":{"x":115.704775,"y":29.828406},"attributes":{"Id":42}},{"geometry":{"x":115.379111,"y":27.888581},"attributes":{"Id":34}},{"geometry":{"x":114.104773,"y":30.904513},"attributes":{"Id":23}},{"geometry":{"x":114.019818,"y":32.830178},"attributes":{"Id":45}},{"geometry":{"x":114.019818,"y":32.830178},"attributes":{"Id":45}},{"geometry":{"x":120.377345,"y":33.283276},"attributes":{"Id":42}},{"geometry":{"x":125.134871,"y":34.472657},"attributes":{"Id":2}},{"geometry":{"x":121.779116,"y":35.053189},"attributes":{"Id":45}}]}; Id; 5; and it returns error ,code 500.