Passing Parameters in Network Service

1614
3
11-12-2011 04:11 AM
tommykurniawan
New Contributor
Hi All,

I have problem on passing attribute parameters in network service,
Refer to REST info like this :
----------------------
Network Layer: Define_Standby_Areas
Layer Type: esriNAServerServiceAreaLayer
Impedance: TravelTime
Restrictions: vGroup
Accumulate Attribute Names:
Attribute Parameter Values:
    Attribute Name: TravelTime
    Parameter Name: vSpeed
    Parameter Value: 15
------------------------

I try to pass some value for traveltime.vspeed ( for example default value 15 )

-------------------------------
   private var Apv:Array = new Array([{AttributeName: "TravelTime",
    ParameterName: "vSpeed",
    ParameterValue: 15}]);
  ]]>
</fx:Script>

<fx:Declarations>
  <esri:ServiceAreaTask id="saTask"
    concurrency="last"
    fault="faultHandler(event)"
    requestTimeout="30"
    showBusyCursor="true"
    solveComplete="solveCompleteHandler(event)"
  url="http://server/ArcGIS/rest/services/VRN_ND2/NAServer/Define_Standby_Areas"/>
 
  <!--attributeParameterValues="{['TravelTime','vSpeed',15]}"-->
  <!--attributeParameterValues="{['TravelTime','vSpeed','15']}"-->
 
  <esri:ServiceAreaParameters id="saParams"
    attributeParameterValues="{[Apv]}"
    defaultBreaks="{[30]}"
    outSpatialReference="{myMap.spatialReference}"
-----------------------

I already try several methods, and still not applicable.
Could someone give advice for this ?

Thanks,
Tags (2)
0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Tommy,

  This is not tested:

        <esri:ServiceAreaParameters id="saParams" defaultBreaks="{[30]}" outSpatialReference="{map.spatialReference}">
            <esri:attributeParameterValues>
                <esri:AttributeParameterValue attributeName="TravelTime" parameterName="vSpeed" parameterValue="15" />
            </esri:attributeParameterValues>
        </esri:ServiceAreaParameters>
0 Kudos
tommykurniawan
New Contributor
Hi Robert,

I put in complete code like this
  <esri:ServiceAreaParameters id="saParams"   
   defaultBreaks="{[30]}"
   outSpatialReference="{myMap.spatialReference}"
   outputPolygons="esriNAOutputPolygonDetailed"
   returnFacilities="false"
   splitPolygonsAtBreaks="false">
   <esri:attributeParameterValues>
    <esri:AttributeParameterValue attributeName="TravelTime" parameterName="vSpeed" parameterValue="15" />
   </esri:attributeParameterValues>
  </esri:ServiceAreaParameters>


Flash Builder pass it, and flash player debugger pass it,
but the error comes out like this
-----------
Service Area Error 400
Unable to complete  operation.
'attributeParameterValues' parameter is invalid
----------

Parameters could not be transfered to the services.
I should try other way.

Anyway Thank You for this reply.
0 Kudos
tommykurniawan
New Contributor
Just for sharing,
The solution is, by putting action script code
----
  var attparamsval:AttributeParameterValue = new AttributeParameterValue();
  attparamsval.attributeName = "TravelTime";
  attparamsval.parameterName = "vSpeed";
  attparamsval.parameterValue = "16";

  var attrParamVal:Array = new Array();
  attrParamVal.push(attparamsval);
  saParams.attributeParameterValues = attrParamVal;
----

Thanks
0 Kudos