简体   繁体   English

如何在Store / WP8应用程序c#的bing映射中的所有图钉上放置特定的PushPin?

[英]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 我在商店应用中使用Bing.Maps

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 我为图钉使用了2种不同的样式
  • 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? 有什么办法设置Zindex或所选pushPin的任何属性? or any trick to bring the selected pushpin at top of all pins? 或将所选图钉置于所有图钉顶部的任何技巧?

For store app: add the selected pushpin to another MapLayer. 对于商店应用程序:将选定的图钉添加到另一个MapLayer。

Like this: http://www.bing.com/blogs/site_blogs/b/maps/archive/2013/06/17/infoboxes-for-native-windows-store-apps.aspx 像这样: 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 对于WP8应用程序:再次删除选定的引脚: WP7必应地图控件中的图钉的ZIndex

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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