随笔 - 21  文章 - 0  评论 - 0  阅读 - 31852

国内使用google地图的初级使用

<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>

var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
}

</script>
<script async defer src="http://maps.google.cn/maps/api/js?key=AIzaSyB6C0mYs2nmO03ec9EeQZZ9g6vumD0b5V0&callback=initMap"></script>
</body>
</html>

上面是代码部分,下面是截图:

http://maps.google.cn/maps/api/js的开发API和就是google的API

分享出来给需要的朋友,给你带来方便说明我没有白做工!

posted on   人生路无止境  阅读(659)  评论(0)    收藏  举报
< 2025年4月 >
30 31 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 1 2 3
4 5 6 7 8 9 10

点击右上角即可分享
微信分享提示