在Silverlight 2应用程序中集成Virtual Earth

http://www.sina.com.cn 2008年07月02日 17:07  《程序员》

   概述

   Virtual Earth是什么,我想不用多做解释了。微软在推出自己的Virtual Earth之后,开放了大量的APIs,使得我们可以方便集成到自己的应用程序中。

   本文将介绍如何在自己的Silverlight 2应用程序中集成Virtual Earth。

   在HTML中集成在开始之前,我们先来简单看一下如何在HTML中集成Virtual Earth,大家可以去这里查询相关APIs,我们来看看如何加载默认地图,如下代码所示:

<html>
<head>
<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>
</head>
<body onload="GetMap(); ">
<div id='myMap' style="position:relative; width:480px; height:320px; "></div>
</body>
</html>

   其实这段代码非常简单的简单,首先引入Virtual Earth Map控件,并且使用JavaScript来加载地图。

在Silverlight2应用程序中集成VirtualEarth
首先引入Virtual Earth Map控件


上一页 1 2 3 4 5 下一页
本文导航:
·概述
·在查找地图上的特定位置的示例
·在Silverlight中加载Virtual Earth
·在Silverlight中加入查找位置的功能
·添加层、实现3D效果

发表评论 _COUNT_条
Powered By Google
·城市对话改革30年 ·新浪城市同心联动 ·诚招合作伙伴 ·企业邮箱畅通无阻