【问题标题】:WP7: Multiple Puspins and Bing MapsWP7:多个 Puspin 和 Bing 地图
【发布时间】:2012-08-18 19:46:25
【问题描述】:
public void setMap()
    {
        GeoCoordinate mapCener = new GeoCoordinate(39.920794, 32.853902);
        Pushpin pin1 = new Pushpin();
        pin1.Location = mapCener;
        pin1.Content = hereContent;
        map1.Children.Add(pin1);

        foreach (var item in pinList)
        {
            MessageBox.Show(item.Location.Latitude.ToString()+","+item.Location.Longitude.ToString());
            mapCener = new GeoCoordinate(item.Location.Latitude, item.Location.Longitude);
            pin1 = new Pushpin();
            pin1.Content = "K";
            map1.Children.Add(pin1);
            map1.SetView(mapCener, 0);
        }

        int zoom = 10;
        map1.SetView(mapCener, zoom);
        map1.ZoomBarVisibility = Visibility.Visible;
    }

我有一个 PushPins 列表,其中包含不同位置的坐标。我也有中心点,它显示了手机的位置。

我尝试将图钉添加到地图中,内容“K”显示在屏幕的左上角。我的 PushPin 列表包含正确的坐标,但它们在地图上的位置是错误的。可能是什么原因?

【问题讨论】:

  • 您好,我没有看到 foreach 循环中引脚的位置,这可能会导致问题。
  • pinList 包含引脚的位置。 foreach 循环中的 MessageBox 显示了应有的位置。
  • 我的意思是我没有在 foreach 循环中看到 pin1.location。

标签: bing-maps pushpin


【解决方案1】:

听起来您正在尝试进行 PushPin 集群,这里有一篇很好的文章,其中有一个很好的例子来说明您正在尝试完成什么。

http://www.scottlogic.co.uk/blog/colin/2011/11/pushpin-clustering-with-the-windows-phone-7-bing-map-control/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多