b/s端编码——调用天地图API进行地图展示

调用“天地图API”,展示地图

<script type="text/javascript" src="http://api.tianditu.com/api?v=4.0"></script>
<style type="text/css">body,html{width:100%;height:100%;margin:0;font-family:"Microsoft YaHei"}#mapDiv{width:100%;height:400px}input,b,p{margin-left:5px;font-size:14px}</style>
<script>
var map;
var zoom = 12;
function onLoad() {
map = new T.Map('mapDiv');
map.centerAndZoom(new T.LngLat(116.40769, 39.89945), zoom);
}
</script>

<body onLoad="onLoad()">
<div id="mapDiv"></div>
</body>

 

posted @ 2018-05-30 09:17  JUNG_WOO  阅读(359)  评论(1编辑  收藏  举报