-
Notifications
You must be signed in to change notification settings - Fork 132
/
leaflet.html
61 lines (53 loc) · 1.74 KB
/
leaflet.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mapstraction Examples - leaflet</title>
<link href="http://leaflet.cloudmade.com/dist/leaflet.css" media="all" rel="stylesheet" type="text/css" />
<!--[if lte IE 8]><link rel="stylesheet" href="http://leaflet.cloudmade.com/dist/leaflet.ie.css" /><![endif]-->
<script src="http://leaflet.cloudmade.com/dist/leaflet.js" type="text/javascript"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script src="../source/mxn.js?(leaflet)" type="text/javascript"></script>
<style type="text/css">
#mapdiv {
height: 400px;
}
</style>
<script type="text/javascript">
//<![CDATA[
function initialize() {
// create mxn object
map = new mxn.Mapstraction('mapdiv', 'leaflet');
map.addTileLayer("http://{s}.google.com/vt/?hl=en&x={x}&y={y}&z={z}&s={s}", {
name: "Street",
attribution: "Map data: Copyright Google, 2011",
subdomains: ['mt0','mt1','mt2','mt3']
});
latlon = new mxn.LatLonPoint(41.84756115424155,-91.70015573501587)
latlon2 = new mxn.LatLonPoint(41.88756115424155,-91.20015573501587)
// put map on page
map.setCenterAndZoom(latlon, 12);
// add a marker
marker = new mxn.Marker(latlon);
map.addMarker(marker);
marker.addData({'infoBubble': 'This is a popup'})
marker.openBubble();
// add a polyline
var pl = new mxn.Polyline([
latlon,
latlon2,
]);
pl.color = '#00DD55';
map.addPolyline(pl);
map.addSmallControls();
}
//]]>
</script>
</head>
<body onload="initialize();">
<center>
<table border='1' width='50%'>
<tr><td><div id="mapdiv"></div></td>
</tr>
</table>
</center>
</body>
</html>