Add openstreetmap with a mapbox.com layer. #420

This commit is contained in:
James Cole
2017-09-30 17:50:22 +02:00
parent c0d62dfc86
commit cc61281523
24 changed files with 14474 additions and 193 deletions

View File

@@ -187,6 +187,14 @@ class TagRepository implements TagRepositoryInterface
return new Carbon;
}
/**
* @return Tag
*/
public function oldestTag(): ?Tag
{
return $this->user->tags()->whereNotNull('date')->orderBy('date', 'ASC')->first();
}
/**
* @param User $user
*/
@@ -330,7 +338,6 @@ class TagRepository implements TagRepositoryInterface
Log::debug(sprintf('Found %d tags', $tags->count()));
/** @var Tag $tag */
foreach ($tags as $tag) {
$amount = floatval($this->sumOfTag($tag, null, null));
$min = $amount < $min || is_null($min) ? $amount : $min;
$max = $amount > $max ? $amount : $max;
@@ -356,7 +363,6 @@ class TagRepository implements TagRepositoryInterface
return $return;
}
/**
* @param Tag $tag
* @param array $data

View File

@@ -103,6 +103,11 @@ interface TagRepositoryInterface
*/
public function lastUseDate(Tag $tag): Carbon;
/**
* @return Tag|null
*/
public function oldestTag(): ?Tag;
/**
* @param User $user
*/
@@ -117,17 +122,6 @@ interface TagRepositoryInterface
*/
public function spentInPeriod(Tag $tag, Carbon $start, Carbon $end): string;
/**
* Calculates various amounts in tag.
*
* @param Tag $tag
* @param Carbon|null $start
* @param Carbon|null $end
*
* @return array
*/
public function sumsOfTag(Tag $tag, ?Carbon $start, ?Carbon $end): array;
/**
* This method stores a tag.
*
@@ -146,6 +140,17 @@ interface TagRepositoryInterface
*/
public function sumOfTag(Tag $tag, ?Carbon $start, ?Carbon $end): string;
/**
* Calculates various amounts in tag.
*
* @param Tag $tag
* @param Carbon|null $start
* @param Carbon|null $end
*
* @return array
*/
public function sumsOfTag(Tag $tag, ?Carbon $start, ?Carbon $end): array;
/**
* Generates a tag cloud.
*