Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
A simple google map api example.
<!doctype html>
<html lang='zh'>
<meta charset="UTF-8">
<!-- For mobile devices. -->
<title>Google map</title>
<style type="text/css">
#map_canvas { width:299px;height:234px; }
<script type="text/javascript" src=""></script>
<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: '上海海尔莘庄旗舰店'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment