Integrated Virtual Earth in Silverlight 2 applications

Source: Internet
Author: User
Tags silverlight

Overview

What the Virtual earth is, I do not want to explain more. After the launch of its own Virtual Earth, Microsoft has opened up a lot of APIs so that we can easily integrate into our own applications.

Integrating in HTML

Before we start, let's take a quick look at how to integrate Virtual Earth in HTML, and you can go here and query the relevant APIs, and we'll see how to load the default map, as shown in the following code:

     <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript"
       src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1"></script>
    <script type="text/javascript">
     var map = null;
        
     function GetMap()
     {
       map = new VEMap('myMap');
       map.LoadMap();
     } 
   </script>
    <body onload="GetMap();">
   <div id='myMap' style="position:relative; width:480px; height:320px;"></div>
  </body>

In fact, this code is very simple, first introduced the Virtual Earth Map control, and use JavaScript to load the map.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.