Created
February 16, 2011 08:30
-
-
Save zliang-min/829036 to your computer and use it in GitHub Desktop.
A simple google map api example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment