none
simple bing map with pushpin RRS feed

  • Question

  • hi, we have a bing map integrated into a website using the API in a standard way (code below) and also have a pushpin on the map. The question is when the website user clicks on the bing logo to view the map in full on the bing map website, how do we get the pushpin to appear too? thanks

     

    			var map = new Microsoft.Maps.Map(element.get(0),
                   {
                   	credentials: key,
                   	center: new Microsoft.Maps.Location(latitude, longitude),
                   	mapTypeId: Microsoft.Maps.MapTypeId.road,
                   	width: width,
                   	height: height,
                   	zoom: zoom,
                   	showScalebar: false,
                   	enableSearchLogo: false
                   });
    			var mypushpin = new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location(latitude, longitude));
    			map.entities.push(mypushpin);


    • Moved by Ricky_Brundritt Saturday, March 10, 2012 11:03 AM (From:Bing Maps: Map Control and Web services Development)
    Wednesday, September 21, 2011 3:11 AM

Answers

  • The code looks alright. Make sure that your latitude and longitude coordinates are numbers and not strings. i.e. if you are passing in the values via a query string these are likely strings. Use parseFloat to correct.
    http://rbrundritt.wordpress.com
    Wednesday, September 21, 2011 9:16 AM