Importing and Mapping Data

Started by thiruvasagamani, Jan 22, 2009, 08:51 PM

Previous topic - Next topic

thiruvasagamani

Importing and Mapping Data

This article describes how to import shapes into a Virtual Earth map from three different types of resources: GeoRSS, Windows Live Collections, and KML. It also describes how to work with custom icons on a Virtual Earth map when importing data from one of these resource types.

The entire listing for the source file developed in this article is available in the Source Listing section.
Creating a Basic Virtual Earth Map

Create the file Find.html and add the code shown in Listing 1 to that file.
Copy Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Working with Shapes</title>
     
      <script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"></script>
     
      <script type="text/javascript">
         var map;
         
         function OnPageLoad()
         {
            map = new VEMap('myMap');
            map.LoadMap();
         }
      </script>
   </head>
   <body onload="OnPageLoad();">
      <div id="myMap" style="position:relative;width:640px;height:480px;"></div>
   </body>
</html>
Thiruvasakamani Karnan