POST
|
thank you Dasa, I had already found that example and am trying to use it to create mine. The thing I did not know about until now was the Geometry service. That makes A LOT of sense and hopefully I can now put this problem behind me. I will let everyone know. Again thanks to everyone who responded and if you should think of anything else, please let me know.
... View more
12-17-2010
04:56 AM
|
0
|
0
|
252
|
POST
|
Sorry about the duplication but I didn't see the original so I thought it didn't get posted. Again sorry for the duplication.
... View more
12-15-2010
05:34 AM
|
0
|
0
|
148
|
POST
|
Robert, Thanks for the quick response. This is easy for you to say but I am pretty much a newbee at this and have been working on this particular problem for a very long time. I work on it a while and then go on to something else, then come back to it for a while and so on and so on. Could you point me to an example of performing a selection by area or polygon. That is my first real issue and then I will go onto merging two selected featuresets together. I really hate bothering people with something that to me should be so very simple but everytime I look at it I go into a brain freeze... brrrrrrrrrrrrrrrrrrrrrrr 🙂 Again thanks
... View more
12-15-2010
05:32 AM
|
0
|
0
|
252
|
POST
|
Morning all, I thought I posted this yesterday but when I checked I couldn't find it so I will try again. I have 3 layers in a map service. One is point, one is line, and the third is polygons. The model takes a county name (polygon) and then selects all the points that are within that area and writes the results out to a dbf. It then selects all the lines in the selected area and writes them out to a dbf. Finally it merges the two dbf's. Once I had the model working I created a GP service. Now I am trying to incorrpoate all of this into a mapping application I am writing in Flash 4. I have been working on this for quite a long while with no luck thus far and with the exception of the "Query using GP results" sample I have not been able to find anything out there showing me how to perform this task. I would greatly appriciate any help any of you might be able to give me with this. Thanks Richard Krell Senior Analyst Chicago Metropolitan Agency for Planning
... View more
12-15-2010
05:12 AM
|
0
|
2
|
853
|
POST
|
Hi all, Hope it's warmer where you are then it is here in Chicago today. Anyway I have been struggling with a problem for a very long time now and I have decided to ask the experts if they can help me. I created a model in ArcGIS Desktop that when ran asks me to pick a county name from a dropdown box. Then based on that the county chosen it goes into two other layers (one a point and one a line) and chooses everything within the county. Now it takes it out to a dbf and once the two have been ran it merges them into one dbf. It is working fine in Desktop and now I am trying to get it to work in our Flex app. I want to select a county from a combobox in the Flex app and then have it run the model and return with the dbf and populate the datagrid with the results and at the same time highlight all the graphical features in the map that were identified by the model. I hope I have expained this well enough. If not let me know and I will try to do better. Thanks Richard Krell Senior Analyst Chicago Metropolitan Agency for Planning
... View more
12-14-2010
11:33 AM
|
0
|
4
|
597
|
POST
|
Matthew, I was reading this thread and like you I am new at this and was wondering if you could pass on the code that you wrote that resolved this issue. Thanks in advanne Richard Krell
... View more
11-22-2010
05:25 AM
|
0
|
0
|
126
|
POST
|
Thaks Robert, I was just in the process of re-writing the code into 3. Yes, I am part of the crossdomain.
... View more
09-02-2010
08:47 AM
|
0
|
0
|
379
|
POST
|
Is this code written in Flash 4 or Flex 3.6 because although we are due for upgrading we are still working in 3.6? Ok, sorry. I got confused reading your earlier posts. Looking at what you have, you actually want to use a WebService, not an HTTPService. You'd use a WebService to send requests to a function and get results. An HTTPService would be used to load something like an XML or Text file. Here is an example of using a WebService with your service. Don't worry about converting to XML unless that's your thing.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955"
minHeight="600"
applicationComplete="init()">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.soap.mxml.WebService;
protected var service:WebService;
protected function init():void {
service = new WebService();
service.showBusyCursor = true;
service.wsdl = "http://data.cmap.illinois.gov/ws/tip/tipservice.asmx?wsdl";
service.addEventListener(ResultEvent.RESULT, onResultsLoaded_handler);
service.addEventListener(FaultEvent.FAULT, onFault_handler);
service.loadWSDL();
}
protected function onFault_handler(event:FaultEvent):void {
Alert.show("Error in calling service: " + event.message, "Error");
}
protected function onResultsLoaded_handler(event:ResultEvent):void {
try {
dgResults.dataProvider = event.result as ArrayCollection;
}
catch (e:Error) {
Alert.show("An error occurred loading results: " + e.message, "Results error");
}
}
protected function btnRequest_clickHandler(event:MouseEvent):void {
service.getproject(input.text);
}
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout gap="5"
horizontalAlign="center"
paddingTop="25" />
</s:layout>
<s:TextInput id="input"
width="200" />
<s:Button id="btnRequest"
label="Send Request"
width="200"
click="btnRequest_clickHandler(event)" />
<mx:DataGrid id="dgResults"
width="800"
height="300" />
</s:Application>
Now as far as how this relates to the example you linked in your first post, the above will get you the ArrayCollection of results you were looking for in your first post. Now you can use those results to create a "where" query on your map service.
... View more
09-02-2010
07:05 AM
|
0
|
0
|
379
|
POST
|
Thanks for the latest response and believe me I will look at it. I spent last evening working on this and I came up with something different. I am also attaching the file and the actionscript class file. Again, unfortunetly these are examples I found as I was researching this. I know it is probably that I have been working on this for so long that it has become so hard but I really do appriciate everyone's help.
... View more
09-02-2010
07:03 AM
|
0
|
0
|
379
|
POST
|
Robert, To be honest I am getting confused and that is probably my biggest problem. I took some code as I mentioned in the beginning that was using the querytask and now I am trying to re-write it to use HTTPservice. I have always had problems with this and I don't know why. I have done apps in VB, Avenue, and many others for years but this Flex for some reason has me tearing my hair out. So yes I am trying to use HTTPservice to retrieve these records. I know the webservice is OK because I have been using it. You can try it if you want and just enter a ID 01-06-0068. I will return one record.
... View more
09-01-2010
11:45 AM
|
0
|
0
|
379
|
POST
|
I am trying to retrieve the information from a SQL database via a HTTPservice not through the featureset.
... View more
09-01-2010
08:29 AM
|
0
|
0
|
427
|
POST
|
I started this thread the other day in an attempt to resolve a coding problem I am having and received some really good answers. But after being deverted for a day on another project I am back and hate to keep being such a bother but I am truely over my perverbial head. Below is the funtion I am trying to get working but I keep getting an error 1034 telling me I cannot covert a featureset into an resultevent. I believe I understand the error but don't understand where it is coming from.
//*************************************************************************
public function runQueryTask(geometry:Geometry):void {
//*************************************************************************
[INDENT]
var queryTask:QueryTask = new QueryTask();
queryTask.url = "http://data.cmap.illinois.gov/ArcGIS/rest/services/Maps/TIP_Test/MapServer/0";
[LEFT]var query:Query = new Query();
query.geometry = geometry;
[LEFT]query.returnGeometry = true;
query.spatialRelationship = "esriSpatialRelContains";
query.outFields = ['PROID','PROGRAMMIN','COMPLETION'];[/LEFT]
[/LEFT]
queryTask.execute(query, new AsyncResponder(onXMLResult, onFault));
function onXMLResult(event:ResultEvent, token:Object=null):void{
[INDENT]
//xml = event.result.ArrayOfTipproject.tipproject;
[LEFT]var xmlListCollection:XMLListCollection = new XMLListCollection;
xmlListCollection.source = new XMLList(event.result.ArrayOfTipproject.tipproject);
[LEFT]var items:Array = [];
foreach(var queryXML:XML in xmlListCollection){[/LEFT]
[/LEFT]
[INDENT]
var obj:Object = {
project:queryXML.@PROID,
agency:queryXML.@PROGRAMMIN
[/INDENT]}
[/INDENT]}
items.push(obj);
[/INDENT]}
... View more
09-01-2010
07:34 AM
|
0
|
0
|
427
|
POST
|
A little more info. Here is what I am working with right now trying to get it working. function onXMLResult(event:ResultEvent, featureSet:FeatureSet, token:Object = null😞void{ for(var i:uint = 0; i < featureSet.features.length; i++){ xml = event.result.ArrayOfTipproject.tipproject; } dgrid1.dataProvider = xml; } Needless to say, it is not working but I have just written it and am working through the errors.
... View more
08-30-2010
12:28 PM
|
0
|
0
|
427
|
POST
|
I appriciate everyone's response and I guess I haven't explained myself. The progblem is not the service call. As I said that is working fine. Where I am having problems is creating an ArrayCollection that will populate my grid with all the records that have been selected. thanks Richard Krell Chicago Metropolitian Agency for Planning.
... View more
08-30-2010
12:25 PM
|
0
|
0
|
427
|
POST
|
I am using code provided from the Code Gallery http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=codeGalleryDetails&scriptID=15872 to try and populate a datagrid with data obtained in a HTTPservice. The webservice was written by me and works fine. I have used it in other applications. the code I am using on the HTTPserice is as follows: <mx:HTTPService id="hsID" url="http://data.cmap.illinois.gov/ws/tip/tipservice.asmx/getproject" showBusyCursor="true" requestTimeout="120" useProxy="false"/> I know I need to take the results and create a ArrayCollection but I am having problems figuring out the correct code so it will iterate through the selected points and return the data to the datagrid. Any assistance would be greatly appriciated. Thanks Richard Krell Chicago Metropolitan Agency for Planning
... View more
08-30-2010
11:18 AM
|
0
|
16
|
1279
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|