-
Notifications
You must be signed in to change notification settings - Fork 632
/
Copy path0205-layers-googlemaps-example.html
55 lines (55 loc) · 2.25 KB
/
0205-layers-googlemaps-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
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/leaflet/dist/leaflet.js"></script><script src="../bower_components/angular-simple-logger/dist/index.js"></script>
<script src="../bower_components/leaflet-plugins/layer/tile/Google.js"></script>
<script src="../dist/angular-leaflet-directive.min.js"></script>
<link rel="stylesheet" href="../bower_components/leaflet/dist/leaflet.css" />
<script>
var app = angular.module("demoapp", ["leaflet-directive"]);
app.controller("GoogleMapsController", [ "$scope", function($scope) {
angular.extend($scope, {
berlin: {
lat: 52.52,
lng: 13.40,
zoom: 14
},
markers: {
m1: {
lat: 52.52,
lng: 13.40
}
},
layers: {
baselayers: {
googleTerrain: {
name: 'Google Terrain',
layerType: 'TERRAIN',
type: 'google'
},
googleHybrid: {
name: 'Google Hybrid',
layerType: 'HYBRID',
type: 'google'
},
googleRoadmap: {
name: 'Google Streets',
layerType: 'ROADMAP',
type: 'google'
}
}
}
});
}]);
</script>
</head>
<body ng-controller="GoogleMapsController">
<leaflet center="berlin" layers="layers" markers="markers" height="480px" width="100%"></leaflet>
<h1>Google maps example</h1>
<p>Use the Layer Switch Control on the top rigth of the map to select another Google Maps Layer.</p>
</body>
</html>