<?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 SetViewpointCenterAsync isn't actually in the center only on iOS in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1169256#M10938</link>
    <description>&lt;P&gt;The method &lt;FONT face="courier new,courier"&gt;SetViewpointCenterAsync&lt;/FONT&gt; doesn't actually set the view point to the center of the control on iOS but slightly above it. This does not happen on Android.&lt;/P&gt;&lt;P&gt;You can easily see this, if you have an active location source displayed and use this to center like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;MapView.SetViewpointCenterAsync(MapView.LocationDisplay.Location.Position);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Unbenannt.png" style="width: 976px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/40191i0BEC3E91F81551A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Unbenannt.png" alt="Unbenannt.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The first screenshot includes a cursor image, where the correct center should be using a Xamarin &lt;FONT face="courier new,courier"&gt;AbsoluteLayout&lt;/FONT&gt; like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;AbsoluteLayout&amp;gt;
    &amp;lt;esriUI:MapView x:Name="MapView"
                    AbsoluteLayout.LayoutFlags="All"
                    AbsoluteLayout.LayoutBounds="0,0,1,1"/&amp;gt;
    &amp;lt;!-- Cursor --&amp;gt;
    &amp;lt;ffimageloadingsvg:SvgCachedImage x:Name="Cursor"
                                      AbsoluteLayout.LayoutFlags="PositionProportional"
                                      AbsoluteLayout.LayoutBounds="0.5,0.5,AutoSize,AutoSize"
                                      WidthRequest="25" HeightRequest="25"/&amp;gt;
&amp;lt;/AbsoluteLayout&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My guess is, that the MapView somehow included the screen dead zone / area insets in it's center point calculation. I haven't found any property to disable this though.&lt;/P&gt;&lt;P&gt;Esri ArcGIS Runtime version 100.12.0. Screenshots taken on iPhone X.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Apr 2022 12:51:17 GMT</pubDate>
    <dc:creator>MatthiasPorges</dc:creator>
    <dc:date>2022-04-29T12:51:17Z</dc:date>
    <item>
      <title>SetViewpointCenterAsync isn't actually in the center only on iOS</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1169256#M10938</link>
      <description>&lt;P&gt;The method &lt;FONT face="courier new,courier"&gt;SetViewpointCenterAsync&lt;/FONT&gt; doesn't actually set the view point to the center of the control on iOS but slightly above it. This does not happen on Android.&lt;/P&gt;&lt;P&gt;You can easily see this, if you have an active location source displayed and use this to center like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;MapView.SetViewpointCenterAsync(MapView.LocationDisplay.Location.Position);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Unbenannt.png" style="width: 976px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/40191i0BEC3E91F81551A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Unbenannt.png" alt="Unbenannt.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The first screenshot includes a cursor image, where the correct center should be using a Xamarin &lt;FONT face="courier new,courier"&gt;AbsoluteLayout&lt;/FONT&gt; like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;AbsoluteLayout&amp;gt;
    &amp;lt;esriUI:MapView x:Name="MapView"
                    AbsoluteLayout.LayoutFlags="All"
                    AbsoluteLayout.LayoutBounds="0,0,1,1"/&amp;gt;
    &amp;lt;!-- Cursor --&amp;gt;
    &amp;lt;ffimageloadingsvg:SvgCachedImage x:Name="Cursor"
                                      AbsoluteLayout.LayoutFlags="PositionProportional"
                                      AbsoluteLayout.LayoutBounds="0.5,0.5,AutoSize,AutoSize"
                                      WidthRequest="25" HeightRequest="25"/&amp;gt;
&amp;lt;/AbsoluteLayout&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My guess is, that the MapView somehow included the screen dead zone / area insets in it's center point calculation. I haven't found any property to disable this though.&lt;/P&gt;&lt;P&gt;Esri ArcGIS Runtime version 100.12.0. Screenshots taken on iPhone X.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 12:51:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1169256#M10938</guid>
      <dc:creator>MatthiasPorges</dc:creator>
      <dc:date>2022-04-29T12:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: SetViewpointCenterAsync isn't actually in the center only on iOS</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1169591#M10944</link>
      <description>&lt;P&gt;I'm looking at your screenshots and it appears to me that we can't actually see the bottom of the mapview, since the attribution area isn't visible. Is the mapview extending below those two bottom layouts you have?&lt;BR /&gt;&lt;BR /&gt;Also note the center isn't based on the middle between the bottom and the top, but between the top and the top of the attribution.&lt;/P&gt;&lt;P&gt;If you do have the map being overlayed by other UI and want to take this into account for the center calculation, you can set the ViewInsets property to take this bit into account. For example: mapView.ViewInsets = new Thickness(0,0,0,height_of_overlay);&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2022 23:32:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1169591#M10944</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2022-04-30T23:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: SetViewpointCenterAsync isn't actually in the center only on iOS</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1169648#M10947</link>
      <description>&lt;P&gt;I set the &lt;FONT face="courier new,courier"&gt;IsAttributionTextVisible&lt;/FONT&gt; property to &lt;FONT face="courier new,courier"&gt;True&lt;/FONT&gt; so you can see that there is no other UI element above it. I also included a second screenshot where I wrap the element in a Xamarin-Frame control with a red &lt;FONT face="courier new,courier"&gt;Border&lt;/FONT&gt; and a &lt;FONT face="courier new,courier"&gt;Padding&lt;/FONT&gt; of 0 so that it makes sure, the whole control is visible.&lt;/P&gt;&lt;P&gt;Also keep in mind that this problem is only on iOS. It works fine on Android and this is a Xamarin-Forms application so the UI page should be the same.&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 07:35:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1169648#M10947</guid>
      <dc:creator>MatthiasPorges</dc:creator>
      <dc:date>2022-05-02T07:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: SetViewpointCenterAsync isn't actually in the center only on iOS</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1169650#M10948</link>
      <description>&lt;P&gt;I did some further testing, and it seems the &lt;FONT face="courier new,courier"&gt;MapView&lt;/FONT&gt; controls thinks the center is exactly 48 pixel off. I can "fix" this issue by actually adding a negative &lt;FONT face="courier new,courier"&gt;ViewInsets.Top&lt;/FONT&gt; value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;MapView.ViewInsets = new Thickness(0, -48, 0, 0);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;48 pixel happens&amp;nbsp; to be exactly the height of the top safe area inset (aka the "notch") of the iPhone 11 simulator I'm testing on.&lt;/P&gt;&lt;P&gt;So this seems to further my suspicion: The control might somehow have a "hidden" Viewinset that takes the iPhones notch into account for the center calculation. I have to test this on multiple devices though to make sure.&lt;/P&gt;&lt;P&gt;I think this is a bug in the ArcGis runtime on iOS, because this does NOT happen on Android devices with a notch.&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 09:52:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1169650#M10948</guid>
      <dc:creator>MatthiasPorges</dc:creator>
      <dc:date>2022-05-02T09:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: SetViewpointCenterAsync isn't actually in the center only on iOS</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1170328#M10960</link>
      <description>&lt;P&gt;Yes you are right - I should have caught that earlier. It is indeed taking the safe area into account on iOS (this is by design / on purpose btw)&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 19:53:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1170328#M10960</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2022-05-03T19:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: SetViewpointCenterAsync isn't actually in the center only on iOS</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1171391#M10974</link>
      <description>&lt;P&gt;If it's by design, it should behave the same on Android devices with safe areas (at least on Xamarin Forms). There should also be a proper way to disable/adjust this that doesn't involve creating a negative value ViewInset with a self-calculated value.&lt;/P&gt;&lt;P&gt;Please consider changing this in the future.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 08:32:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/setviewpointcenterasync-isn-t-actually-in-the/m-p/1171391#M10974</guid>
      <dc:creator>MatthiasPorges</dc:creator>
      <dc:date>2022-05-06T08:32:11Z</dc:date>
    </item>
  </channel>
</rss>

