convert map parameters to env variables, add corrected breadcrumb

This commit is contained in:
Ryan Prather 2025-01-03 14:04:02 +00:00
parent 368b4fbcd3
commit 96abea4198

View File

@ -71,17 +71,21 @@ class CommunityResourceController extends AbstractController
$rcs = $this->entityManager->getRepository(CommunityResource::class)->findAll(); $rcs = $this->entityManager->getRepository(CommunityResource::class)->findAll();
$map = new Map('default'); $map = new Map('default');
$map->center(new Point(39.768502, -86.157918)) $map->center(new Point($_ENV['MAP_CENTER_LAT'], $_ENV['MAP_CENTER_LON']))
->zoom(9) ->zoom($_ENV['MAP_ZOOM_LEVEL'])
; ;
foreach ($rcs as $rsc) { foreach ($rcs as $rsc) {
/** @var CommunityResource $rsc */
$map->addMarker(new Marker( $map->addMarker(new Marker(
position: new Point($rsc->getLat(), $rsc->getLon()), position: new Point($rsc->getLat(), $rsc->getLon()),
title: $rsc->getName(), title: $rsc->getName(),
infoWindow: new InfoWindow( infoWindow: new InfoWindow(
content: "{$rsc->getName()}<br>{$rsc->getAddress()}, {$rsc->getCity()}, {$rsc->getState()->value} {$rsc->getZip()}<br>Services: " . $rsc->getServicesAvailable() content: "{$rsc->getName()}<br>{$rsc->getAddress()}, {$rsc->getCity()}, {$rsc->getState()->value} {$rsc->getZip()}<br>Services: " . $rsc->getServicesAvailable()
) ),
extra: [
'type' => ''
]
)); ));
} }
@ -92,6 +96,7 @@ class CommunityResourceController extends AbstractController
[ [
'map' => $map, 'map' => $map,
'breadcrumbs' => [ 'breadcrumbs' => [
new Breadcrumb($this->generateUrl('app_community_resource'), 'List Resources'),
new Breadcrumb('#', 'Community Resources') new Breadcrumb('#', 'Community Resources')
], ],
'notifications' => $this->msgs, 'notifications' => $this->msgs,