<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Distance between 2 Points in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584701#M13138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Tony,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; What does your code for building the polyline look like?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help Robert!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried creating the polyline many ways and most seem to create one, but here is what I currently have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var schoolMapPoint:MapPoint = findResult.feature.geometry as MapPoint;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var addressMapPoint:MapPoint = parentApplication.addressMapPoint;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var mapPoints:Array = [schoolMapPoint,addressMapPoint];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var polyLine:Polyline = new Polyline([mapPoints]);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lengthsParameters.polylines = [polyLine]; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;geometryService.lengths(lengthsParameters);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Oct 2010 14:03:10 GMT</pubDate>
    <dc:creator>TonyCollins</dc:creator>
    <dc:date>2010-10-12T14:03:10Z</dc:date>
    <item>
      <title>Distance between 2 Points</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584697#M13134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Quite simply, if I have two MapPoints how would I measure the distance between them?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to create a polyline using these points and then call the lengths method on geometry service but the results array is allways empty.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Oct 2010 13:25:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584697#M13134</guid>
      <dc:creator>TonyCollins</dc:creator>
      <dc:date>2010-10-12T13:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between 2 Points</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584698#M13135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Tony,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Look at this sample.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=MeasureDistance"&gt;http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=MeasureDistance&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Oct 2010 13:37:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584698#M13135</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2010-10-12T13:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between 2 Points</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584699#M13136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Tony,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Look at this sample.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=MeasureDistance"&gt;http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=MeasureDistance&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Robert, thanks for the link. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I looked up distance on the API as I figured it would be a common task, but decided I could not use it due to reference to server 10 (very depressing as I have 9.3.1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;STRONG&gt;distance&lt;/STRONG&gt;(distanceParameters:DistanceParameters, responder:IResponder = null):AsyncToken&lt;BR /&gt;The distance operation is performed on a geometry service resource (only available with ArcGIS Server 10.0 or above).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is why I have been trying with a polyline...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Oct 2010 13:49:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584699#M13136</guid>
      <dc:creator>TonyCollins</dc:creator>
      <dc:date>2010-10-12T13:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between 2 Points</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584700#M13137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Tony,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; What does your code for building the polyline look like?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Oct 2010 13:55:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584700#M13137</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2010-10-12T13:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between 2 Points</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584701#M13138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Tony,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; What does your code for building the polyline look like?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help Robert!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried creating the polyline many ways and most seem to create one, but here is what I currently have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var schoolMapPoint:MapPoint = findResult.feature.geometry as MapPoint;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var addressMapPoint:MapPoint = parentApplication.addressMapPoint;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var mapPoints:Array = [schoolMapPoint,addressMapPoint];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var polyLine:Polyline = new Polyline([mapPoints]);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lengthsParameters.polylines = [polyLine]; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;geometryService.lengths(lengthsParameters);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Oct 2010 14:03:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584701#M13138</guid>
      <dc:creator>TonyCollins</dc:creator>
      <dc:date>2010-10-12T14:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between 2 Points</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584702#M13139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hmm... hold up it now looks like I have a result...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Will post back after a little more debugging!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Oct 2010 14:14:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584702#M13139</guid>
      <dc:creator>TonyCollins</dc:creator>
      <dc:date>2010-10-12T14:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Distance between 2 Points</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584703#M13140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Firstly sorry to have wasted your time Robert, but at least this might help someone on 9.3.1 if there are any left!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like my issue was that I was not giving the polyLine a spatialReference (although I'm sure I already tried that). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NOTE: I'm not using any map&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Oct 2010 14:26:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/distance-between-2-points/m-p/584703#M13140</guid>
      <dc:creator>TonyCollins</dc:creator>
      <dc:date>2010-10-12T14:26:56Z</dc:date>
    </item>
  </channel>
</rss>

