mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-14 12:06:46 +00:00
🌍 Adjust map initialization logic for non-default routes
- Updated default latitude/longitude for routes other than `meetups.map`. - Dynamically adjusted zoom level based on the current route name.
This commit is contained in:
@@ -26,6 +26,10 @@ class extends Component {
|
||||
->first();
|
||||
$this->latitude = $geoCountry->latitude ?? 51.165691;
|
||||
$this->longitude = $geoCountry->longitude ?? 10.451526;
|
||||
if ($this->currentRouteName !== 'meetups.map') {
|
||||
$this->latitude = 20;
|
||||
$this->longitude = 10;
|
||||
}
|
||||
}
|
||||
|
||||
public function with(): array
|
||||
@@ -115,7 +119,7 @@ class extends Component {
|
||||
initializeMap() {
|
||||
const map = L.map($refs.map, {
|
||||
scrollWheelZoom: false
|
||||
}).setView([this.latitude, this.longitude], 6);
|
||||
}).setView([this.latitude, this.longitude], @js($currentRouteName === 'meetups.map' ? 6 : 3));
|
||||
|
||||
L.tileLayer('https://tile.openstreetmap.de/{z}/{x}/{y}.png', {
|
||||
minZoom: 0,
|
||||
|
||||
Reference in New Issue
Block a user