<?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: Scalebar API in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/scalebar-api/m-p/653370#M4512</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thank you for your answer. But is there any way to caculate length from point A to point B?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes there is a way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The MapView class has a function toMapPoint(float screenx, float screeny).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could use this function to determine the real distance between two points, and use it to draw a scalebar yourself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;calculating the length itself:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Point strtPoint = mapview.toMapPoint(screenX1, screenY1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Point endPoint = mapview.toMapPoint(screenX2, screenY2);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Line line = new Line();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;line.setStart(strtPoint);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;line.setEnd(endPoint);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;double length = line.calculateLength2D();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Gwen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 May 2012 06:39:13 GMT</pubDate>
    <dc:creator>GwenRoyakkers1</dc:creator>
    <dc:date>2012-05-16T06:39:13Z</dc:date>
    <item>
      <title>Scalebar API</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/scalebar-api/m-p/653366#M4508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everybody,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently, I find many ways yo add scale bar to Arcgis map on Android but it does not seem supporting that. Can everybody help me to solve this problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2012 07:31:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/scalebar-api/m-p/653366#M4508</guid>
      <dc:creator>tuannguyen3</dc:creator>
      <dc:date>2012-05-14T07:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Scalebar API</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/scalebar-api/m-p/653367#M4509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For now there seems no SDK provided way to do this easily, or I just haven't found it sorry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2012 08:14:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/scalebar-api/m-p/653367#M4509</guid>
      <dc:creator>SimonKlein</dc:creator>
      <dc:date>2012-05-14T08:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Scalebar API</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/scalebar-api/m-p/653368#M4510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for your answer. But is there any way to caculate length from point A to point B?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2012 09:14:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/scalebar-api/m-p/653368#M4510</guid>
      <dc:creator>tuannguyen3</dc:creator>
      <dc:date>2012-05-14T09:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Scalebar API</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/scalebar-api/m-p/653369#M4511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://help.arcgis.com/en/arcgismobile/10.0/apis/android/api/index.html"&gt;http://help.arcgis.com/en/arcgismobile/10.0/apis/android/api/index.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgismobile/10.0/apis/android/api/index.html"&gt;http://help.arcgis.com/en/arcgismobile/10.0/apis/android/api/index.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2012 11:15:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/scalebar-api/m-p/653369#M4511</guid>
      <dc:creator>SimonKlein</dc:creator>
      <dc:date>2012-05-14T11:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Scalebar API</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/scalebar-api/m-p/653370#M4512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thank you for your answer. But is there any way to caculate length from point A to point B?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes there is a way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The MapView class has a function toMapPoint(float screenx, float screeny).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could use this function to determine the real distance between two points, and use it to draw a scalebar yourself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;calculating the length itself:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Point strtPoint = mapview.toMapPoint(screenX1, screenY1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Point endPoint = mapview.toMapPoint(screenX2, screenY2);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Line line = new Line();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;line.setStart(strtPoint);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;line.setEnd(endPoint);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;double length = line.calculateLength2D();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Gwen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 06:39:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/scalebar-api/m-p/653370#M4512</guid>
      <dc:creator>GwenRoyakkers1</dc:creator>
      <dc:date>2012-05-16T06:39:13Z</dc:date>
    </item>
  </channel>
</rss>

