Solved

embedding bing map with custom places

Posted on 2011-03-06
1
845 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 500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to dynamically set the form action using jQuery.

679 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