Jump to content

bing map pushpin issue


hamza

Recommended Posts

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.

 

Got to the link click on launch satellite on right sidebar green button.A map load. 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'
);
})();

 

Please help me in this issue. thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/249211-bing-map-pushpin-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.