<?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 Android 100 API: stop Location Display in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-100-api-stop-location-display/m-p/317090#M2085</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.getLocationDisplay().setShowLocation(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;true&lt;/SPAN&gt;);
&lt;SPAN style="background-color: #e4e4ff;"&gt;mapView&lt;/SPAN&gt;.getLocationDisplay().setAutoPanMode(LocationDisplay.AutoPanMode.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;RECENTER&lt;/SPAN&gt;);
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.getLocationDisplay().startAsync();

to start the location service in my&amp;nbsp; 100.2.1 Android app, and 
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.getLocationDisplay().stop();
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.getLocationDisplay().setShowLocation(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;false&lt;/SPAN&gt;);
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.getLocationDisplay().setAutoPanMode(LocationDisplay.AutoPanMode.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;OFF&lt;/SPAN&gt;)

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;to stop it. I stop the service every time I pause the app, &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;and restart it only if the user clicks on the GPS button on my map.&lt;/SPAN&gt;

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;However, it sometimes happens that when I stop the Location Display, then immediately pause and resume the app,&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;the location marker is still shown on the map (although it is no longer animated or moving).&lt;/SPAN&gt;

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;This wouldn't really bother me that much, but unfortunately, if I now click on a POI on my map,&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;the MapView only briefly zooms to that POI (as expected), and then instantly zooms back to the &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;location marker, even though the AutoPanMode is off and the LocationDisplay is not running! &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;(mapView.getLocationDisplay().isStarted() = false!).&lt;/SPAN&gt;

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;The same happens occasionally if I do not pause the app, but simply switch basemaps. &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;I.e., I stop the Location Display (the location marker disappears), switch to a new basemap, and &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;(sometimes) see the location marker on the map again, and the map keeps zooming back to this location.&lt;/SPAN&gt;

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Is this a bug in the API? Or what might cause this issue?&lt;/SPAN&gt;

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Thank you,&lt;/SPAN&gt;

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Claudia&lt;/SPAN&gt;





&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 15:04:58 GMT</pubDate>
    <dc:creator>LageplanGöttingen</dc:creator>
    <dc:date>2021-12-11T15:04:58Z</dc:date>
    <item>
      <title>Android 100 API: stop Location Display</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-100-api-stop-location-display/m-p/317090#M2085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.getLocationDisplay().setShowLocation(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;true&lt;/SPAN&gt;);
&lt;SPAN style="background-color: #e4e4ff;"&gt;mapView&lt;/SPAN&gt;.getLocationDisplay().setAutoPanMode(LocationDisplay.AutoPanMode.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;RECENTER&lt;/SPAN&gt;);
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.getLocationDisplay().startAsync();

to start the location service in my&amp;nbsp; 100.2.1 Android app, and 
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.getLocationDisplay().stop();
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.getLocationDisplay().setShowLocation(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;false&lt;/SPAN&gt;);
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.getLocationDisplay().setAutoPanMode(LocationDisplay.AutoPanMode.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;OFF&lt;/SPAN&gt;)

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;to stop it. I stop the service every time I pause the app, &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;and restart it only if the user clicks on the GPS button on my map.&lt;/SPAN&gt;

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;However, it sometimes happens that when I stop the Location Display, then immediately pause and resume the app,&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;the location marker is still shown on the map (although it is no longer animated or moving).&lt;/SPAN&gt;

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;This wouldn't really bother me that much, but unfortunately, if I now click on a POI on my map,&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;the MapView only briefly zooms to that POI (as expected), and then instantly zooms back to the &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;location marker, even though the AutoPanMode is off and the LocationDisplay is not running! &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;(mapView.getLocationDisplay().isStarted() = false!).&lt;/SPAN&gt;

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;The same happens occasionally if I do not pause the app, but simply switch basemaps. &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;I.e., I stop the Location Display (the location marker disappears), switch to a new basemap, and &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;(sometimes) see the location marker on the map again, and the map keeps zooming back to this location.&lt;/SPAN&gt;

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Is this a bug in the API? Or what might cause this issue?&lt;/SPAN&gt;

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Thank you,&lt;/SPAN&gt;

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Claudia&lt;/SPAN&gt;





&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:04:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-100-api-stop-location-display/m-p/317090#M2085</guid>
      <dc:creator>LageplanGöttingen</dc:creator>
      <dc:date>2021-12-11T15:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Android 100 API: stop Location Display</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-100-api-stop-location-display/m-p/317091#M2086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I eventually managed to find a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed the order of my cancellation methods to&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;locationDisplay.setAutoPanMode(LocationDisplay.AutoPanMode.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;OFF&lt;/SPAN&gt;);
locationDisplay.stop();

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Now the map does no longer zoom to the location marker after stopping the service, which is great.&lt;/SPAN&gt;


&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;I still think there is a bug in the API, though. If I also put&lt;/SPAN&gt;
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;locationDisplay.setShowLocation(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;false&lt;/SPAN&gt;);
locationDisplay.setShowPingAnimation(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;false&lt;/SPAN&gt;);
locationDisplay.setShowAccuracy(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;false&lt;/SPAN&gt;);

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;EM&gt;BEFORE &lt;/EM&gt;&lt;SPAN style="background-color: #e4e4ff;"&gt;locationDisplay&lt;/SPAN&gt;.stop() instead of after, it won't longer happen that there is still a static location&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;marker on the map after cancellation. But in return, the marker doesn't immediately show up when&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;the service is running and a new location was found. That's why I keep these three methods &lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;EM&gt;AFTER&lt;/EM&gt; &lt;SPAN style="background-color: #e4e4ff;"&gt;locationDisplay&lt;/SPAN&gt;.stop(). I don't really care if sometimes the marker is still visible after stopping the LocationDisplay&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;as long as the map does not zoom to this point. &lt;/SPAN&gt;

&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:05:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-100-api-stop-location-display/m-p/317091#M2086</guid>
      <dc:creator>LageplanGöttingen</dc:creator>
      <dc:date>2021-12-11T15:05:00Z</dc:date>
    </item>
  </channel>
</rss>

