From 96abea41984b96dd26fbc8e21cda9db2789e77f4 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Fri, 3 Jan 2025 14:04:02 +0000 Subject: [PATCH] convert map parameters to env variables, add corrected breadcrumb --- src/Controller/CommunityResourceController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Controller/CommunityResourceController.php b/src/Controller/CommunityResourceController.php index 47b29e8..20b0595 100644 --- a/src/Controller/CommunityResourceController.php +++ b/src/Controller/CommunityResourceController.php @@ -71,17 +71,21 @@ class CommunityResourceController extends AbstractController $rcs = $this->entityManager->getRepository(CommunityResource::class)->findAll(); $map = new Map('default'); - $map->center(new Point(39.768502, -86.157918)) - ->zoom(9) + $map->center(new Point($_ENV['MAP_CENTER_LAT'], $_ENV['MAP_CENTER_LON'])) + ->zoom($_ENV['MAP_ZOOM_LEVEL']) ; foreach ($rcs as $rsc) { + /** @var CommunityResource $rsc */ $map->addMarker(new Marker( position: new Point($rsc->getLat(), $rsc->getLon()), title: $rsc->getName(), infoWindow: new InfoWindow( content: "{$rsc->getName()}
{$rsc->getAddress()}, {$rsc->getCity()}, {$rsc->getState()->value} {$rsc->getZip()}
Services: " . $rsc->getServicesAvailable() - ) + ), + extra: [ + 'type' => '' + ] )); } @@ -92,6 +96,7 @@ class CommunityResourceController extends AbstractController [ 'map' => $map, 'breadcrumbs' => [ + new Breadcrumb($this->generateUrl('app_community_resource'), 'List Resources'), new Breadcrumb('#', 'Community Resources') ], 'notifications' => $this->msgs,