?
Solved

embedding bing map with custom places

Posted on 2011-03-06
1
Medium Priority
?
858 Views
Last Modified: 2012-05-11
Hi, can you please let me know how I can embed a map from bing, after I insert a custom mark on some locations? I have a store and we have two retail locations, we would like to insert a mark on the map with our two locations, and then embed the map in our html files for our website.

Also, can I add a custom image on the place mark?

Thank you!
0
Comment
Question by:darkbluegr
1 Comment
 
LVL 28

Accepted Solution

by:
strickdd earned 2000 total points
ID: 35057555
First, you'll have to decide which version of Bing Maps API to use: http://msdn.microsoft.com/en-us/library/dd877180.aspx.
Then you can follow the references on how to do what you are looking to do.

For example, using the 7.0 API, you create the map page (http://msdn.microsoft.com/en-us/library/gg427624.aspx):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
   <head>
      <title></title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

      <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>

      <script type="text/javascript">
      function GetMap()
      {  

         var map = new Microsoft.Maps.Map(document.getElementById("mapDiv"),
                           {credentials: "Your Bing Maps Key",
                            center: new Microsoft.Maps.Location(45.5, -122.5),
                            mapTypeId: Microsoft.Maps.MapTypeId.road,
                            zoom: 7});
      }
      </script>
   </head>
   <body onload="GetMap();">
      <div id='mapDiv' style="position:relative; width:400px; height:400px;"></div>      
   </body>
</html>


Then you add you location pushpins (http://msdn.microsoft.com/en-us/library/gg427604.aspx):

// Define the pushpin location
var loc = new Microsoft.Maps.Location(47.592, -122.332);  //Use the GPS of your store here
           
// Add a pin to the map
var pin = new Microsoft.Maps.Pushpin(loc);
map.entities.push(pin);
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Over time, the online landscape has altered considerably, but that’s nothing compared to the up-and-coming trends that will shape the web design industry in the coming year. Keep reading to find out which trends will shape B2B web design in 2018.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question