|
POST
|
Hi Guys, i download the flexviewer widget to export shape file. Now i have any map service, all are enabled the export operation, but the widget don't work;don't see my widget. Any ideas? I hav to set the config file of widget with the "url" of my map service? Thanks
... View more
07-12-2011
07:15 AM
|
0
|
0
|
442
|
|
POST
|
hy guys i have to help. I have more problems to get results from submitJob for my Asynchronous GP that i configured in a custom widget of FlexViewer. I post here a code with URL of my GP Service so if you want to see and try it
<fx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.SpatialReference;
import com.esri.ags.events.GeoprocessorEvent;
import com.esri.ags.events.GraphicsLayerEvent;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.symbols.SimpleFillSymbol;
import com.esri.ags.symbols.SimpleLineSymbol;
import com.esri.ags.symbols.SimpleMarkerSymbol;
import com.esri.ags.tasks.Geoprocessor;
import com.esri.ags.tasks.supportClasses.ParameterValue;
import mx.controls.Alert;
import mx.rpc.AsyncResponder;
import mx.rpc.events.FaultEvent;
private function startGeoProcess(event:MouseEvent):void
{
var parms:Object = new Object();
parms.valore = String(numberOfDays.text);
var geoprocessTask:Geoprocessor = new Geoprocessor();
geoprocessTask.outSpatialReference = map.spatialReference;
geoprocessTask.showBusyCursor = true;
geoprocessTask.url = "http://193.204.163.134/ArcGIS/rest/services/ENEA_Sondaggi_iniziali/Ricerca_Lito_Carg/GPServer/RicercaCarg";
geoprocessTask.useAMF = false;
geoprocessTask.submitJob(parms);
geoprocessTask.addEventListener(GeoprocessorEvent.JOB_COMPLETE, onJobComplete);
}
private function onFault(fe:FaultEvent, token:Object = null):void
{
Alert.show(fe.toString());
}
private function onJobComplete(event:GeoprocessorEvent):void
{
var geoprocessTask:Geoprocessor = new Geoprocessor();
geoprocessTask.addEventListener(GeoprocessorEvent.GET_RESULT_DATA_COMPLETE, onGetResult);
geoprocessTask.getResultData(event.jobInfo.jobId, "jd26fbe9c6f97470592e698b05067865e");
}
private function onGetResult(event:GeoprocessorEvent):void
{
var myGraphicsLayer:GraphicsLayer = new GraphicsLayer();
var myPointSymbol:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, 0x1AA1D3, 0.2);
var pv:ParameterValue = event.parameterValue;
var fs:FeatureSet = pv.value as FeatureSet;
for each(var graphic:Graphic in fs.features)
{
myGraphicsLayer.add(graphic);
graphic.symbol = myPointSymbol;
graphicsLayer.add(graphic);
map.addLayer(graphicsLayer);
}
}
]]>
</fx:Script>
<fx:Declarations>
<esri:GraphicsLayer id="graphicsLayer"/>
</fx:Declarations>
<viewer:WidgetTemplate id="helloWorld"
width="351" height="170">
<s:Label text="RICERCA LITOLOGIA INTERPRETATA SECONDO VDI" y="10" horizontalCenter="0"/>
<s:TextInput id="numberOfDays"
width="228"
paddingLeft="0"
paddingRight="0"
text="'SABBIA SATURA'" horizontalCenter="0" textAlign="center" y="50"/>
<s:Label text="inserisci litologia" y="30" horizontalCenter="0"/>
<s:Button
label="Ricerca"
click="startGeoProcess(event)"
bottom="5" left="10" cornerRadius="7"/>
<s:Button
label="Clear"
click="graphicsLayer.clear()"
bottom="5" right="9" cornerRadius="7"/>
</viewer:WidgetTemplate>
</viewer:BaseWidget>
Robert Scheitlin say me that my result is a Image but i don't try to configure the script for the result. Please help me it's very important
... View more
07-09-2011
02:07 AM
|
0
|
1
|
821
|
|
POST
|
hi bjorn my GP Service is Synchronous and this is the script that i wrote for call him in FlexViewer
<fx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.SpatialReference;
import com.esri.ags.events.GeoprocessorEvent;
import com.esri.ags.events.GraphicsLayerEvent;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.symbols.SimpleFillSymbol;
import com.esri.ags.symbols.SimpleLineSymbol;
import com.esri.ags.symbols.SimpleMarkerSymbol;
import com.esri.ags.tasks.Geoprocessor;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
private function startGeoProcess(event:MouseEvent):void
{
var parms:Object = new Object();
parms.Condizione = String(condizione.text);
parms.Valore = Number(valore.text);
var geoprocessTask:Geoprocessor = new Geoprocessor();
geoprocessTask.outSpatialReference = map.spatialReference;
geoprocessTask.showBusyCursor = true;
geoprocessTask.url = "http://193.204.163.134/ArcGIS/rest/services/Peso_di_Volume_Medio/GPServer/PesodiVolumeMedio";
geoprocessTask.useAMF = false;
geoprocessTask.execute(parms);
geoprocessTask.addEventListener(GeoprocessorEvent.EXECUTE_COMPLETE, executeCompleteHandler);
geoprocessTask.addEventListener(FaultEvent.FAULT, faultHandler);
}
private function executeCompleteHandler(event:GeoprocessorEvent):void
{
var myPointSymbol:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, 0x1AA1D3, 0.2);
for each (var graphic:Graphic in event.executeResult.results[0].value.features)
{
graphic.symbol = myPointSymbol;
graphicsLayer.add(graphic);
map.addLayer(graphicsLayer);
}
}
private function faultHandler(event:FaultEvent):void
{
if (event.type == "fault"
&& event.fault.name == 'Error'
&& event.fault.faultCode == '500'
&& event.fault.faultString == 'Error Executing Task')
{
Alert.show("Oops - no results. Try clicking in an ocean...");
}
else
{
Alert.show("Unexpected fault:\n" + event.toString());
}
}
]]>
</fx:Script>
And it's ok if the model responds immediately. I tried to write this code for Asynchronus property. And i changed the script with geoprocessTask.submitJob(parms); and geoprocessTask.addEventListener(GeoprocessorEvent.JOB_COMPLETE, executeCompleteHandler); But in this way the widget don't give me a graphic response. Why Bjorn? Where is the error? Please Help me
... View more
07-08-2011
04:03 AM
|
0
|
0
|
402
|
|
POST
|
Hy guys i have a GP Service that takes more time to run. And so i must set i time limit or timeout in flex compiler i wrote this in flex compiler
Additional Compiler Argument:
-locale en_US -source-path=locale/{locale} -keep-all-type-selectors=true -default-script-limits 5000 6000
but when i run my gp i Flex Viewer App. i have always the error that ShackWave Flash not respond what i do to set the time out of Flex Viewer App.? or i have to set a time out for the widget that call the GP Service? Help please
... View more
07-06-2011
12:58 PM
|
0
|
3
|
1020
|
|
POST
|
I have another question. How to change the timeout of flash player for the FlexViewer App, in Flash Builder 4? thanks please help
... View more
07-06-2011
07:54 AM
|
0
|
0
|
334
|
|
POST
|
Ivan also my english it's so poor My GP Service support submitJob! and when i run the GP in REST he works very well. But in Flex Viewer the model works but don't give me a graphic symbol that i set in my code. This is the code
<fx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.SpatialReference;
import com.esri.ags.events.GeoprocessorEvent;
import com.esri.ags.events.GraphicsLayerEvent;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.symbols.SimpleFillSymbol;
import com.esri.ags.symbols.SimpleLineSymbol;
import com.esri.ags.symbols.SimpleMarkerSymbol;
import com.esri.ags.tasks.Geoprocessor;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
private function startGeoProcess(event:MouseEvent):void
{
var parms:Object = new Object();
parms.Condizione = String(condizione.text);
parms.Valore = Number(valore.text);
var geoprocessTask:Geoprocessor = new Geoprocessor();
geoprocessTask.outSpatialReference = map.spatialReference;
geoprocessTask.showBusyCursor = true;
geoprocessTask.url = "http://193.204.163.134/ArcGIS/rest/services/ENEA/Cap_Term_Vol_MAX/GPServer/CapTermVolMAX";
geoprocessTask.useAMF = false;
geoprocessTask.submitJob(parms);
geoprocessTask.addEventListener(GeoprocessorEvent.JOB_COMPLETE, executeCompleteHandler);
geoprocessTask.addEventListener(FaultEvent.FAULT, faultHandler);
}
private function executeCompleteHandler(event:GeoprocessorEvent):void
{
var myPointSymbol:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, 0x1AA1D3, 0.2);
for each (var graphic:Graphic in event.executeResult.results[0].value.features)
{
graphic.symbol = myPointSymbol;
graphicsLayer.add(graphic);
map.addLayer(graphicsLayer);
}
}
private function faultHandler(event:FaultEvent):void
{
if (event.type == "fault"
&& event.fault.name == 'Error'
&& event.fault.faultCode == '500'
&& event.fault.faultString == 'Error Executing Task')
{
Alert.show("Oops - no results. Try clicking in an ocean...");
}
else
{
Alert.show("Unexpected fault:\n" + event.toString());
}
}
]]>
</fx:Script>
Why don't give me a graphic result?
Do you see any error in my code?
... View more
07-06-2011
07:46 AM
|
0
|
0
|
327
|
|
POST
|
Hi guys i develop a FlexViewer App. and i customized it with any GP Service. GP Service are Syncronous but 2 of those takes to much time to run and when i run those after 60s the browser give me a error: Plug-in ShockWave Flash not respond How to change the timeout Flash for my Application? Help is urget Thanks guys I have another question. How to change the timeout of flash player for the FlexViewer App, in Flash Builder 4? thanks please help
... View more
07-06-2011
05:46 AM
|
0
|
1
|
695
|
|
POST
|
hi Ivan I followed the instructions of "ykchin" but the model don't get me a result.
private function startGeoProcess(event:MouseEvent):void
{
var parms:Object = new Object();
parms.Condizione = String(condizione.text);
parms.Valore = Number(valore.text);
var geoprocessTask:Geoprocessor = new Geoprocessor();
geoprocessTask.outSpatialReference = map.spatialReference;
geoprocessTask.showBusyCursor = true;
geoprocessTask.url = "http://193.204.163.134/ArcGIS/rest/services/ENEA/Cap_Term_Vol_MAX/GPServer/CapTermVolMAX";
geoprocessTask.useAMF = false;
geoprocessTask.submitJob(parms);
geoprocessTask.addEventListener(GeoprocessorEvent.JOB_COMPLETE, executeCompleteHandler);
geoprocessTask.addEventListener(FaultEvent.FAULT, faultHandler);
}
private function executeCompleteHandler(event:GeoprocessorEvent):void
{
var myPointSymbol:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, 0x1AA1D3, 0.2);
for each (var graphic:Graphic in event.executeResult.results[0].value.features)
{
graphic.symbol = myPointSymbol;
graphicsLayer.add(graphic);
map.addLayer(graphicsLayer);
}
}
private function faultHandler(event:FaultEvent):void
{
if (event.type == "fault"
&& event.fault.name == 'Error'
&& event.fault.faultCode == '500'
&& event.fault.faultString == 'Error Executing Task')
{
Alert.show("Oops - no results. Try clicking in an ocean...");
}
else
{
Alert.show("Unexpected fault:\n" + event.toString());
}
}
In your opinion is there a error? With Synchronous model and the original code that i post, i have a result. But the model takes a long time to run and after 2 mitutes in my application i have a worning by plug-in of ShockWave Flash, because because it's been a long time. What do you think? Help
... View more
07-06-2011
05:09 AM
|
0
|
0
|
1846
|
|
POST
|
Hi Ivan, thanks. Now i try the code that you give me and after i say you if it works good thanks
... View more
07-06-2011
01:55 AM
|
0
|
0
|
1846
|
|
POST
|
can you give me a link for download the DataExtractWidget? thanks
... View more
07-06-2011
12:49 AM
|
0
|
0
|
1846
|
|
POST
|
hi in my service you don't see submitJob because i set it Synchronous. When i tried with submitJob i change the service property. I try with your help and after i will wrote for the responce Thanks
... View more
07-06-2011
12:23 AM
|
0
|
0
|
1846
|
|
POST
|
Hy guys i develop a model ain ArcGis 10 and i publish it as a Map Service with a Tool Layer. The GP Service is Synchronus and he works very well. i need to change the GP Service in Asynchronous but i tried to change my script but don't works. i post here my script for my model synchronus
<?xml version="1.0" encoding="utf-8"?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010 ESRI
//
// All rights reserved under the copyright laws of the United States.
// You may freely redistribute and use this software, with or
// without modification, provided you include the original copyright
// and use restrictions. See use restrictions in the file:
// <install location>/License.txt
//
////////////////////////////////////////////////////////////////////////////////
-->
<viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:esri="http://www.esri.com/2008/ags"
xmlns:viewer="com.esri.viewer.*"
height="192">
<fx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.SpatialReference;
import com.esri.ags.events.GeoprocessorEvent;
import com.esri.ags.events.GraphicsLayerEvent;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.symbols.SimpleFillSymbol;
import com.esri.ags.symbols.SimpleLineSymbol;
import com.esri.ags.symbols.SimpleMarkerSymbol;
import com.esri.ags.tasks.Geoprocessor;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
private function startGeoProcess(event:MouseEvent):void
{
var parms:Object = new Object();
parms.Condizione = String(condizione.text);
parms.Valore = Number(valore.text);
var geoprocessTask:Geoprocessor = new Geoprocessor();
geoprocessTask.outSpatialReference = map.spatialReference;
geoprocessTask.showBusyCursor = true;
geoprocessTask.url = "http://193.204.163.134/ArcGIS/rest/services/ENEA/Cap_Term_Vol_MAX/GPServer/CapTermVolMAX";
geoprocessTask.useAMF = false;
geoprocessTask.execute(parms);
geoprocessTask.addEventListener(GeoprocessorEvent.EXECUTE_COMPLETE, executeCompleteHandler);
geoprocessTask.addEventListener(FaultEvent.FAULT, faultHandler);
}
private function executeCompleteHandler(event:GeoprocessorEvent):void
{
var myPointSymbol:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 12, 0x1AA1D3, 0.3);
for each (var graphic:Graphic in event.executeResult.results[0].value.features)
{
graphic.symbol = myPointSymbol;
graphicsLayer.add(graphic);
map.addLayer(graphicsLayer);
}
}
private function faultHandler(event:FaultEvent):void
{
if (event.type == "fault"
&& event.fault.name == 'Error'
&& event.fault.faultCode == '500'
&& event.fault.faultString == 'Error Executing Task')
{
Alert.show("Oops - no results. Try clicking in an ocean...");
}
else
{
Alert.show("Unexpected fault:\n" + event.toString());
}
}
]]>
</fx:Script>
<fx:Declarations>
<esri:GraphicsLayer id="graphicsLayer"/>
</fx:Declarations>
<viewer:WidgetTemplate id="helloWorld"
width="390" height="192">
<s:Label text="RICERCA CAPACITA' TERMICA MIN" y="10" horizontalCenter="0" color="#000000" fontWeight="bold"/>
<s:TextInput id="condizione"
width="66"
paddingLeft="0"
paddingRight="0"
text=">" y="48" horizontalCenter="0" textAlign="center"/>
<s:Label text="inserisci valore" y="76" horizontalCenter="0"/>
<s:Button
label="Ricerca"
click="startGeoProcess(event)"
bottom="5" left="10" cornerRadius="7"/>
<s:Button
label="Clear"
click="graphicsLayer.clear()"
bottom="5" right="9" cornerRadius="7"/>
<s:TextInput id="valore"
width="66"
paddingLeft="0"
paddingRight="0"
text="2" y="92" horizontalCenter="0" textAlign="center"/>
<s:Label text="inserisci operatore matematico ( > / < )" y="32" horizontalCenter="0"/>
</viewer:WidgetTemplate>
</viewer:BaseWidget>
can anybody tell me how to modify my script for set my GP Service as Asynchronous? help please Thanks
... View more
07-05-2011
07:37 AM
|
0
|
10
|
2620
|
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|