简体   繁体   中英

How to bring specific PushPin on top of all pushpins in bing maps in Store/WP8 app c#?

I am using Bing.Maps in Store app

this how it is getting overlapped. Puspin重叠

I want the pin should look like this whenever I select the specific pushpin. 地图应用程序示例

  • I have used 2 different style for pushpins
  • on Tapped event I am changing the style of the selected pushpin like this (Maps store app)

    Pushpin selectedPin = sender as Pushpin; selectedPin.Style = (Style)(Resources["SomeStyle"]);

The problem is other pushpin are getting overlapped on the selected Pin. is there any way to set the Zindex or any property of the selected pushPin? or any trick to bring the selected pushpin at top of all pins?

For store app: add the selected pushpin to another MapLayer.

Like this: http://www.bing.com/blogs/site_blogs/b/maps/archive/2013/06/17/infoboxes-for-native-windows-store-apps.aspx

For WP8 app: Remove the selected pin and it again : ZIndex of pushpins in WP7 bing map control

Instead of changing the pushpin style we can add another push pin on the particular push pin tap event with the same location as the parent pushpin. we can change the position origin of new push pin like this

   pushpin.Tap += (s, eve) =>
      {
        MapView.SetView(pushpin.Location,MapView.ZoomLevel);
        var pushpinModel = (s as Pushpin).DataContext;
        GeoCoordinate pinLocation = new GeoCoordinate();
        pinLocation = pushpin.Location;
        pin.PositionOrigin = new PositionOrigin(-0.3,0.7);
        pin.Location = pinLocation;
        MapView.Children.Add(pin);
      }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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