Commit 429786996870504377312c2074532f25c99fcf6a
1 parent
e196b9b743
Exists in
master
live flight tracking data
Showing
5 changed files
with
304 additions
and
25 deletions
Show diff stats
app/index.html
... | ... | @@ -144,7 +144,7 @@ |
144 | 144 | |
145 | 145 | <script src="jvectormap-204/jquery-jvectormap-2.0.4.min.js"></script> |
146 | 146 | <script src="jvectormap-204/jquery-jvectormap-us-lcc.js"></script> |
147 | - | |
147 | + <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA4aXZZ3R6cVjF_2cVYP7oeY2F5KwT6KaY"></script> | |
148 | 148 | <!-- Controllers --> |
149 | 149 | <script src="js/app.js"></script> |
150 | 150 | <script src="js/app.constant.js"></script> |
... | ... | @@ -159,6 +159,7 @@ |
159 | 159 | <script src="partials/fuelManager/fuelManager.controller.js"></script> |
160 | 160 | <script src="partials/pricing/pricing.controller.js"></script> |
161 | 161 | <script src="partials/reports/reports.controller.js"></script> |
162 | + <script src="partials/flightTracking/flightTracking.controller.js"></script> | |
162 | 163 | <script src="partials/scheduler/scheduler.controller.js"></script> |
163 | 164 | <script src="partials/signup/signup.controller.js"></script> |
164 | 165 | <script src="partials/updateFuelManager/updateFuelManager.controller.js"></script> |
... | ... | @@ -180,7 +181,7 @@ |
180 | 181 | <script src="partials/enterFuelOrder/enterFuelOrder.controller.js"></script> |
181 | 182 | <script src="partials/flightDepOrders/flightDepOrders.controller.js"></script> |
182 | 183 | <script src="partials/flightDepDashboard/flightDepDashboard.controller.js"></script> |
183 | - | |
184 | + <script src="partials/flightTracking/flightTracking.service.js"></script> | |
184 | 185 | <script src="partials/main/main.controller.js"></script> |
185 | 186 | <div ui-view></div> |
186 | 187 | <!-- End controllers --> | ... | ... |
app/partials/flightTracking/flightTracking.controller.js
... | ... | @@ -2,9 +2,180 @@ |
2 | 2 | |
3 | 3 | angular.module('acufuel') |
4 | 4 | |
5 | -.controller('flightTrackingController', ['$scope','$compile', 'uiCalendarConfig', 'flightTrackingService', function($scope, $compile, uiCalendarConfig, flightTrackingService) { | |
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 | + }; | |
6 | 62 | |
7 | - | |
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 | + } | |
8 | 77 | |
78 | + google.maps.event.addDomListener(window, 'load', initialize); | |
79 | + | |
80 | +}]);*/ | |
81 | + | |
82 | + ////--------------Shadow Code---------------------- | |
83 | + | |
84 | + $scope.flightInfo = {}; | |
85 | + var map; | |
86 | + var icon = "https://en.spitogatos.gr/visualCaptcha/images/airplane.png"; | |
87 | + var json = "http://34.214.139.94:8080/ws/liveTracking"; | |
88 | + var arr = []; | |
89 | + var infowindow = new google.maps.InfoWindow(); | |
90 | + init(); | |
91 | + function initialize() { | |
92 | + var mapProp = { | |
93 | + center: new google.maps.LatLng(36.778259, -98.417931), //US | |
94 | + zoom: 4, | |
95 | + mapTypeId: google.maps.MapTypeId.ROADMAP | |
96 | + }; | |
97 | + | |
98 | + map = new google.maps.Map(document.getElementById("map"), mapProp); | |
99 | + console.log('sssssssss', map); | |
100 | + | |
101 | + | |
102 | + setInterval(function(){ | |
103 | + $.get(json, function(json1) { | |
104 | + $.each(json1, function(key, data) { | |
105 | + var exists = false; | |
106 | + $.each(arr, function (index, value) { | |
107 | + if(value.title === data.id) { | |
108 | + var latLng = new google.maps.LatLng(data.latitude, data.longitude, data.altitude); | |
109 | + value.link.setPosition(latLng); | |
110 | + exists = true; | |
111 | + } | |
112 | + }); | |
113 | + if(!exists) { | |
114 | + var latLng = new google.maps.LatLng(data.latitude, data.longitude, data.altitude); | |
115 | + | |
116 | + var marker = new google.maps.Marker({ | |
117 | + position: latLng, | |
118 | + map: map, | |
119 | + icon: icon, | |
120 | + title: data.id | |
121 | + }); | |
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>"; | |
123 | + var details = "Aircraft :" + " " + data.id + "<br> " + | |
124 | + "Path :" + " " + data.departurePoint + " " + "--->" + " " + data.arrivalPoint + "<br>" + | |
125 | + "Altitude :" + " " + data.altitude + " " + "ft" + "<br>" + | |
126 | + "Speed :" + " " + data.speed + " " + "Knots" + "<br>" + | |
127 | + "Departure Time :" + " " + data.departureActualTime + " " + "(Actual)" + "<br>" + | |
128 | + "Arrival Time :" + " " + data.arrivalEstimatedTime + " " + "(Estimated)" + "<br>"; | |
129 | + | |
130 | + arr.push({ | |
131 | + title: data.id, | |
132 | + link: marker, | |
133 | + details : details | |
134 | + }); | |
135 | + | |
136 | + bindInfoWindow(marker, map, infowindow, details, data); | |
137 | + // bindInfoWindow(marker,map,infowindow,html); | |
138 | + } | |
139 | + }); | |
140 | + }); | |
141 | + },5000); | |
142 | + } | |
143 | + | |
144 | + function bindInfoWindow(marker, map, infowindow, strDescription, data) { | |
145 | + 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 | + | |
166 | + }); | |
167 | + } | |
168 | + | |
169 | + $('.close-left-panel').click(function(){ | |
170 | + $('.left-panel').animate({width: '0', padding: '0'}); | |
171 | + }) | |
172 | + | |
173 | + | |
174 | + function init(){ | |
175 | + google.maps.event.addDomListener(window, 'load', initialize); | |
176 | + } | |
177 | + | |
9 | 178 | }]); |
10 | 179 | |
180 | + | |
181 | + | |
11 | 182 | \ No newline at end of file | ... | ... |
app/partials/flightTracking/flightTracking.html
1 | 1 | <style> |
2 | - .subnavbar .mainnav > li:nth-child(3) > a{ | |
2 | + .subnavbar .mainnav > li:nth-child(6) > a{ | |
3 | 3 | color: #ff9900; |
4 | 4 | } |
5 | + | |
6 | + #map { | |
7 | + height: 100%; | |
8 | + width: 100%; | |
9 | + margin: 0px; | |
10 | + padding: 0px | |
11 | + } | |
5 | 12 | |
6 | 13 | .button1 { |
7 | 14 | display: inline-block; |
... | ... | @@ -68,7 +75,52 @@ |
68 | 75 | .button1.turquoise { |
69 | 76 | background: #449d44; |
70 | 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 | + | |
71 | 121 | </style> |
122 | + | |
123 | + | |
72 | 124 | |
73 | 125 | <div class="main"> |
74 | 126 | <div class="container"> |
... | ... | @@ -76,15 +128,50 @@ |
76 | 128 | <div class="col-md-12"> |
77 | 129 | <div class="widget stacked "> |
78 | 130 | <div class="widget-content" style="min-height: 500px"> |
79 | - <h3>Coming Soon</h3> | |
80 | - <!-- /widget-content --> | |
81 | - </div> | |
82 | - <!-- /widget --> | |
83 | - </div> | |
84 | - <!-- /span8 --> | |
85 | - </div> | |
86 | - <!-- /row --> | |
87 | - </div> | |
88 | - <!-- /container --> | |
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 | 174 | </div> |
90 | -<!-- /main --> | |
91 | 175 | \ No newline at end of file |
176 | +<!-- /main --> | |
177 | + | |
178 | + | ... | ... |
app/partials/main/main.controller.js
... | ... | @@ -3,11 +3,31 @@ |
3 | 3 | 'use strict' |
4 | 4 | |
5 | 5 | angular.module('acufuel') |
6 | - .controller('MainController', [ '$scope', '$filter', '$rootScope', '$state', MainController]); | |
6 | + .controller('MainController', [ '$scope', '$filter','$rootScope','$state', '$window', MainController]); | |
7 | 7 | |
8 | - function MainController($scope, $filter, $rootScope, $state) { | |
8 | + function MainController($scope, $filter, $rootScope,$state, $window) { | |
9 | 9 | |
10 | 10 | $scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName')); |
11 | + console.log("$state====",$state) | |
12 | + | |
13 | + $scope.reloadPage = function(){ | |
14 | + console.log("if",$state) | |
15 | + console.log("=========state name",$state.current.name); | |
16 | + // $state.go('app.flightTracking', {}, {reload: 'app.flightTracking'}) | |
17 | + //$state.go($state.current, {}, {reload: true}); | |
18 | + | |
19 | + if($state.current.name != "app.flightTracking"){ | |
20 | + $window.location.href = '/#!/flightTracking'; | |
21 | + setInterval(function(){ | |
22 | + console.log("come") | |
23 | + $window.location.reload() | |
24 | + },10); | |
25 | + }else{ | |
26 | + console.log("flight tracking state found====="); | |
27 | + $window.location.reload(); | |
28 | + } | |
29 | + } | |
11 | 30 | } |
12 | 31 | })(); |
13 | - | |
32 | +// | |
33 | +// | |
14 | 34 | \ No newline at end of file | ... | ... |
app/partials/main/main.html
... | ... | @@ -62,14 +62,14 @@ |
62 | 62 | <li class="dropdown-submenu"> |
63 | 63 | <a tabindex="-1" >Tax Manager</a> |
64 | 64 | <ul class="dropdown-menu"> |
65 | - <li><a tabindex="-1" ui-sref="app.taxes">Federal Taxes</a></li> | |
66 | - <li><a ui-sref="app.taxes">State & Country Taxes</a></li> | |
67 | - <li><a ui-sref="app.taxes">Airport Taxes</a></li> | |
65 | + <li><a tabindex="-1" ui-sref="app.taxes" href="#/taxes">Federal Taxes</a></li> | |
66 | + <li><a ui-sref="app.taxes" href="#/taxes">State & Country Taxes</a></li> | |
67 | + <li><a ui-sref="app.taxes" href="#/taxes">Airport Taxes</a></li> | |
68 | 68 | </ul> |
69 | 69 | </li> |
70 | 70 | <li ng-if="isAuthenticated"> |
71 | - <a ui-sref="app.fuelOrders"> | |
72 | - <span>Fuel Orders</span> | |
71 | + <a ui-sref="app.fuelOrders" href="#/fuelOrders"> | |
72 | + Fuel Orders | |
73 | 73 | </a> |
74 | 74 | </li> |
75 | 75 | </ul> |
... | ... | @@ -108,7 +108,7 @@ |
108 | 108 | </ul> |
109 | 109 | </li> |
110 | 110 | <li ng-if="isAuthenticated"> |
111 | - <a ui-sref="app.flightTracking"> | |
111 | + <a ui-sref="app.flightTracking()" ng-click="reloadPage()" data-ui-sref-opts="{reload:false}" > | |
112 | 112 | <i class="fa fa-plane"></i> |
113 | 113 | <span>Flight Tracking</span> |
114 | 114 | </a> | ... | ... |