X-Git-Url: https://git.rapsys.eu/.gitweb.cgi/airbundle/blobdiff_plain/fe6e2c02f7e5253da2b031783e426b3a65bf90b8..0986da34a61bfc439c83930abb7162dbaadff851:/Controller/LocationController.php?ds=sidebyside diff --git a/Controller/LocationController.php b/Controller/LocationController.php index 9ee9471..6a98a0b 100644 --- a/Controller/LocationController.php +++ b/Controller/LocationController.php @@ -41,10 +41,20 @@ class LocationController extends DefaultController { //Set modified $this->modified = max(array_map(function ($v) { return $v['modified']; }, array_merge($this->context['cities'], $this->context['dances']))); - //Add city multi + //Iterate on each cities foreach($this->context['cities'] as $id => $city) { + //Set coordinates + $coordinates = []; + + //Iterate on each locations + foreach($city['locations'] as $location) { + //Add coordinates + $coordinates[] = [ $location['latitude'], $location['longitude'] ]; + } + //Add city multi - $this->context['cities'][$id]['multimap'] = $this->map->getMultiMap($city['multimap'], $this->modified->getTimestamp(), $city['locations']); + #$this->context['cities'][$id]['multimap'] = $this->map->getMultiMap($city['multimap'], $this->modified->getTimestamp(), $city['locations']); + $this->context['cities'][$id]['multimap'] = $this->image->getMulti($coordinates) + ['caption' => $city['multimap']]; } //With logged user @@ -181,8 +191,18 @@ class LocationController extends DefaultController { } } + //Set coordinates + $coordinates = []; + + //Iterate on each locations + foreach($this->context['locations'] as $location) { + //Add coordinates + $coordinates[] = [ $location['latitude'], $location['longitude'] ]; + } + //Add multi - $this->context['multimap'] = $this->map->getMultiMap($this->context['city']['multimap'], $this->modified->getTimestamp(), $this->context['locations']); + #$this->context['multimap'] = $this->map->getMultiMap($this->context['city']['multimap'], $this->modified->getTimestamp(), $this->context['locations']); + $this->context['multimap'] = $this->image->getMulti($coordinates) + ['caption' => $this->context['city']['multimap']]; //Set keywords $this->context['keywords'] = [ @@ -269,8 +289,18 @@ class LocationController extends DefaultController { } } + //Set coordinates + $coordinates = []; + + //Iterate on each locations + foreach($this->context['locations'] as $location) { + //Add coordinates + $coordinates[] = [ $location['latitude'], $location['longitude'] ]; + } + //Add multi map - $this->context['multimap'] = $this->map->getMultiMap($this->translator->trans('Libre Air locations sector map'), $this->modified->getTimestamp(), $this->context['locations']); + #$this->context['multimap'] = $this->map->getMultiMap($this->translator->trans('Libre Air locations sector map'), $this->modified->getTimestamp(), $this->context['locations']); + $this->context['multimap'] = $this->image->getMulti($coordinates) + ['caption' => $this->translator->trans('Libre Air locations sector map')]; //Set title $this->context['title']['page'] = $this->translator->trans('Libre Air locations'); @@ -457,8 +487,18 @@ class LocationController extends DefaultController { } } + //Set coordinates + $coordinates = []; + + //Iterate on each locations + foreach($this->context['locations'] as $location) { + //Add coordinates + $coordinates[] = [ $location['latitude'], $location['longitude'] ]; + } + //Add multi map - $this->context['multimap'] = $this->map->getMultiMap($this->context['location']['multimap'], $this->modified->getTimestamp(), $this->context['locations']); + #$this->context['multimap'] = $this->map->getMultiMap($this->context['location']['multimap'], $this->modified->getTimestamp(), $this->context['locations']); + $this->context['multimap'] = $this->image->getMulti($coordinates) + ['caption' => $this->context['location']['multimap']]; //Set keywords $this->context['keywords'] = [