?
Solved

embedding bing map with custom places

Posted on 2011-03-06
1
Medium Priority
?
852 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to count occurrences of each item in an array.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

765 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