1.创建一个简单地图
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hello, World</title>
<style>
html {
height: 100%;
}
body {
height: 100%;
margin: 0;
padding: 0;
}
#container {
height:100%;
}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=keWKoh81TymhU6th97QtAVgZSuLSbHXm"></script>
</head>
<body>
<div id="container"></div>
<script>
var map = new BMap.Map("container");//创建地图示实例
var point = new BMap.Point(116.404, 39.915);//创建点坐标
map.centerAndZoom(point, 15);//初始化地图,设置中心点坐标和地图级别
</script>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
2.通过Control类来实现自定义控件