提交 | 用户 | 时间
|
58d006
|
1 |
<!DOCTYPE html> |
A |
2 |
<html> |
|
3 |
<head> |
|
4 |
<meta charset="utf-8"> |
|
5 |
<title>GMaps.js — Static map</title> |
|
6 |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> |
|
7 |
<script src="http://maps.google.com/maps/api/js?sensor=true"></script> |
|
8 |
<script src="../gmaps.js"></script> |
|
9 |
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css" /> |
|
10 |
<link rel="stylesheet" type="text/css" href="examples.css" /> |
|
11 |
<script> |
|
12 |
$(document).ready(function(){ |
|
13 |
var url = GMaps.staticMapURL({ |
|
14 |
size: [610, 350], |
|
15 |
lat: -12.043333, |
|
16 |
lng: -77.028333 |
|
17 |
}); |
|
18 |
$('<img/>').attr('src', url).appendTo('#map'); |
|
19 |
}); |
|
20 |
</script> |
|
21 |
</head> |
|
22 |
<body> |
|
23 |
<h1>GMaps.js — Static map</h1> |
|
24 |
<div class="row"> |
|
25 |
<div class="span11"> |
|
26 |
<div id="map"></div> |
|
27 |
</div> |
|
28 |
<div class="span6"> |
|
29 |
<p>You can easily make a static map using GMaps.js:</p> |
|
30 |
<pre>url = GMaps.staticMapURL({ |
|
31 |
size: [610, 350], |
|
32 |
lat: -12.043333, |
|
33 |
lng: -77.028333 |
|
34 |
}); |
|
35 |
|
|
36 |
$('<img/>').attr('src', url) |
|
37 |
.appendTo('#map');</pre> |
|
38 |
<p>You must define a <strong>size</strong> and the <strong>latitude</strong> and <strong>longitude</strong> of the map's center.</p> |
|
39 |
<p><span class="label notice">Note: </span> You also can define <strong>zoom</strong> (by default is 15, unless zoom is set to false, in which case Google will set zoom based on marker positions).</p> |
|
40 |
</div> |
|
41 |
</div> |
|
42 |
</body> |
|
43 |
</html> |