bing map图钉

时间:2011-10-16 14:20:42

标签: map bing

当我的bing map加载推针时不可见。 当我移动或点击地图时,它会突然显示图钉。 我正在使用具有正确路径的custum图钉。

点击链接点击右侧栏绿色按钮上的发射卫星。地图加载。 http://tinyurl.com/3z25amr

我的代码

function geocodeCallback(result) {
 document.getElementById('post-satellite-map-address').firstChild.nodeValue = result.resourceSets[0].resources[0].address.addressLine;
}

jQuery('#post-gallery a[rel="post-gallery-photo"]').colorbox();

(function() {
 var icon;
 var map = new VEMap('post-satellite-map');
 var mapDiv = document.getElementById('post-satellite-map');
 var interval = setInterval(function() {
  if(mapDiv.attachEvent != undefined) {
   clearInterval(interval);

   var lat = document.getElementById('post-satellite-map-lat').value, long = document.getElementById('post-satellite-map-long').value;
   var position = new VELatLong(lat, long);
   map.LoadMap();
   map.SetZoomLevel(19);
   map.SetCenter(position);
   map.SetMapStyle(VEMapStyle.Birdseye);

   icon = new VEShape(VEShapeType.Pushpin, position);
   icon.SetCustomIcon(document.getElementById('post-satellite-map-icon').value);
   map.AddShape(icon);

   /*var script = document.createElement('script');
   script.setAttribute('type', 'text/javascript');
   script.setAttribute('src', ['http://dev.virtualearth.net/REST/v1/Locations/point?output=json&jsonp=geocodeCallback&includeEntityTypes=Address&point=', lat, ',', long].join(''));
   document.body.appendChild(script);*/
  }
 }, 10);
 document.getElementById('post-gallery-satellite').onclick = document.getElementById('sidebar-map-launch').onclick = function() {
  jQuery.colorbox({inline: true, href: '#post-satellite-map-overlay'});
  map.Resize();
  icon.Hide();
  icon.Show();

      return false;
     };

 jQuery.get(
  WPAjaxURL,
  { action: 'osm_postviews', postID: document.getElementById('post-id').value },
  function(views) {
   document.getElementById('post-views-count').firstChild.nodeValue = document.getElementById('post-satellite-map-views-count').firstChild.nodeValue = views;
  },
  'json'
 );
})();

请帮我解决这个问题。 提前谢谢

1 个答案:

答案 0 :(得分:0)

在Bing Maps V6.3的Birdseye视图中,这是一个已知问题。解决此问题的两个选项是以编程方式移动地图少量以触发重绘地图,或升级到Bing Maps v7控件