Fix map checkout call (#394)
This commit is contained in:
parent
d68d8791bd
commit
4ac781a20d
@ -47,7 +47,7 @@ acars:
|
|||||||
created_at: now
|
created_at: now
|
||||||
updated_at: now
|
updated_at: now
|
||||||
- id: acars_6
|
- id: acars_6
|
||||||
pirep_id: pirepid_1
|
pirep_id: b68R5gwVzpVe
|
||||||
type: 1
|
type: 1
|
||||||
nav_type: 2
|
nav_type: 2
|
||||||
name: SIE
|
name: SIE
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"/assets/frontend/js/app.js": "/assets/frontend/js/app.js?id=eccdf193a37c5af46fd3",
|
"/assets/frontend/js/app.js": "/assets/frontend/js/app.js?id=88270e919809fead277c",
|
||||||
"/assets/frontend/css/now-ui-kit.css": "/assets/frontend/css/now-ui-kit.css?id=b2dd2a0a882054cad3d5",
|
"/assets/frontend/css/now-ui-kit.css": "/assets/frontend/css/now-ui-kit.css?id=b2dd2a0a882054cad3d5",
|
||||||
"/assets/admin/css/vendor.min.css": "/assets/admin/css/vendor.min.css?id=9f24c5e6612e74065901",
|
"/assets/admin/css/vendor.min.css": "/assets/admin/css/vendor.min.css?id=9f24c5e6612e74065901",
|
||||||
"/assets/frontend/js/app.js.map": "/assets/frontend/js/app.js.map?id=5a7f5ff244b2e68e2e97",
|
"/assets/frontend/js/app.js.map": "/assets/frontend/js/app.js.map?id=c714055cc7132853c1d6",
|
||||||
"/assets/frontend/css/now-ui-kit.css.map": "/assets/frontend/css/now-ui-kit.css.map?id=6399f2da87c32423e68b",
|
"/assets/frontend/css/now-ui-kit.css.map": "/assets/frontend/css/now-ui-kit.css.map?id=6399f2da87c32423e68b",
|
||||||
"/assets/admin/css/vendor.min.css.map": "/assets/admin/css/vendor.min.css.map?id=c266c31652dea865307c",
|
"/assets/admin/css/vendor.min.css.map": "/assets/admin/css/vendor.min.css.map?id=c266c31652dea865307c",
|
||||||
"/assets/admin/js/app.js": "/assets/admin/js/app.js?id=04a35bc7089e2c0465f7",
|
"/assets/admin/js/app.js": "/assets/admin/js/app.js?id=cd8b03d3b7bd54e960ca",
|
||||||
"/assets/admin/js/app.js.map": "/assets/admin/js/app.js.map?id=585453e7f6a36a7cd888",
|
"/assets/admin/js/app.js.map": "/assets/admin/js/app.js.map?id=6d4305f02e7e757e1666",
|
||||||
"/assets/installer/js/app.js": "/assets/installer/js/app.js?id=7eb8b66dce0064082abc",
|
"/assets/installer/js/app.js": "/assets/installer/js/app.js?id=7eb8b66dce0064082abc",
|
||||||
"/assets/installer/js/app.js.map": "/assets/installer/js/app.js.map?id=8d818e1a57d346adf7b3",
|
"/assets/installer/js/app.js.map": "/assets/installer/js/app.js.map?id=8d818e1a57d346adf7b3",
|
||||||
"/assets/fonts/glyphicons-halflings-regular.woff2": "/assets/fonts/glyphicons-halflings-regular.woff2?id=349344e92fb16221dd56",
|
"/assets/fonts/glyphicons-halflings-regular.woff2": "/assets/fonts/glyphicons-halflings-regular.woff2?id=349344e92fb16221dd56",
|
||||||
|
@ -19,6 +19,7 @@ export default (_opts) => {
|
|||||||
center: [29.98139, -95.33374],
|
center: [29.98139, -95.33374],
|
||||||
refresh_interval: 10, // seconds
|
refresh_interval: 10, // seconds
|
||||||
zoom: 5,
|
zoom: 5,
|
||||||
|
acars_uri: '/api/acars',
|
||||||
update_uri: '/api/acars/geojson',
|
update_uri: '/api/acars/geojson',
|
||||||
pirep_uri: '/api/pireps/{id}',
|
pirep_uri: '/api/pireps/{id}',
|
||||||
pirep_link_uri: '/pireps/{id}',
|
pirep_link_uri: '/pireps/{id}',
|
||||||
@ -71,7 +72,7 @@ export default (_opts) => {
|
|||||||
rivets.bind($('#map-info-box'), liveMapController);
|
rivets.bind($('#map-info-box'), liveMapController);
|
||||||
rivets.bind($('#live_flights'), liveMapController);
|
rivets.bind($('#live_flights'), liveMapController);
|
||||||
|
|
||||||
const drawRoute = (feature, layer, route) => {
|
function drawRoute(feature, layer, route) {
|
||||||
console.log('drawRoute');
|
console.log('drawRoute');
|
||||||
if (layerSelFlight !== null) {
|
if (layerSelFlight !== null) {
|
||||||
map.removeLayer(layerSelFlight);
|
map.removeLayer(layerSelFlight);
|
||||||
@ -97,14 +98,14 @@ export default (_opts) => {
|
|||||||
|
|
||||||
pannedToCenter = true;
|
pannedToCenter = true;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When a flight is clicked on, show the path, etc for that flight
|
* When a flight is clicked on, show the path, etc for that flight
|
||||||
* @param feature
|
* @param feature
|
||||||
* @param layer
|
* @param layer
|
||||||
*/
|
*/
|
||||||
const onFlightClick = (feature, layer) => {
|
function onFlightClick(feature, layer) {
|
||||||
const pirep_uri = opts.pirep_uri.replace('{id}', feature.properties.pirep_id);
|
const pirep_uri = opts.pirep_uri.replace('{id}', feature.properties.pirep_id);
|
||||||
const geojson_uri = `${opts.pirep_uri.replace('{id}', feature.properties.pirep_id)}/acars/geojson`;
|
const geojson_uri = `${opts.pirep_uri.replace('{id}', feature.properties.pirep_id)}/acars/geojson`;
|
||||||
|
|
||||||
@ -126,12 +127,10 @@ export default (_opts) => {
|
|||||||
|
|
||||||
drawRoute(feature, layer, route);
|
drawRoute(feature, layer, route);
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
const updateMap = () => {
|
const updateMap = () => {
|
||||||
const pirep_uri = opts.pirep_uri.replace('{id}', '');
|
request(opts.acars_uri).then((response) => {
|
||||||
|
|
||||||
request(pirep_uri).then((response) => {
|
|
||||||
const pireps = response.data.data;
|
const pireps = response.data.data;
|
||||||
liveMapController.pireps = pireps;
|
liveMapController.pireps = pireps;
|
||||||
liveMapController.has_data = pireps.length > 0;
|
liveMapController.has_data = pireps.length > 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user