This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlayerswitcher.html
65 lines (65 loc) · 2.14 KB
/
layerswitcher.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
60
61
62
63
64
65
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol-debug.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../bower_components/angular-openlayers-directive/dist/angular-openlayers-directive.js"></script>
<script src="../dist/angular-openlayers-layerswitcher.js"></script>
<script>
var app = angular.module("demoapp", ['openlayers-directive', 'openlayers-layerswitcher']);
app.controller('Controller', ['$scope', function($scope) {
$scope.layers = [
{
name: 'Italy',
group: 'Other',
source: {
type: 'GeoJSON',
url: 'json/ITA.geo.json'
}
},
{
name: 'France',
group: 'GeoJSON',
source: {
type: 'GeoJSON',
url: 'json/FRA.geo.json'
}
},
{
name: 'Spain',
group: 'GeoJSON',
source: {
type: 'GeoJSON',
url: 'json/ESP.geo.json'
}
},
{
name: 'Lisbon',
group: 'GeoJSON',
source: {
type: 'GeoJSON',
url: 'json/LIS.geo.json'
}
},
{
name: 'OSM',
group: 'base',
source: {
type: 'OSM'
}
}
]
}])
</script>
<link rel="stylesheet" href="../dist/angular-openlayers-layerswitcher.css" />
<link rel="stylesheet" href="layerswitcher.css" />
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
</head>
<body ng-controller="Controller">
<openlayers height="100%" custom-layers="true">
<layer-switcher></layer-switcher>
<ol-layer ol-layer-properties="layer" ng-repeat="layer in layers"></ol-layer>
</openlayers>
</body>
</html>