Select to view content in your preferred language

[RPC Fault faultString="" faultCode="400" faultDetail="Invalid URL"]   error

2232
1
12-10-2012 01:27 AM
shaabanalqassas
Deactivated User
please

this is my code




 
   public var value:String;
   private function findWells(event:MapMouseEvent):void
   {
    // find wells near the mouse click
    var tol:Number = myMap.extent.width / myMap.width * 5;
    var x:Number = event.mapPoint.x;
    var y:Number = event.mapPoint.y;
    var queryExtent:Extent = new Extent(x - tol, y - tol, x + tol, y + tol, event.mapPoint.spatialReference);
    var thisSelectionQuery:Query = new Query();
    thisSelectionQuery.geometry = queryExtent;
    wellsLayer.selectFeatures(thisSelectionQuery, FeatureLayer.SELECTION_NEW);
   }
  
   private function wellsLayer_selectionCompleteHandler(event:FeatureLayerEvent):void
   {
    relatedDatagrid.dataProvider = null;
    // check the first return feature to see if it has any related features
    if (event.features.length > 0)
    {
     relatedTopsQuery.objectIds = [ event.features[0].attributes.Object_ID ];
     wellsLayer.queryRelatedFeatures(relatedTopsQuery, new AsyncResponder(onResult, onFault));
     function onResult(relatedRecords:Object, token:Object = null):void
     {
      // get related records for the first feature
      var fset:FeatureSet = (relatedRecords[event.features[0].attributes.Object_ID]);
      if (fset is FeatureSet)
      {
       relatedDatagrid.dataProvider = fset.attributes;
      }
      else
      {
       Alert.show("No related records for well #" + event.features[0].attributes.Object_ID, "No related records");
      }
     }
     function onFault(info:Object, token:Object = null):void
     {
      myMap.infoWindow.hide();
      Alert.show(info.toString(), "queryRelatedFeatures Problem");
     }
    }
    else
    {
     myMap.infoWindow.hide();
    
    }
   }
  
  
  


 
</fx:Declarations>





<s:Image y="0" left="0" right="0" height="50" scaleMode="stretch"
    source="assets/TitleBanner.jpg"/>






<esri:Map id="myMap" left="0" top="54" bottom="82" width="85%" clickRecenterEnabled="true"
     keyboardNavigationEnabled="true" logoVisible="false" mapNavigationEnabled="true"
     openHandCursorVisible="false" mapClick="findWells(event)">
 
 
  <esri:infoWindowContent>
   <mx:TextArea id="myTextArea"
       width="250" height="75"/>
  </esri:infoWindowContent>

 
  <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>

  <esri:ArcGISDynamicMapServiceLayer   url="http://it9/ArcGIS/rest/services/Election/MapServer"/>
 
 
  
   <esri:infoWindowRenderer>
    <fx:Component>
     <esri:LabelDataRenderer>
      <esri:layout>
       <s:VerticalLayout/>
      </esri:layout>
      <esri:label>Well ID {data.Object_ID}</esri:label>
      <s:Label text="Plug date: {data.election_gov ? new Date(data.election_gov) : 'No date available'}"/>
      <s:Label text="Completion: {data.voit_circle ? new Date(data.voit_circle) : 'No date available'}"/>
     </esri:LabelDataRenderer>
    </fx:Component>
   </esri:infoWindowRenderer>
  </esri:FeatureLayer>
 
  <esri:FeatureLayer id="fLayer1"
         mode="snapshot"
         outFields="*"
         url="http://it9/ArcGIS/rest/services/Election/MapServer/3">
   <esri:symbol>
    <esri:SimpleFillSymbol id="fillsym" style="null">
     <esri:SimpleLineSymbol width="3" color="0xFF0000"/>
    </esri:SimpleFillSymbol>
   </esri:symbol>
   <esri:infoWindowRenderer>
    <fx:Component>
     <mx:VBox backgroundColor="0xffffff"
        color="0x444444"
        label="{data.GOV_A}">
      <mx:Label text="{data.election_circle}"/>
     
     
     </mx:VBox>
    </fx:Component>
   </esri:infoWindowRenderer>
  </esri:FeatureLayer>

 
   <esri:symbol>
    <esri:SimpleFillSymbol id="fillsym1" style="null">
     <esri:SimpleLineSymbol width="3" color="0xFF0000"/>
    </esri:SimpleFillSymbol>
   </esri:symbol>
   <esri:infoWindowRenderer>
    <fx:Component>
     <mx:VBox backgroundColor="0xffffff"
        color="0x444444"
        label="{data.Gov_NA}">
      <mx:Label text="{data.Gov_Englis}"/>
     
     
     </mx:VBox>
    </fx:Component>
   </esri:infoWindowRenderer>
  </esri:FeatureLayer>
 
 
  <!-- <esri:FeatureLayer id="fLayer" 
        
        
         graphicAdd="fLayer_graphicAddHandler(event)"
         mode="snapshot"
         outFields="*"
         symbol="{defaultsym}"
         url="http://it9/ArcGIS/rest/services/Election/MapServer/3"/> -->

 
 
 
 
 
  <esri:extent>
  
  
  <esri:Extent xmin="-20037507.2295943" ymin="-19971868.8804086" xmax="20037507.2295943" ymax="19971868.8804086">
    <esri:SpatialReference wkid="102100"/>
   </esri:Extent>
  </esri:extent>
 


  </esri:Map>
<s:Panel right="0" bottom="0" width="100%" height="79" styleName="Panel"
    title="??????????? ???????????">
</s:Panel>

<s:Panel y="267" right="0" width="202" height="210" title="??????? ??????????">
 
  <mx:DataGrid id="resultsGrid" visible="{queryTask3.executeLastResult != null}" width="100%"
      height="100%" dataProvider="{queryTask3.executeLastResult.attributes}">
   <mx:columns>
    <mx:DataGridColumn width="50" dataField="internet" headerText="????????"/>
    <mx:DataGridColumn width="93" dataField="cinter_name" headerText="???? ?????????"/>
    <mx:DataGridColumn width="30" dataField="national_id" headerText="???????? ??????????"/>
  
   </mx:columns>
  </mx:DataGrid>
  <s:Panel visible="true" x="0" y="10" width="212" height="153" title="??????">
   <mx:DataGrid id="relatedDatagrid" x="6" y="3" width="174" height="107">
    <mx:columns>
     <mx:DataGridColumn dataField="Object_ID" headerText="ID"/>    
     <mx:DataGridColumn dataField="ELV" headerText="Elevation"/>
     <mx:DataGridColumn dataField="cinter_name" headerText="Formation"/>
     <mx:DataGridColumn dataField="national_id" headerText="Top"/>
    </mx:columns>
   </mx:DataGrid>
  </s:Panel>
 

</s:Panel>



</mx:Application>
Tags (2)
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus
Shaaban,

   There is so much missing and screwed up in the code you posted I can not tell where your issue is... Where is relatedTopsQuery and wellLayer variables in your code? Why do you have several FeatureLayer ending elements with out matching opening FeatureLayer elements? You have an fx:Declarations ending element and no opening element... And many other questions.
0 Kudos