<?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: AGSSceneView.locationToScreen method returns wrong values. in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1192951#M7400</link>
    <description>&lt;P&gt;Thank you for your question! &amp;nbsp;There are a couple of things you can try.&lt;/P&gt;&lt;P&gt;- You can try using the&amp;nbsp;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_scene_view.html#a039592fe921d7ba681b9dc573fab5878" target="_self"&gt;&lt;EM&gt;- (AGSPoint *)screenToBaseSurface:(CGPoint)screenPoint;&lt;/EM&gt;&lt;/A&gt; method instead. &amp;nbsp;That method&amp;nbsp;&lt;EM&gt;Converts the specified screen point to a location on the base surface i.e. ignoring any 3D features/graphics on or above the surface that may be intersecting the screen point. The location returned will have a z-value corresponding to the elevation at the intersecting surface.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- Depending on if your features/graphics are in a layer or in a graphics overlay, look at the&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/ios/api-reference/_a_g_s_surface_placement_8h.html#a587c857cab6e55d7f0ebb8b133a87cce" target="_self"&gt;&lt;EM&gt;AGSSurfacePlacement&lt;/EM&gt;&lt;/A&gt; and&amp;nbsp;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_layer_scene_properties.html" target="_self"&gt;&lt;EM&gt;AGSLayerSceneProperties&lt;/EM&gt;&lt;/A&gt; classes.&amp;nbsp;&lt;EM&gt;AGSLayerSceneProperties&lt;/EM&gt; has a&amp;nbsp;&lt;EM&gt;AGSSurfacePlacement&lt;/EM&gt; property, which specifies&amp;nbsp;&lt;EM&gt;how data belonging to the layer should be placed in relation to the scene's surface.&lt;/EM&gt; Both &lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_graphics_overlay.html#a0706ce89d43d270d6a643f0deaa08233" target="_self"&gt;&lt;EM&gt;AGSGraphicsOverlay&lt;/EM&gt;&lt;/A&gt; and &lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_feature_layer.html#a4222dac8bc43dad4320f0b33d2aac9a0" target="_self"&gt;&lt;EM&gt;AGSFeatureLayer&lt;/EM&gt;&lt;/A&gt; have a&amp;nbsp;&lt;EM&gt;AGSLayerSceneProperties&lt;/EM&gt; property which you can use to specify how the data is placed.&lt;/P&gt;&lt;P&gt;If that doesn't solve your issue, or if you have more questions, please reach out!&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2022 15:17:32 GMT</pubDate>
    <dc:creator>MarkDostal</dc:creator>
    <dc:date>2022-07-18T15:17:32Z</dc:date>
    <item>
      <title>AGSSceneView.locationToScreen method returns wrong values.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1192868#M7399</link>
      <description>&lt;P&gt;This method returns wrong values when the scene has an elevation.&lt;/P&gt;&lt;P&gt;After further debugging I found out that this method expect the absolute altitude (including baseSurface elevation) but the shapes we draw have their altitude relative to the ground.&lt;/P&gt;&lt;P&gt;As a consequence, when the map has an elevation on the baseSurface and we use the same AGSPoint to draw a shape then in&amp;nbsp;AGSSceneView.locationToScreen, the result of this function is not corresponding to what is displayed on the screen.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 13:15:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1192868#M7399</guid>
      <dc:creator>YoussefMAHERZI</dc:creator>
      <dc:date>2022-07-18T13:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: AGSSceneView.locationToScreen method returns wrong values.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1192951#M7400</link>
      <description>&lt;P&gt;Thank you for your question! &amp;nbsp;There are a couple of things you can try.&lt;/P&gt;&lt;P&gt;- You can try using the&amp;nbsp;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_scene_view.html#a039592fe921d7ba681b9dc573fab5878" target="_self"&gt;&lt;EM&gt;- (AGSPoint *)screenToBaseSurface:(CGPoint)screenPoint;&lt;/EM&gt;&lt;/A&gt; method instead. &amp;nbsp;That method&amp;nbsp;&lt;EM&gt;Converts the specified screen point to a location on the base surface i.e. ignoring any 3D features/graphics on or above the surface that may be intersecting the screen point. The location returned will have a z-value corresponding to the elevation at the intersecting surface.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- Depending on if your features/graphics are in a layer or in a graphics overlay, look at the&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/ios/api-reference/_a_g_s_surface_placement_8h.html#a587c857cab6e55d7f0ebb8b133a87cce" target="_self"&gt;&lt;EM&gt;AGSSurfacePlacement&lt;/EM&gt;&lt;/A&gt; and&amp;nbsp;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_layer_scene_properties.html" target="_self"&gt;&lt;EM&gt;AGSLayerSceneProperties&lt;/EM&gt;&lt;/A&gt; classes.&amp;nbsp;&lt;EM&gt;AGSLayerSceneProperties&lt;/EM&gt; has a&amp;nbsp;&lt;EM&gt;AGSSurfacePlacement&lt;/EM&gt; property, which specifies&amp;nbsp;&lt;EM&gt;how data belonging to the layer should be placed in relation to the scene's surface.&lt;/EM&gt; Both &lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_graphics_overlay.html#a0706ce89d43d270d6a643f0deaa08233" target="_self"&gt;&lt;EM&gt;AGSGraphicsOverlay&lt;/EM&gt;&lt;/A&gt; and &lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_feature_layer.html#a4222dac8bc43dad4320f0b33d2aac9a0" target="_self"&gt;&lt;EM&gt;AGSFeatureLayer&lt;/EM&gt;&lt;/A&gt; have a&amp;nbsp;&lt;EM&gt;AGSLayerSceneProperties&lt;/EM&gt; property which you can use to specify how the data is placed.&lt;/P&gt;&lt;P&gt;If that doesn't solve your issue, or if you have more questions, please reach out!&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 15:17:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1192951#M7400</guid>
      <dc:creator>MarkDostal</dc:creator>
      <dc:date>2022-07-18T15:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: AGSSceneView.locationToScreen method returns wrong values.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1192965#M7401</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2665"&gt;@MarkDostal&lt;/a&gt;&amp;nbsp;and thank you for your quick response.&lt;BR /&gt;We just need to know where the graphic is displayed on the screen, and to do that I don't know which screenPoint I should use to call&amp;nbsp;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_scene_view.html#a039592fe921d7ba681b9dc573fab5878" target="_self" rel="nofollow noopener noreferrer"&gt;&lt;EM&gt;- (AGSPoint *)screenToBaseSurface:(CGPoint)screenPoint;&lt;/EM&gt;&lt;/A&gt;&amp;nbsp;since I may have different elevations on the screen. We tried&amp;nbsp;&lt;SPAN class=""&gt;sceneView&lt;/SPAN&gt;.&lt;SPAN class=""&gt;scene&lt;/SPAN&gt;?.baseSurface?.elevation(for: point, completion: completion) to get the elevation but it is unfortunatly asynchrone hence too complicated to use in our case.&lt;/P&gt;&lt;P data-unlink="true"&gt;Concerning&amp;nbsp;&lt;EM&gt;AGSSurfacePlacement, we use&amp;nbsp;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_graphics_overlay.html#a0706ce89d43d270d6a643f0deaa08233" target="_self" rel="nofollow noopener noreferrer"&gt;AGSGraphicsOverlay&lt;/A&gt;&amp;nbsp;and the items are placed relatively to the ground which is what we needs.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 15:41:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1192965#M7401</guid>
      <dc:creator>YoussefMAHERZI</dc:creator>
      <dc:date>2022-07-18T15:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: AGSSceneView.locationToScreen method returns wrong values.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1193094#M7402</link>
      <description>&lt;P&gt;Sorry, I think I misunderstood your initial question, which was to get a screen location. &amp;nbsp;So, obviously, &lt;EM&gt;screenToBaseSurface&lt;/EM&gt; won't work. &amp;nbsp;What do you want to do with the screen point once you have it? &amp;nbsp;The screen location of a particular map point/graphic/feature will change as the map is panned/zoomed.&lt;/P&gt;&lt;P&gt;What kind of issues are you seeing with &lt;EM&gt;AGSSceneView.locationToScreen&lt;/EM&gt;? &amp;nbsp;A screen shot would be helpful, if possible.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 19:14:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1193094#M7402</guid>
      <dc:creator>MarkDostal</dc:creator>
      <dc:date>2022-07-18T19:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: AGSSceneView.locationToScreen method returns wrong values.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1193291#M7404</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a graphic displayed in a 3D map and I just want to know if the graphic is visible on the map and with some padding, not too close to the edge.&lt;BR /&gt;The problem is when the baseSurface of the map has an elevation, the result returned by&amp;nbsp;&lt;EM&gt;AGSSceneView.locationToScreen is wrong. It returns that the shape is visible on screen with y = 15 when in reality the shape is off screen with y ~= -10. I use the same AGSPoint to draw the shape and as a parameter to&amp;nbsp;AGSSceneView.locationToScreen.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 08:02:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1193291#M7404</guid>
      <dc:creator>YoussefMAHERZI</dc:creator>
      <dc:date>2022-07-19T08:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: AGSSceneView.locationToScreen method returns wrong values.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1194208#M7405</link>
      <description>&lt;P&gt;I've tried a few things out on my end, but to make sure I'm understanding things correctly, can you send me the coordinates and SR of the `AGSPoint` used to draw the graphic? &amp;nbsp;Also, the `SceneView`s `currentViewpointCamera`? &amp;nbsp;I can then replicate what you're seeing.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;print("currentViewpointCamera: \(sceneView.currentViewpointCamera())")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;print("geometry = \(g.geometry)")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Which gives this output:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;currentViewpointCamera: AGSCamera: heading: 330.00, pitch: 97.00, roll: 0.00, location: AGSPoint: (-4.459500, 48.388900, 80.000000, nan), sr: 4326&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;geometry = Optional(AGSPoint: (-4.460926, 48.390397, 71.284401, nan), sr: 4326)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;If you could also provide the elevation source you are using (if it's OK to share), that would be great.&lt;/P&gt;&lt;P&gt;That way I can recreate the issue here and delve into it some more.&lt;/P&gt;&lt;P&gt;Thank you for your patience!&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 21:55:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1194208#M7405</guid>
      <dc:creator>MarkDostal</dc:creator>
      <dc:date>2022-07-20T21:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: AGSSceneView.locationToScreen method returns wrong values.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1194336#M7406</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I created a demo project to show screen location in the console.&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;When surfacePlacement = .&lt;SPAN class=""&gt;absolute, the method works correctly but when it's .relative the returned result is wrong.&lt;BR /&gt;How should we get the location of a graphic on the screen if we use the relative altitude ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 07:53:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1194336#M7406</guid>
      <dc:creator>YoussefMAHERZI</dc:creator>
      <dc:date>2022-07-21T07:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: AGSSceneView.locationToScreen method returns wrong values.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1194726#M7407</link>
      <description>&lt;P&gt;Thank you for the code, it helped reproduce things here. &amp;nbsp;After speaking with a member of our 3D team, I found a solution to your problem. &amp;nbsp;The&amp;nbsp;&lt;SPAN&gt;LocationToScreen method takes an input MapPoint but its not aware of SurfacePlacement modes unlike Graphics in a Layer.&amp;nbsp; The MapPoint will be treated as absolute. &amp;nbsp;To work around this, you will need to retrieve the elevation value for the X,Y of the point and add it to the Z value of the graphic/geometry you want to input into the LocationToScreen method.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sceneView&lt;/SPAN&gt;.&lt;SPAN&gt;scene&lt;/SPAN&gt;?.baseSurface?.elevation(&lt;SPAN&gt;&lt;STRONG&gt;for&lt;/STRONG&gt;&lt;/SPAN&gt;:, completion:) will retrieve the elevation, which you would then add to the Z value of your point.&lt;/P&gt;&lt;P&gt;I realize you mentioned that method earlier, and that it is asynchronous, but hopefully it won't be too difficult to incorporate it into your code.&lt;/P&gt;&lt;P&gt;Let me know if I can be of further assistance,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 22:12:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agssceneview-locationtoscreen-method-returns-wrong/m-p/1194726#M7407</guid>
      <dc:creator>MarkDostal</dc:creator>
      <dc:date>2022-07-21T22:12:51Z</dc:date>
    </item>
  </channel>
</rss>

