Browse Source

adds a method to find the location given a local clock time with no offset

pull/5/head
Aaron Parecki 8 years ago
parent
commit
fe6c675e42
3 changed files with 22855 additions and 1 deletions
  1. +2
    -1
      compass/app/Http/Controllers/Api.php
  2. +22852
    -0
      compass/app/Http/Controllers/LocalTime.php
  3. +1
    -0
      compass/app/Http/routes.php

+ 2
- 1
compass/app/Http/Controllers/Api.php View File

@ -189,7 +189,8 @@ class Api extends BaseController
$coords = $record->data->geometry->coordinates; $coords = $record->data->geometry->coordinates;
$params = [ $params = [
'latitude' => $coords[1], 'latitude' => $coords[1],
'longitude' => $coords[0]
'longitude' => $coords[0],
'date' => $record->data->properties->timestamp
]; ];
$ch = curl_init(env('ATLAS_BASE').'api/geocode?'.http_build_query($params)); $ch = curl_init(env('ATLAS_BASE').'api/geocode?'.http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

+ 22852
- 0
compass/app/Http/Controllers/LocalTime.php
File diff suppressed because it is too large
View File


+ 1
- 0
compass/app/Http/routes.php View File

@ -14,6 +14,7 @@ $app->post('/database/create', 'Controller@createDatabase');
$app->get('/api/query', 'Api@query'); $app->get('/api/query', 'Api@query');
$app->get('/api/last', 'Api@last'); $app->get('/api/last', 'Api@last');
$app->get('/api/find-from-localtime', 'LocalTime@find');
$app->get('/api/input', 'Api@account'); $app->get('/api/input', 'Api@account');
$app->post('/api/input', 'Api@input'); $app->post('/api/input', 'Api@input');
$app->post('/api/trip-complete', 'Api@trip_complete'); $app->post('/api/trip-complete', 'Api@trip_complete');

Loading…
Cancel
Save