<?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 How to recenter map after displaying location? in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-recenter-map-after-displaying-location/m-p/398667#M2693</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used the "Display device location"&amp;nbsp;sample code but would like to make it so that whenever the Spinner is on "Stop", the map is re-centered on the initial extent. How can I do this? I have tried so far in the switch statement for the "Stop" case this below, however it does not render the layers or basemap when it "zooms back" and I am confused:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(!&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mLocationDisplay&lt;/SPAN&gt;.isStarted())
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mLocationDisplay&lt;/SPAN&gt;.startAsync();
&lt;SPAN style="color: #808080;"&gt;// create the location point
&lt;/SPAN&gt;Point centerPoint = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Point(&lt;SPAN style="color: #0000ff;"&gt;48.6596&lt;/SPAN&gt;, -&lt;SPAN style="color: #0000ff;"&gt;113.7870&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;spatialReference&lt;/SPAN&gt;);
&lt;SPAN style="color: #808080;"&gt;// set the map views's viewpoint centered on Waterloo and scaled
&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;aMapView&lt;/SPAN&gt;.setViewpointCenterAsync(centerPoint, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;SCALE&lt;/SPAN&gt;);
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;aMapView&lt;/SPAN&gt;.resume();
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;break&lt;/SPAN&gt;;


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:12:39 GMT</pubDate>
    <dc:creator>CoraColeman</dc:creator>
    <dc:date>2021-12-11T18:12:39Z</dc:date>
    <item>
      <title>How to recenter map after displaying location?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-recenter-map-after-displaying-location/m-p/398667#M2693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used the "Display device location"&amp;nbsp;sample code but would like to make it so that whenever the Spinner is on "Stop", the map is re-centered on the initial extent. How can I do this? I have tried so far in the switch statement for the "Stop" case this below, however it does not render the layers or basemap when it "zooms back" and I am confused:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(!&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mLocationDisplay&lt;/SPAN&gt;.isStarted())
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mLocationDisplay&lt;/SPAN&gt;.startAsync();
&lt;SPAN style="color: #808080;"&gt;// create the location point
&lt;/SPAN&gt;Point centerPoint = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Point(&lt;SPAN style="color: #0000ff;"&gt;48.6596&lt;/SPAN&gt;, -&lt;SPAN style="color: #0000ff;"&gt;113.7870&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;spatialReference&lt;/SPAN&gt;);
&lt;SPAN style="color: #808080;"&gt;// set the map views's viewpoint centered on Waterloo and scaled
&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;aMapView&lt;/SPAN&gt;.setViewpointCenterAsync(centerPoint, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;SCALE&lt;/SPAN&gt;);
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;aMapView&lt;/SPAN&gt;.resume();
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;break&lt;/SPAN&gt;;


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:12:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-recenter-map-after-displaying-location/m-p/398667#M2693</guid>
      <dc:creator>CoraColeman</dc:creator>
      <dc:date>2021-12-11T18:12:39Z</dc:date>
    </item>
  </channel>
</rss>

