Commit 2b4e85bad9038c4ddf4f917506f8c8db144c07be
1 parent
bfb1a2a461
Exists in
master
minor chages
Showing
3 changed files
with
31 additions
and
203 deletions
Show diff stats
app/partials/flightTracking/flightTracking.controller.js
... | ... | @@ -2,102 +2,24 @@ |
2 | 2 | |
3 | 3 | angular.module('acufuel') |
4 | 4 | |
5 | -.controller('flightTrackingController', ['$scope','$compile', 'uiCalendarConfig','flightTrackingService',function($scope, $compile, uiCalendarConfig,flightTrackingService) { | |
6 | - /*var map = null; | |
7 | - var icon = "https://en.spitogatos.gr/visualCaptcha/images/airplane.png"; | |
8 | - var json = "http://34.214.139.94:8080/ws/liveTracking"; | |
9 | - var gmarkers = []; | |
10 | - var intervalNumber = 0; | |
11 | - setInterval(function () { | |
12 | - $.get(json, function(json1) { | |
13 | - update_map(json1); | |
14 | - //intervalNumber++; | |
15 | - console.log('---------json1--------',json1); | |
16 | - }); | |
17 | - }, 5000); | |
18 | - | |
19 | - function update_map(data) { | |
20 | - var bounds = new google.maps.LatLngBounds(); | |
21 | - for (var i = 0; i < gmarkers.length; i++) { | |
22 | - gmarkers[i].setMap(null); | |
23 | - } | |
24 | - gmarkers = []; | |
25 | - for (var i = 0, length = data.length; i < length; i++) { | |
26 | - var latLng = new google.maps.LatLng(data[i].latitude, data[i].longitude); | |
27 | - bounds.extend(latLng); | |
28 | - var marker = new google.maps.Marker({ | |
29 | - position: latLng, | |
30 | - map: map, | |
31 | - icon: icon, | |
32 | - title: data[i].id | |
33 | - }); | |
34 | - | |
35 | - var details = "Aircraft :" + " " + data[i].id + "<br> " + | |
36 | - "Path :" + " " + data[i].departurePoint + " " + "--->" + " " + data[i].arrivalPoint + "<br>" + | |
37 | - "Altitude :" + " " + data[i].altitude + " " + "ft" + "<br>" + | |
38 | - "Speed :" + " " + data[i].speed + " " + "Knots" + "<br>" + | |
39 | - "Departure Time :" + " " + data[i].departureActualTime + " " + "(Actual)" + "<br>" + | |
40 | - "Arrival Time :" + " " + data[i].arrivalEstimatedTime + " " + "(Estimated)" + "<br>"; | |
41 | - | |
42 | - var infoWindow = new google.maps.InfoWindow(); | |
43 | - google.maps.event.addListener(marker, "click", function (e) { | |
44 | - //infoWindow.setContent(details); | |
45 | - inforWindow.setContent(data.id+"<br>"+ data.arrivalPoint); | |
46 | - infoWindow.open(map, marker); | |
47 | - }); | |
48 | - (function (marker, data) { | |
49 | - google.maps.event.addListener(marker, "click", function (e) { | |
50 | - //infoWindow.setContent(data.id+"<br>"+marker.getPosition().toUrlValue(6)); | |
51 | - infoWindow.setContent(data.id+"<br>"+ data.arrivalPoint); | |
52 | - infoWindow.open(map, marker); | |
53 | - }); | |
54 | - })(marker, data[i]); | |
55 | - gmarkers.push(marker); | |
56 | - //map.fitBounds(bounds); | |
57 | - } | |
58 | - | |
59 | - map.fitBounds(bounds); | |
60 | - // console.log('---------bounds show-------',bounds); | |
61 | - }; | |
62 | - | |
63 | - function initialize() { | |
64 | - var mapOptions = { | |
65 | - center: new google.maps.LatLng(37.4419, -120.1419), | |
66 | - zoom: 1, | |
67 | - mapTypeId: google.maps.MapTypeId.ROADMAP | |
68 | - }; | |
69 | - | |
70 | - map = new google.maps.Map(document.getElementById("map"),mapOptions); | |
71 | - if (gmarkers.length > 0) { | |
72 | - for (var i = 0; i < gmarkers.length; i++) { | |
73 | - gmarkers[i].setMap(map); | |
74 | - } | |
75 | - } | |
76 | - } | |
77 | - | |
78 | - google.maps.event.addDomListener(window, 'load', initialize); | |
79 | - | |
80 | -}]);*/ | |
5 | +.controller('flightTrackingController', ['$scope','$compile', 'uiCalendarConfig', 'flightTrackingService', function($scope, $compile, uiCalendarConfig, flightTrackingService) { | |
81 | 6 | |
82 | - ////--------------Shadow Code---------------------- | |
83 | - | |
84 | - $scope.flightInfo = {}; | |
85 | 7 | var map; |
86 | 8 | var icon = "https://en.spitogatos.gr/visualCaptcha/images/airplane.png"; |
87 | 9 | var json = "http://34.214.139.94:8080/ws/liveTracking"; |
88 | 10 | var arr = []; |
89 | 11 | var infowindow = new google.maps.InfoWindow(); |
12 | + | |
90 | 13 | init(); |
91 | 14 | function initialize() { |
92 | 15 | var mapProp = { |
93 | - center: new google.maps.LatLng(36.778259, -98.417931), //US | |
16 | + center: new google.maps.LatLng(36.778259, -98.417931), //LLANDRINDOD WELLS | |
94 | 17 | zoom: 4, |
95 | 18 | mapTypeId: google.maps.MapTypeId.ROADMAP |
96 | 19 | }; |
97 | 20 | |
98 | 21 | map = new google.maps.Map(document.getElementById("map"), mapProp); |
99 | - console.log('sssssssss', map); | |
100 | - | |
22 | + console.log('sssssssss', json); | |
101 | 23 | |
102 | 24 | setInterval(function(){ |
103 | 25 | $.get(json, function(json1) { |
... | ... | @@ -119,7 +41,7 @@ angular.module('acufuel') |
119 | 41 | icon: icon, |
120 | 42 | title: data.id |
121 | 43 | }); |
122 | - //var html = "<div id='info' style='overflow:hidden;line-height:15px;color:black;height:200px;width:225px;'><span style='font-weight:500;text-decoration:underline;font-size:13px;'>"+"Aircraft :" + " " + data.id +"</span><br><table style='color:black;font-size:12;'><tr><td>Path :</td><td>"+ data.departurePoint + " " + "--->" + " " + data.arrivalPoint + "</td></tr><tr><td>Altitude :</td><td>" + data.altitude + " " + "ft" + "</td></tr><tr><td>Speed :</td><td>" + data.speed + " " + "Knots" + "</td></tr><tr><td>Departure Time :</td><td>" + data.departureActualTime + " " + "(Actual)" + "</td></tr><tr><td>Arrival Time:</td><td>" + data.arrivalEstimatedTime + " " + "(Estimated)" + "</td></tr></table></div>"; | |
44 | + | |
123 | 45 | var details = "Aircraft :" + " " + data.id + "<br> " + |
124 | 46 | "Path :" + " " + data.departurePoint + " " + "--->" + " " + data.arrivalPoint + "<br>" + |
125 | 47 | "Altitude :" + " " + data.altitude + " " + "ft" + "<br>" + |
... | ... | @@ -133,49 +55,31 @@ angular.module('acufuel') |
133 | 55 | details : details |
134 | 56 | }); |
135 | 57 | |
136 | - bindInfoWindow(marker, map, infowindow, details, data); | |
137 | - // bindInfoWindow(marker,map,infowindow,html); | |
58 | + bindInfoWindow(marker, map, infowindow, details); | |
138 | 59 | } |
139 | 60 | }); |
140 | 61 | }); |
141 | 62 | },5000); |
142 | 63 | } |
143 | 64 | |
144 | - function bindInfoWindow(marker, map, infowindow, strDescription, data) { | |
65 | + function bindInfoWindow(marker, map, infowindow, strDescription) { | |
145 | 66 | google.maps.event.addListener(marker, 'click', function() { |
146 | - /*var effect='slide'; | |
147 | - var options= {direction: $('.left')}; | |
148 | - var duration = 500;*/ | |
149 | - | |
150 | - //infowindow.setContent(strDescription); | |
151 | - // infowindow.open(map, marker); | |
152 | - console.log('data', data); | |
153 | - $scope.flightInfo = data; | |
154 | - console.log('testing', $scope.flightInfo.id); | |
155 | - //values for HTML page | |
156 | - $('#flightid').html($scope.flightInfo.id); | |
157 | - $('#depid').html($scope.flightInfo.departurePoint); | |
158 | - $('#arrid').html($scope.flightInfo.arrivalPoint); | |
159 | - $('#altid').html($scope.flightInfo.altitude); | |
160 | - $('#speedid').html($scope.flightInfo.speed); | |
161 | - $('#deptimeid').html($scope.flightInfo.departureActualTime); | |
162 | - $('#arrtimeid').html($scope.flightInfo.arrivalEstimatedTime); | |
163 | - | |
164 | - $('.left-panel').animate({width: '300px', padding: '10px'}); | |
165 | - | |
67 | + infowindow.setContent(strDescription); | |
68 | + infowindow.open(map, marker); | |
166 | 69 | }); |
167 | 70 | } |
168 | 71 | |
169 | - $('.close-left-panel').click(function(){ | |
170 | - $('.left-panel').animate({width: '0', padding: '0'}); | |
171 | - }) | |
172 | - | |
173 | - | |
174 | 72 | function init(){ |
73 | + console.log('aaaaaa') | |
175 | 74 | google.maps.event.addDomListener(window, 'load', initialize); |
176 | 75 | } |
177 | 76 | |
77 | + | |
78 | + | |
79 | + | |
80 | + | |
81 | + | |
82 | + | |
83 | + | |
178 | 84 | }]); |
179 | 85 | |
180 | - | |
181 | - | |
182 | 86 | \ No newline at end of file | ... | ... |
app/partials/flightTracking/flightTracking.html
... | ... | @@ -75,103 +75,28 @@ |
75 | 75 | .button1.turquoise { |
76 | 76 | background: #449d44; |
77 | 77 | } |
78 | - | |
79 | - | |
80 | -#myDiv { | |
81 | - color:Green; | |
82 | - background-color:#eee; | |
83 | - border:2px solid #333; | |
84 | - display:none; | |
85 | - text-align:justify; | |
86 | -} | |
87 | -#myDiv p { | |
88 | - margin: 15px; | |
89 | - font-size: 0.917em; | |
90 | -} | |
91 | -/** Style for the cointainer **/ | |
92 | - #body { | |
93 | - clear: both; | |
94 | - margin: 0 auto; | |
95 | - max-width: 534px; | |
96 | -} | |
97 | -html, body { | |
98 | - background-color:White; | |
99 | -} | |
100 | -hr { | |
101 | - margin-bottom:40px; | |
102 | -} | |
103 | - | |
104 | -/** style for popup sidebar **/ | |
105 | -.left-panel{ | |
106 | - width: 0; | |
107 | - height: 100%; | |
108 | - position: absolute; | |
109 | - top: 1; | |
110 | - background-color: White; | |
111 | - overflow-x: hidden; | |
112 | - left: 2px; | |
113 | - padding: 0; | |
114 | - border-radius: 4px 0 0 4px; | |
115 | -} | |
116 | -.left-panel table th, td{ | |
117 | - padding: 10px 0; | |
118 | -} | |
119 | - | |
120 | - | |
121 | 78 | </style> |
122 | - | |
123 | 79 | |
80 | + | |
124 | 81 | |
82 | + | |
125 | 83 | <div class="main"> |
126 | 84 | <div class="container"> |
127 | 85 | <div class="row"> |
128 | 86 | <div class="col-md-12"> |
129 | 87 | <div class="widget stacked "> |
130 | 88 | <div class="widget-content" style="min-height: 500px"> |
131 | - <div id="map" style="border: 2px solid #3872ac;"> | |
132 | - | |
133 | - </div> | |
134 | - <!-- /widget-content --> | |
135 | - <div class="left-panel"> | |
136 | - <span class="close-left-panel" style="float:right;"><img src="img/back.png"/></span> | |
137 | - <br><br><br><br> | |
138 | - <h1>Aircraft </h1> | |
139 | - <h2><p id="flightid"></p></h2> | |
140 | - <table class="table-responsive table-striped" style="border-collapse: separate;border-spacing: 2px 2px;"> | |
141 | - <tbody><tr> | |
142 | - <td>Path: </td> | |
143 | - <td class="text-nowrap"><strong><span id="depid"/> <span class="glyphicon glyphicon-arrow-right"></span> <span id="arrid"/></strong></td> | |
144 | - </tr> | |
145 | - <tr> | |
146 | - <td>Altitude: </td> | |
147 | - <td class="text-nowrap"><strong><span id="altid"/> ft </strong></td> | |
148 | - </tr> | |
149 | - <tr> | |
150 | - <td>Speed: </td> | |
151 | - <td class="text-nowrap"><strong><span id="speedid"/> Knots</strong></td> | |
152 | - </tr> | |
153 | - <tr> | |
154 | - <td>Departure Time : </td> | |
155 | - <td><strong><span id="deptimeid"/><span class="text-muted">(Actual)</span></strong></td> | |
156 | - </tr> | |
157 | - <tr> | |
158 | - <td>Arrival Time : </td> | |
159 | - <td><strong><span id="arrtimeid"/><span class="text-muted">(Estimated)</span></strong></td> | |
160 | - </tr> | |
161 | - </tbody> | |
162 | - </table> | |
163 | - | |
164 | - </div> | |
165 | - </div> | |
166 | - <!-- /widget --> | |
167 | - </div> | |
168 | - <!-- /span8 --> | |
169 | - </div> | |
170 | - <!-- /row --> | |
171 | - </div> | |
172 | - <!-- /container --> | |
173 | - </div> | |
89 | + <div id="map" style="border: 2px solid #3872ac;"></div> | |
90 | + | |
91 | + <!-- /widget-content --> | |
92 | + </div> | |
93 | + <!-- /widget --> | |
94 | + </div> | |
95 | + <!-- /span8 --> | |
96 | + </div> | |
97 | + <!-- /row --> | |
98 | + </div> | |
99 | + <!-- /container --> | |
174 | 100 | </div> |
175 | -<!-- /main --> | |
176 | - | |
177 | 101 | |
102 | +<!-- /main --> | |
178 | 103 | \ No newline at end of file | ... | ... |
app/partials/main/main.controller.js