【问题标题】:Moving pins on bing maps在 Bing 地图上移动图钉
【发布时间】:2016-02-15 14:04:12
【问题描述】:

我在 windows phone 8.1 上使用 bing 地图。我使用 Image 对象作为 pin。

            var img = new Image();
            img.Width = 40;
            img.Height = 160;
            //img.Margin = new Thickness(-100,-100,0,0);
            switch (location.Type)
            {
                case 1:
                    {

                        var bmp = new BitmapImage();
                        bmp.UriSource = new Uri("ms-appx:///Assets/pin_moder@2x.png");
                        img.Source = bmp;
                        break;
                    }
                case 2:
                    {
                        var bmp = new BitmapImage();
                        bmp.UriSource = new Uri("ms-appx:///Assets/pin_roza@2x.png");
                        img.Source = bmp;
                        break;
                    }
                case 3:
                default:
                    {
                        var bmp = new BitmapImage();
                        bmp.UriSource = new Uri("ms-appx:///Assets/pin_rumen@2x.png");
                        img.Source = bmp;
                        break;
                    }
            }
            MapControl.Children.Add(img);

            var position = new BasicGeoposition();
            position.Latitude = location.Latitude;
            position.Longitude = location.Longtitude;

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

这是处理引脚添加的代码。 然而,当大头针放在地图上时,我在地图上移动时,大头针在地图上移动时会“摇晃”(从左到右和从上到下移动一点)。当我停止在地图上移动时,这个不稳定的东西就消失了。

我做错了什么?

【问题讨论】:

    标签: c# windows-phone-8.1 bing-maps


    【解决方案1】:

    我相信这是在 WP8.1 地图控件之上覆盖 XAML 控件时的一个已知问题。请注意,WP8.1 地图不是 Bing 地图,而是 HERE 地图。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多