简体   繁体   English

UWP MapControl问题锚定XAML子级

[英]UWP MapControl issue anchoring xaml children

I'm new to UWP MapControl currently. 我是UWP MapControl的新手。 I have a simple problem when adding XAML children to map (instead of the regular map elements). 将XAML子级添加到地图(而不是常规地图元素)时,我遇到了一个简单的问题。

this is my code: 这是我的代码:

    private void MapRightTapped(MapControl sender, MapRightTappedEventArgs args)
    {
        Ellipse circle = new Ellipse() { Height = 20, Width = 20, Fill = new SolidColorBrush(Colors.Black)};
        sender.Children.Add(circle);

        Geopoint position = new Geopoint(new BasicGeoposition()
        {
            Latitude = args.Location.Position.Latitude,
            Longitude = args.Location.Position.Longitude,
            Altitude = 5000,

        });
        MapControl.SetLocation(circle, position);
        MapControl.SetNormalizedAnchorPoint(circle, new Point(0.5, 0.5));
     }

At first the point displayed correctly on the map. 首先,该点正确显示在地图上。 but after zooming or tilting the map, the circle appeared to be anchored at the surface altitude and NOT at altitude of 5000 但是缩放或倾斜地图后,圆圈似乎锚定在地面高度,而不是5000高度

You need to set an altitude reference system. 您需要设置一个高度参考系统。 Leaving it set to the default of unspecified will cause the altitude value to be ignored. 将其设置为默认值unspecified将导致高度值被忽略。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM