【问题标题】:Bing map, disappear custom pins必应地图,消失自定义图钉
【发布时间】:2016-06-11 11:42:05
【问题描述】:

所以,我的 bing 地图有问题,我想将自定义图钉(图像)放到地图上,但我没有看到所有图钉只有几个,当我缩放时,图钉消失了

这是我的代码:

foreach (Stores store in boltok)
        {
            var myPosition = new Windows.Devices.Geolocation.BasicGeoposition();
            myPosition.Latitude = store.Latitude;
            myPosition.Longitude = store.Longitude;
            var myStorePoint = new Windows.Devices.Geolocation.Geopoint(myPosition);
            MapIcon icon = new MapIcon();
            icon.Location = new Geopoint(new BasicGeoposition()
            {
                Latitude = store.Latitude,
                Longitude = store.Longitude
            });
            icon.Visible = true;
            icon.ZIndex = 0;
            icon.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/StoreFinder/Pin.png"));
            icon.NormalizedAnchorPoint = new Point(0.5, 1.0);

            myMapControl.MapElements.Add(icon);
            myMapControl.Children.Add(icon);

        }

请帮帮我!

【问题讨论】:

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


    【解决方案1】:

    使用 MapIcon 时,仅将它们添加到 MapElements 属性,而不是 children 属性。 MapIcon 设计了一些碰撞检测,当一堆重叠时会隐藏。当您放大时,它们应该会重新出现。如果您不希望这样,请创建一个 UserControl 用作图钉并将其添加到地图子项的属性中。查看本文档的“在地图控件上显示 XAML 元素”部分:https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn792121.aspx

    【讨论】:

      猜你喜欢
      • 2011-01-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-09
      • 1970-01-01
      相关资源
      最近更新 更多