Commit f9e936a9dec8c954fceb75cae8e5c56af5e8772c
1 parent
19eace1cf6
Exists in
master
minor fixes
Showing
2 changed files
with
66 additions
and
5 deletions
Show diff stats
app/partials/flightTracking/flightTracking.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | angular.module('acufuel') | 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 | 6 | $scope.flightInfo = {}; | |
7 | var map; | 7 | var map; |
8 | var icon = "https://en.spitogatos.gr/visualCaptcha/images/airplane.png"; | 8 | var icon = "https://en.spitogatos.gr/visualCaptcha/images/airplane.png"; |
9 | var json = "http://34.214.139.94:8080/ws/liveTracking"; | 9 | var json = "http://34.214.139.94:8080/ws/liveTracking"; |
10 | var arr = []; | 10 | var arr = []; |
11 | var infowindow = new google.maps.InfoWindow(); | 11 | var infowindow = new google.maps.InfoWindow(); |
12 | 12 | ||
13 | $scope.initialise = function() { | 13 | $scope.initialise = function() { |
14 | var mapProp = { | 14 | var mapProp = { |
15 | center: new google.maps.LatLng(36.778259, -98.417931), //LLANDRINDOD WELLS | 15 | center: new google.maps.LatLng(36.778259, -98.417931), //LLANDRINDOD WELLS |
16 | zoom: 4, | 16 | zoom: 4, |
17 | mapTypeId: google.maps.MapTypeId.ROADMAP | 17 | mapTypeId: google.maps.MapTypeId.ROADMAP |
18 | }; | 18 | }; |
19 | 19 | ||
20 | map = new google.maps.Map(document.getElementById("map"), mapProp); | 20 | map = new google.maps.Map(document.getElementById("map"), mapProp); |
21 | console.log('sssssssss', json); | 21 | console.log('sssssssss', json); |
22 | 22 | ||
23 | setInterval(function(){ | 23 | setInterval(function(){ |
24 | $.get(json, function(json1) { | 24 | $.get(json, function(json1) { |
25 | $.each(json1, function(key, data) { | 25 | $.each(json1, function(key, data) { |
26 | var exists = false; | 26 | var exists = false; |
27 | $.each(arr, function (index, value) { | 27 | $.each(arr, function (index, value) { |
28 | if(value.title === data.id) { | 28 | if(value.title === data.id) { |
29 | var latLng = new google.maps.LatLng(data.latitude, data.longitude, data.altitude); | 29 | var latLng = new google.maps.LatLng(data.latitude, data.longitude, data.altitude); |
30 | value.link.setPosition(latLng); | 30 | value.link.setPosition(latLng); |
31 | exists = true; | 31 | exists = true; |
32 | } | 32 | } |
33 | }); | 33 | }); |
34 | if(!exists) { | 34 | if(!exists) { |
35 | var latLng = new google.maps.LatLng(data.latitude, data.longitude, data.altitude); | 35 | var latLng = new google.maps.LatLng(data.latitude, data.longitude, data.altitude); |
36 | 36 | ||
37 | var marker = new google.maps.Marker({ | 37 | var marker = new google.maps.Marker({ |
38 | position: latLng, | 38 | position: latLng, |
39 | map: map, | 39 | map: map, |
40 | icon: icon, | 40 | icon: icon, |
41 | title: data.id | 41 | title: data.id |
42 | }); | 42 | }); |
43 | 43 | ||
44 | var details = "Aircraft :" + " " + data.id + "<br> " + | 44 | var details = "Aircraft :" + " " + data.id + "<br> " + |
45 | "Path :" + " " + data.departurePoint + " " + "--->" + " " + data.arrivalPoint + "<br>" + | 45 | "Path :" + " " + data.departurePoint + " " + "--->" + " " + data.arrivalPoint + "<br>" + |
46 | "Altitude :" + " " + data.altitude + " " + "ft" + "<br>" + | 46 | "Altitude :" + " " + data.altitude + " " + "ft" + "<br>" + |
47 | "Speed :" + " " + data.speed + " " + "Knots" + "<br>" + | 47 | "Speed :" + " " + data.speed + " " + "Knots" + "<br>" + |
48 | "Departure Time :" + " " + data.departureActualTime + " " + "(Actual)" + "<br>" + | 48 | "Departure Time :" + " " + data.departureActualTime + " " + "(Actual)" + "<br>" + |
49 | "Arrival Time :" + " " + data.arrivalEstimatedTime + " " + "(Estimated)" + "<br>"; | 49 | "Arrival Time :" + " " + data.arrivalEstimatedTime + " " + "(Estimated)" + "<br>"; |
50 | 50 | ||
51 | arr.push({ | 51 | arr.push({ |
52 | title: data.id, | 52 | title: data.id, |
53 | link: marker, | 53 | link: marker, |
54 | details : details | 54 | details : details |
55 | }); | 55 | }); |
56 | 56 | ||
57 | bindInfoWindow(marker, map, infowindow, details); | 57 | bindInfoWindow(marker, map, infowindow, details, data); |
58 | } | 58 | } |
59 | }); | 59 | }); |
60 | }); | 60 | }); |
61 | },5000); | 61 | },5000); |
62 | } | 62 | } |
63 | 63 | ||
64 | function bindInfoWindow(marker, map, infowindow, strDescription) { | 64 | function bindInfoWindow(marker, map, infowindow, strDescription, data) { |
65 | google.maps.event.addListener(marker, 'click', function() { | 65 | google.maps.event.addListener(marker, 'click', function() { |
66 | infowindow.setContent(strDescription); | 66 | $scope.flightInfo = data; |
67 | infowindow.open(map, marker); | 67 | //infowindow.setContent(strDescription); |
68 | //infowindow.open(map, marker); | ||
69 | $scope.flightInfo = data; | ||
70 | $('#flightid').html($scope.flightInfo.id); | ||
71 | $('#depid').html($scope.flightInfo.departurePoint); | ||
72 | $('#arrid').html($scope.flightInfo.arrivalPoint); | ||
73 | $('#altid').html($scope.flightInfo.altitude); | ||
74 | $('#speedid').html($scope.flightInfo.speed); | ||
75 | $('#deptimeid').html($scope.flightInfo.departureActualTime); | ||
76 | $('#arrtimeid').html($scope.flightInfo.arrivalEstimatedTime); | ||
77 | |||
78 | $('.left-panel').animate({width: '300px', padding: '10px'}); | ||
68 | }); | 79 | }); |
69 | } | 80 | } |
70 | 81 | ||
82 | $('.close-left-panel').click(function(){ | ||
83 | $('.left-panel').animate({width: '0', padding: '0'}); | ||
84 | }) | ||
85 | |||
71 | google.maps.event.addDomListener(document.getElementById("map"), 'load', $scope.initialise()); | 86 | google.maps.event.addDomListener(document.getElementById("map"), 'load', $scope.initialise()); |
72 | 87 | ||
73 | 88 | ||
74 | 89 | ||
75 | 90 | ||
76 | 91 | ||
77 | 92 | ||
78 | 93 | ||
79 | 94 | ||
80 | }]); | 95 | }]); |
81 | 96 | ||
82 | 97 |
app/partials/flightTracking/flightTracking.html
1 | <style> | 1 | <style> |
2 | .subnavbar .mainnav > li:nth-child(6) > a{ | 2 | .subnavbar .mainnav > li:nth-child(6) > a{ |
3 | color: #ff9900; | 3 | color: #ff9900; |
4 | } | 4 | } |
5 | 5 | ||
6 | #map { | 6 | #map { |
7 | height: 100%; | 7 | height: 100%; |
8 | width: 100%; | 8 | width: 100%; |
9 | margin: 0px; | 9 | margin: 0px; |
10 | padding: 0px | 10 | padding: 0px |
11 | } | 11 | } |
12 | 12 | ||
13 | .button1 { | 13 | .button1 { |
14 | display: inline-block; | 14 | display: inline-block; |
15 | height: 35px; | 15 | height: 35px; |
16 | line-height: 35px; | 16 | line-height: 35px; |
17 | padding-right: 15px; | 17 | padding-right: 15px; |
18 | padding-left: 50px; | 18 | padding-left: 50px; |
19 | position: relative; | 19 | position: relative; |
20 | background-color:rgb(41,127,184); | 20 | background-color:rgb(41,127,184); |
21 | color:rgb(255,255,255); | 21 | color:rgb(255,255,255); |
22 | text-decoration: none; | 22 | text-decoration: none; |
23 | text-transform: uppercase; | 23 | text-transform: uppercase; |
24 | letter-spacing: 1px; | 24 | letter-spacing: 1px; |
25 | margin-bottom: 15px; | 25 | margin-bottom: 15px; |
26 | border: 0; | 26 | border: 0; |
27 | 27 | ||
28 | 28 | ||
29 | border-radius: 5px; | 29 | border-radius: 5px; |
30 | -moz-border-radius: 5px; | 30 | -moz-border-radius: 5px; |
31 | -webkit-border-radius: 5px; | 31 | -webkit-border-radius: 5px; |
32 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); | 32 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); |
33 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; | 33 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; |
34 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); | 34 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); |
35 | 35 | ||
36 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 36 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
37 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 37 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
38 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 38 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
39 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; | 39 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; |
40 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); | 40 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); |
41 | } | 41 | } |
42 | 42 | ||
43 | .button1 span { | 43 | .button1 span { |
44 | position: absolute; | 44 | position: absolute; |
45 | left: 0; | 45 | left: 0; |
46 | top: 0; | 46 | top: 0; |
47 | width: 35px; | 47 | width: 35px; |
48 | background-color:rgba(0,0,0,0.5); | 48 | background-color:rgba(0,0,0,0.5); |
49 | 49 | ||
50 | -webkit-border-top-left-radius: 5px; | 50 | -webkit-border-top-left-radius: 5px; |
51 | -webkit-border-bottom-left-radius: 5px; | 51 | -webkit-border-bottom-left-radius: 5px; |
52 | -moz-border-radius-topleft: 5px; | 52 | -moz-border-radius-topleft: 5px; |
53 | -moz-border-radius-bottomleft: 5px; | 53 | -moz-border-radius-bottomleft: 5px; |
54 | border-top-left-radius: 5px; | 54 | border-top-left-radius: 5px; |
55 | border-bottom-left-radius: 5px; | 55 | border-bottom-left-radius: 5px; |
56 | border-right: 1px solid rgba(0,0,0,0.15); | 56 | border-right: 1px solid rgba(0,0,0,0.15); |
57 | } | 57 | } |
58 | 58 | ||
59 | .button1:hover span, .button1.active span { | 59 | .button1:hover span, .button1.active span { |
60 | background-color:rgb(0,102,26); | 60 | background-color:rgb(0,102,26); |
61 | border-right: 1px solid rgba(0,0,0,0.3); | 61 | border-right: 1px solid rgba(0,0,0,0.3); |
62 | } | 62 | } |
63 | 63 | ||
64 | .button1:active { | 64 | .button1:active { |
65 | margin-top: 2px; | 65 | margin-top: 2px; |
66 | margin-bottom: 13px; | 66 | margin-bottom: 13px; |
67 | 67 | ||
68 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 68 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
69 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 69 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
70 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 70 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
71 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; | 71 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; |
72 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); | 72 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); |
73 | } | 73 | } |
74 | 74 | ||
75 | .button1.turquoise { | 75 | .button1.turquoise { |
76 | background: #449d44; | 76 | background: #449d44; |
77 | } | 77 | } |
78 | |||
79 | /** style for popup sidebar **/ | ||
80 | .left-panel{ | ||
81 | width: 0; | ||
82 | height: 100%; | ||
83 | position: absolute; | ||
84 | top: 1; | ||
85 | background-color: White; | ||
86 | overflow-x: hidden; | ||
87 | left: 2px; | ||
88 | padding: 0; | ||
89 | border-radius: 4px 0 0 4px; | ||
90 | } | ||
91 | .left-panel table th, td{ | ||
92 | padding: 10px 0; | ||
93 | } | ||
78 | </style> | 94 | </style> |
79 | 95 | ||
80 | 96 | ||
81 | 97 | ||
82 | 98 | ||
83 | <div class="main"> | 99 | <div class="main"> |
84 | <div class="container"> | 100 | <div class="container"> |
85 | <div class="row"> | 101 | <div class="row"> |
86 | <div class="col-md-12"> | 102 | <div class="col-md-12"> |
87 | <div class="widget stacked "> | 103 | <div class="widget stacked "> |
88 | <div class="widget-content" style="min-height: 500px"> | 104 | <div class="widget-content" style="min-height: 500px"> |
89 | <div id="map" style="border: 2px solid #3872ac;"></div> | 105 | <div id="map" style="border: 2px solid #3872ac;"></div> |
106 | <div class="left-panel"> | ||
107 | <span class="close-left-panel" style="float:right;"><img src="img/back.png"/></span> | ||
108 | <br><br><br><br> | ||
109 | <h1>Aircraft </h1> | ||
110 | <h2><p id="flightid"></p></h2> | ||
111 | <table class="table-responsive table-striped" style="border-collapse: separate;border-spacing: 2px 2px;"> | ||
112 | <tbody> | ||
113 | <tr> | ||
114 | <td>Path: </td> | ||
115 | <td class="text-nowrap"><strong><span id="depid"/> <span class="glyphicon glyphicon-arrow-right"></span> <span id="arrid"/></strong></td> | ||
116 | </tr> | ||
117 | <tr> | ||
118 | <td>Altitude: </td> | ||
119 | <td class="text-nowrap"><strong><span id="altid"/> ft </strong></td> | ||
120 | </tr> | ||
121 | <tr> | ||
122 | <td>Speed: </td> | ||
123 | <td class="text-nowrap"><strong><span id="speedid"/> Knots</strong></td> | ||
124 | </tr> | ||
125 | <tr> | ||
126 | <td>Departure Time : </td> | ||
127 | <td><strong><span id="deptimeid"/><span class="text-muted">(Actual)</span></strong></td> | ||
128 | </tr> | ||
129 | <tr> | ||
130 | <td>Arrival Time : </td> | ||
131 | <td><strong><span id="arrtimeid"/><span class="text-muted">(Estimated)</span></strong></td> | ||
132 | </tr> | ||
133 | </tbody> | ||
134 | </table> | ||
135 | </div> | ||
90 | 136 | ||
91 | <!-- /widget-content --> | 137 | <!-- /widget-content --> |
92 | </div> | 138 | </div> |
93 | <!-- /widget --> | 139 | <!-- /widget --> |
94 | </div> | 140 | </div> |
95 | <!-- /span8 --> | 141 | <!-- /span8 --> |
96 | </div> | 142 | </div> |
97 | <!-- /row --> | 143 | <!-- /row --> |
98 | </div> | 144 | </div> |
99 | <!-- /container --> | 145 | <!-- /container --> |
100 | </div> | 146 | </div> |
101 | 147 | ||
102 | <!-- /main --> | 148 | <!-- /main --> |