public
Created

A simple google map api example.

  • Download Gist
google_map.html
HTML
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 31
<!doctype html>
<html lang='zh'>
<head>
<meta charset="UTF-8">
<!-- For mobile devices. -->
<title>Google map</title>
<style type="text/css">
#map_canvas { width:299px;height:234px; }
</style>
<script type="text/javascript" src="http://ditu.google.cn/maps/api/js?sensor=false"></script>
</head>
<body>
<div id="map_canvas"></div>
<script type="text/javascript">
(function() {
var latlng = new google.maps.LatLng(31.119492, 121.369738),
map = new google.maps.Map(document.getElementById("map_canvas"), {
zoom: 15,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false
});
new google.maps.Marker({
map: map,
position: latlng,
title: '上海海尔莘庄旗舰店'
});
})();
</script>
</body>
</html>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.