【问题标题】:Remove icons on the map删除地图上的图标
【发布时间】:2015-06-12 10:00:56
【问题描述】:

我有两种图标,公交车站和交通图标,如何去除公交车站图标?

我的设置功能图标

 public void SetStopIcon(double Latitude, double Longitude, MapControl map) //48.463443, 35.057952
    {
        Image iconStopBus = new Image();
        iconStopBus.Source = new BitmapImage(new Uri("ms-appx:///Assets/Logo.scale-240.png"));
        map.Children.Add(iconStopBus);
        MapControl.SetLocation(iconStopBus, new Geopoint(new BasicGeoposition() { Latitude = Latitude, Longitude = Longitude }));
        MapControl.SetNormalizedAnchorPoint(iconStopBus, new Point(0.5, 0.5));    
    }

 public void SetBusIcon(double Latitude, double Longitude, MapControl map) //48.463443, 35.057952
    {
        Image iconBus = new Image();
        iconBus.Source = new BitmapImage(new Uri("ms-appx:///Assets/2.busIcon.white.png"));
        map.Children.Add(iconBus);
        MapControl.SetLocation(iconBus, new Geopoint(new BasicGeoposition() { Latitude = Latitude, Longitude = Longitude }));
        MapControl.SetNormalizedAnchorPoint(iconBus, new Point(0.5, 0.5));
     }

感谢您的回复!

【问题讨论】:

  • 为每个Image 添加某种Tag,然后循环遍历地图的子元素并删除任何具有与您要删除的标签匹配的标签的框架元素。
  • 你能举个简单的例子吗?

标签: c# windows-phone-8 windows-phone-8.1 here-api


【解决方案1】:

不再使用 HERE Windows SDK,替代方法是使用支持矢量地图数据渲染的 HERE Maps API for Javascript 开发应用程序。

关于问题。可以将添加的巴士站图标图像对象存储在数组中。然后遍历该数组以将它们从 map.Children 中删除。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-28
    • 1970-01-01
    • 2012-10-17
    • 1970-01-01
    • 2021-08-05
    • 1970-01-01
    • 2014-03-01
    相关资源
    最近更新 更多