Solved

embedding bing map with custom places

Posted on 2011-03-06
1
844 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
I am having a  Git   issue 6 42
Asp in server side with Mssql Server 7 4 27
Ajax and PHP 9 30
Do alert on select 6 14
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This video teaches users how to migrate an existing Wordpress website to a new domain.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

829 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