forked from broady/osm-layer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
45 lines (42 loc) · 1.15 KB
/
example.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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>OSM Base Map</title>
<style type="text/css">
html, body, #map {
width: 100%; height: 100%; margin: 0; padding: 0;
}
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="osm.js"></script>
<script type="text/javascript">
function initialize() {
var map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
new OSMBase.Attribution(map);
map.mapTypes.set('osm', new OSMBase());
map.setMapTypeId('osm');
var mapTypeIds = ['osm'];
for (var name in google.maps.MapTypeId) {
var id = google.maps.MapTypeId[name];
if (id.indexOf('_') == -1) {
mapTypeIds.push(id);
}
}
map.setOptions({
mapTypeControlOptions: {
mapTypeIds: mapTypeIds
}
});
}
</script>
</head>
<body onload="initialize()">
<div id="map"></div>
</body>
</html>