Remove icons on the map

339 views Asked by At

I have two types of icons, bus stop and transport icons, how to remove the bus stop icons?

My setup function icons

 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));
     }

thanks for your replies!

1

There are 1 answers

0
AudioBubble On

The HERE Windows SDK is no longer, an alternative could be to develop an app using HERE Maps API for Javascript which supports vector map data rendering.

As to the question. One could store the added bus stop icon Image objects in an array. Then loop over that array to remove them from map.Children.