Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions js/photosController.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ PhotosController.prototype = {
$(this).parent().parent().parent().find('>.app-navigation-entry-menu').addClass('open');
}
});
// expand navigation
$('body').on('click', '#navigation-photos', function(e) {
if (e.target.tagName === 'LI' && $(e.target).attr('id') === 'navigation-photos') {
that.toggleNavigation();
that.optionsController.saveOptionValues({photosNavigationShow: $('#navigation-favorites').hasClass('open')});
}
});
},

updateMyFirstLastDates: function() {
Expand Down Expand Up @@ -86,6 +93,10 @@ PhotosController.prototype = {
}
},

toggleNavigation: function() {
$('#navigation-photos').toggleClass('open');
},

getPhotoMarkerOnClickFunction: function() {
var _app = this;
return function(evt) {
Expand Down
21 changes: 20 additions & 1 deletion lib/Service/GeophotoService.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use OCA\Maps\DB\Geophoto;
use OCA\Maps\DB\GeophotoMapper;
use OCA\Maps\Service\TracksService;
use OCA\Maps\Service\DevicesService;

class GeophotoService {

Expand All @@ -35,8 +36,9 @@ class GeophotoService {
private $preview;
private $tracksService;
private $timeordedPointSets;
private $devicesService;

public function __construct (ILogger $logger, IRootFolder $root, IL10N $l10n, GeophotoMapper $photoMapper, IPreview $preview, TracksService $tracksService, $userId) {
public function __construct (ILogger $logger, IRootFolder $root, IL10N $l10n, GeophotoMapper $photoMapper, IPreview $preview, TracksService $tracksService, DevicesService $devicesService, $userId) {
$this->root = $root;
$this->l10n = $l10n;
$this->photoMapper = $photoMapper;
Expand All @@ -45,6 +47,7 @@ public function __construct (ILogger $logger, IRootFolder $root, IL10N $l10n, Ge
$this->tracksService = $tracksService;
$this->timeordedPointSets = null;
$this->userId = $userId;
$this->devicesService = $devicesService;

}

Expand Down Expand Up @@ -165,6 +168,15 @@ private function loadTimeordedPointSets($userId) {
}
}
}
foreach ($this->devicesService->getDevicesFromDB($userId) as $device) {
$device_points = $this->devicesService->getDevicePointsFromDB($userId, $device);
$points = [];
foreach ($device_points as $pt) {
$points[$pt->timestamp] = [(string) $pt->lat, (string) $pt->lng];
}
$foo = ksort($points);
$this->timeordedPointSets[] = $points;
}
return null;
}

Expand Down Expand Up @@ -207,6 +219,13 @@ private function getTimeorderdPointsFromTrack($track) {
* @param $points array sorted by keys timestamp => [lat, lng]
*/
private function getLocationFromSequenceOfPoints($dateTaken, $points) {
$foo = end($points);
$end = key($points);
$foo = reset($points);
$start = key($points);
if ($start > $dateTaken OR $end < $dateTaken) {
return null;
}
$smaller = null;
$bigger = null;
foreach ($points as $time => $locations) {
Expand Down
4 changes: 2 additions & 2 deletions templates/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</ul>
</div>
</li>
<li id="navigation-photos">
<li id="navigation-photos" class="collapsible">
<a class="icon-picture" href="#"><?php p($l->t('Photos')); ?></a>
<div class="app-navigation-entry-utils">
<ul>
Expand All @@ -92,7 +92,7 @@
</div>
<ul>
<li id="navigation-nonLocalizedPhotos">
<a class="icon-picture" href="#"><?php p($l->t('non localized')); ?></a>
<a class="icon-picture" href="#"><?php p($l->t('without geo tag')); ?></a>
<div class="app-navigation-entry-utils">
<ul>
<li class="app-navigation-entry-utils-counter">
Expand Down