In UWP MapControl, I have an element (Stackpanel with an icon, nothing special) that I place on the map.
When the camera is higher than the element's altitude it is shown on the map, but when the camera goes down below the elements altitude, it disappears.
Here both cases: right the element that has disappeared):
Here, with the element over the mountain. Camera is higher that the element.
And here, The element has disappeared. Camera below element.
This is the code that I use to position on the map:
MapControl.SetLocation(pinLandmarkPoint, LandmarkGeopoint);
MapControl.SetNormalizedAnchorPoint(pinLandmarkPoint, new Point(0.5, 1));
Edit:
XAML part:
<Maps:MapControl x:Name="mapPosition">
<!-- This is the element (stackpanel) that disappears -->
<StackPanel x:Name="pinLandmarkPoint" RenderTransformOrigin="0.5,1" Visibility="Collapsed"
Holding="pinLandmarkPoint_Holding" RightTapped="pinLandmarkPoint_RighTapped">
<StackPanel x:Name="spLandmarkInfo" Margin="10" Background="{ThemeResource MapControlsBackground}" Visibility="Collapsed" Canvas.ZIndex="100">
<StackPanel Margin="10">
<TextBlock x:Name="tbLandmarkInfoCoord" Text="lat: 42.3 long: -2.8278237" Margin="2.5"/>
<Rectangle Margin="5" Height="1" Fill="DarkGrey" />
<TextBlock x:Name="tbLandmarkInfoDistance" Text="Distance2,5km" Margin="2.5"/>
<TextBlock x:Name="tbLandmarkInfoAltitude" Text="Altitude: 120m (+65,3m)" Margin="2.5"/>
<Rectangle Margin="5" Height="1" Fill="Black"/>
<TextBlock x:Name="tbLandmarkInfoAzimuth" Text="Azimuth: 23º" Margin="2.5"/>
<TextBlock x:Name="tbLandmarkInfoElevation" Text="Elevation: +3.76º" Margin="2.5"/>
</StackPanel>
</StackPanel>
<Image x:Name="imgLandmark" Source="/Images/Maps/Landmark_point_96px.png" Margin="0" Width="25" Height="25" RenderTransformOrigin="0.5,1"/>
</StackPanel>
</Maps:MapControl>
¿Any idea how can I fix this problem?