【问题标题】:Panning and Zooming in Bing map在 Bing 地图中平移和缩放
【发布时间】:2012-08-27 16:06:13
【问题描述】:

我想计算用户在使用 bing 地图(我使用的是 windows phone 7 平台)时所做的平移和缩放量(以纬度/经度或像素为单位)。任何解决该问题的建议将不胜感激。

【问题讨论】:

    标签: windows-phone-7 bing-maps zooming panning


    【解决方案1】:

    找到解决方案:

    Map map = new Map();
    map.MapPan += new EventHandler<MapDragEventArgs>(map_MapPan);
    map.MapZoom += new EventHandler<MapZoomEventArgs>(map_MapZoom);
    
       void map_MapZoom(object sender, MapZoomEventArgs e)
        {
            if (e.ZoomDelta >= 0)
                totalZoomInDelta += Math.Round(e.ZoomDelta, 2);
            else
                totalZoomOutDelta += Math.Abs(Math.Round(e.ZoomDelta, 2));
        }
    
        void map_MapPan(object sender, MapDragEventArgs e)
        {
    
           totalAbsDragDeltaX += Math.Abs(e.DragDelta.X);
           totalAbsDragDeltaY += Math.Abs(e.DragDelta.Y);
    
           totalDragDeltaX += e.DragDelta.X;
           totalDragDeltaY += e.DragDelta.Y;
    
           totalDragDelta += Math.Sqrt(e.DragDelta.X * e.DragDelta.X + e.DragDelta.Y * e.DragDelta.Y);
        }
    

    【讨论】:

      猜你喜欢
      • 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
      相关资源
      最近更新 更多