feat: add system configuration (A-03) — map center, zoom, radius min/max

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
GuavaPopper
2026-06-05 04:25:58 +07:00
parent 6fa793aec3
commit 2bd7b206a6
11 changed files with 275 additions and 16 deletions
+13 -3
View File
@@ -104,6 +104,11 @@
<i class="fa-solid fa-clock-rotate-left"></i> Log
</a>
</li>
<li>
<a href="{{ url('/admin/settings') }}" class="font-medium">
<i class="fa-solid fa-sliders"></i> Pengaturan
</a>
</li>
@endif
</ul>
<!-- User dropdown -->
@@ -177,9 +182,9 @@
<div class="form-control mb-4">
<label class="label py-1">
<span class="label-text-alt font-bold">Radius: <span id="radiusVal">500</span>m</span>
<span class="label-text-alt font-bold">Radius: <span id="radiusVal">{{ $appSettings['radius_min'] ?? 50 }}</span>m</span>
</label>
<input type="range" min="50" max="2000" value="500" step="50" class="range range-xs range-primary" id="radiusSlider">
<input type="range" min="{{ $appSettings['radius_min'] ?? 50 }}" max="{{ $appSettings['radius_max'] ?? 2000 }}" value="{{ $appSettings['radius_min'] ?? 50 }}" step="50" class="range range-xs range-primary" id="radiusSlider">
</div>
<div class="grid grid-cols-3 gap-2">
@@ -527,8 +532,13 @@
}
});
const appSettings = @json($appSettings);
function initMap() {
map = L.map('map', { zoomControl: false }).setView([-0.0553, 109.3463], 17);
const centerLat = parseFloat(appSettings.map_center_lat ?? '-0.0553');
const centerLng = parseFloat(appSettings.map_center_lng ?? '109.3463');
const defaultZoom = parseInt(appSettings.map_default_zoom ?? '17');
map = L.map('map', { zoomControl: false }).setView([centerLat, centerLng], defaultZoom);
const osm = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19 });
const satellite = L.layerGroup([