开发者

bing map pushpin

开发者 https://www.devze.com 2023-04-13 03:27 出处:网络
when my bing map loads push pin is not visilble. When i move or click on map it suddenly display pushpin.

when my bing map loads push pin is not visilble. When i move or click on map it suddenly display pushpin. i am using custum pushpin with correct path.

G开发者_开发技巧ot to the link click on launch satellite on right sidebar green button.A map load. http://tinyurl.com/3z25amr

my code

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

Please help me in this issue. thanks in advance


This is a known issue when in Birdseye view in Bing Maps V6.3. Two options to get around this is to either move the map programmatically a small amount to trigger the redraw of the map, or upgrade to the Bing Maps v7 control

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号