-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
137 lines (118 loc) · 4.05 KB
/
index.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html data-ng-app="angularApplication">
<head>
<title>Mappa Desio</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootswatch/3.2.0/sandstone/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<link href="angular.panels.min.css" rel="stylesheet" type="text/css">
<script src="https://maps.google.com/maps/api/js?libraries=placeses,visualization,drawing,geometry,places&key=AIzaSyDqrDjL6eFlE2Nho-BZ1ZYmfAxMAAgGrSo"></script>
<script src="https://code.angularjs.org/1.3.15/angular.min.js"></script>
<script src="ng-map.min.js"></script>
<script src="angular.panels.min.js"></script>
<style>
ng-map {
position:absolute;
width: 100%;
height: 100%;
}
.modal {
display: block;
z-index: -1;
}
.modal.fade.in {
z-index: 1050;
}
</style>
</head>
<body data-ng-controller="defaultController">
<ng-map map-type-control="true" map-type-control-options="{position:'TOP_CENTER'}" default-style="false" zoom="14" center="45.618600, 9.207690" >
<marker position="current" animation="Animation.BOUNCE" title="Tua posizione" icon="{url:'man.png'}"></marker>
<div ng-repeat="cat in pois" ng-if="cat.Visible===true">
<div ng-repeat="c in cat.Categories">
<marker ng-repeat="p in c.Locations"
position="{{p.Latitude}},{{p.Longitude}}" title="{{p.Address}}" id="POI_{{$index}}" on-click="leftOpen(event,p,c)"
icon="{
url:'{{c.Icon}}'
}"
>
</marker>
</div>
</div>
<custom-control id="title" position="TOP_LEFT" index="1">
<div style="padding: 10px;">
<h3><b>Città di Desio</b></h3>
<p>Punti di interesse</p>
<div ng-repeat="d in pois" style="padding: 5px;background-color: white;">
<label >
<input
type="checkbox"
name="DS_{{$index}}"
ng-model="d.Visible"
>{{d.Dataset}}
</label>
</div>
</div>
</custom-control>
<custom-control id="by" position="BOTTOM_LEFT" index="1">
<div style="padding: 10px;">Created by Paolo Fisco @ipersoft</div>
</custom-control>
<custom-control id="by" position="TOP_RIGHT" index="1">
<div ng-repeat="cat in pois" ng-if="cat.Visible===true">
<div ng-repeat="c in cat.Categories" style="padding: 5px;background-color: white;"><img ng-src="{{c.Icon}}" style="width:16px;height:16px">{{c.Category}}</div>
</div>
</custom-control>
</ng-map>
<div data-panels="true"></div>
<script>
var app = angular.module('angularApplication', ['angular.panels','ngMap']);
//add panels
app.config(['panelsProvider','$windowProvider', function (panelsProvider,$windowProvider) {
var $window = $windowProvider.$get();
var sizePanel="";
if ($window.innerWidth<400) {
sizePanel="80%"
}
else
{
sizePanel="400px"
}
panelsProvider
.add({
id: 'panel',
position: 'left',
size:sizePanel,
templateUrl: 'https://mappadesio.infocitta.info/panel.html',
controller: 'leftCtrl'
})
;
}]);
//default controller
app.controller('defaultController', ['$scope', 'panels','NgMap','$http','$window', function ($scope, panels,NgMap,$http,$window) {
NgMap.getMap().then(function(map) {
$scope.map = map;
});
$http.get("https://mappadesio.infocitta.info/poi.json")
.then(function(response) {
$scope.pois = response.data;
});
$scope.showPOI = function(event, poi) {
$scope.selectedPOI = poi;
panels.open("panel");
//$scope.map.showInfoWindow('myInfoWindow', this);
};
$scope.leftOpen = function (event,poi,cat) {
$scope.$broadcast('leftHello',poi,cat);
};
}]);
//left panel controller
app.controller('leftCtrl', ['$scope', 'panels', function ($scope, panels) {
$scope.$on('leftHello', function(event, poi,cat) {
$scope.selectedPOI = poi;
$scope.selectedCAT = cat;
panels.open("panel");
});
}]);
</script>
</body>
</html>