提交 | 用户 | 时间
|
58d006
|
1 |
<!DOCTYPE html> |
A |
2 |
<html> |
|
3 |
<head> |
|
4 |
<meta charset="utf-8"> |
|
5 |
<title>GMaps.js — Overlays</title> |
|
6 |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> |
|
7 |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> |
|
8 |
<script type="text/javascript" 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 type="text/javascript"> |
|
12 |
var map; |
|
13 |
$(document).ready(function(){ |
|
14 |
map = new GMaps({ |
|
15 |
el: '#map', |
|
16 |
lat: -12.043333, |
|
17 |
lng: -77.028333 |
|
18 |
}); |
|
19 |
map.drawOverlay({ |
|
20 |
lat: map.getCenter().lat(), |
|
21 |
lng: map.getCenter().lng(), |
|
22 |
layer: 'overlayLayer', |
|
23 |
content: '<div class="overlay">Lima<div class="overlay_arrow above"></div></div>', |
|
24 |
verticalAlign: 'top', |
|
25 |
horizontalAlign: 'center' |
|
26 |
}); |
|
27 |
}); |
|
28 |
</script> |
|
29 |
</head> |
|
30 |
<body> |
|
31 |
<h1>GMaps.js — Overlays</h1> |
|
32 |
<div class="row"> |
|
33 |
<div class="span11"> |
|
34 |
<div id="map"></div> |
|
35 |
</div> |
|
36 |
<div class="span6"> |
|
37 |
<p>You can add overlays using:</p> |
|
38 |
<pre>map.drawOverlay({ |
|
39 |
lat: -12.043333, |
|
40 |
lng: -77.028333, |
|
41 |
content: '<div class="overlay">Lima</div>' |
|
42 |
});</pre> |
|
43 |
<p>You must define <strong>latitude</strong>, <strong>longitude</strong> and the <strong>content</strong> of the map overlay.</p> |
|
44 |
<p><span class="label notice">Note: </span>Also, you must define a <strong>height</strong> to the <strong>content</strong>.</p> |
|
45 |
<p><span class="label notice">Note: </span>Also, you can define a <code>verticalAlign</code>, which can be <code>top</code>, <code>middle</code> or <code>bottom</code>, and <code>horizontalAlign</code>, which can be <code>left</code>, <code>center</code> or <code>right</code>.</p> |
|
46 |
</div> |
|
47 |
</div> |
|
48 |
</body> |
|
49 |
</html> |