Compare commits
4 Commits
feature/da
...
feat/load-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
080582f7ab | ||
|
|
91475aeead | ||
|
|
5d50d6d6cc | ||
|
|
39717d184c |
12
app/Http/Controllers/GoogleApisController.php
Normal file
12
app/Http/Controllers/GoogleApisController.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class GoogleApisController extends Controller
|
||||
{
|
||||
public function index(){
|
||||
return view('maps.google-api');
|
||||
}
|
||||
}
|
||||
@@ -116,6 +116,13 @@ class UsersRoleMenuSeeder extends Seeder
|
||||
"parent_id" => $dashboard->id,
|
||||
"sort_order" => 3,
|
||||
],
|
||||
[
|
||||
"name" => "PETA",
|
||||
"url" => "dashboard.maps",
|
||||
"icon" => null,
|
||||
"parent_id" => $dashboard->id,
|
||||
"sort_order" => 4,
|
||||
],
|
||||
[
|
||||
"name" => "Users",
|
||||
"url" => "users.index",
|
||||
@@ -229,6 +236,7 @@ class UsersRoleMenuSeeder extends Seeder
|
||||
$lack_of_potentials = Menu::where('name', 'Dashboard Potensi')->first();
|
||||
$spatial_plannings = Menu::where('name', 'Tata Ruang')->first();
|
||||
$pdam = Menu::where('name', 'PDAM')->first();
|
||||
$peta = Menu::where('name', 'PETA')->first();
|
||||
|
||||
// Superadmin gets all menus
|
||||
$superadmin->menus()->sync([
|
||||
@@ -256,6 +264,7 @@ class UsersRoleMenuSeeder extends Seeder
|
||||
$lack_of_potentials->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$spatial_plannings->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$pdam->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$peta->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
]);
|
||||
|
||||
// Admin gets limited menus
|
||||
|
||||
45
resources/views/maps/google-api.blade.php
Normal file
45
resources/views/maps/google-api.blade.php
Normal file
@@ -0,0 +1,45 @@
|
||||
@extends('layouts.vertical', ['subtitle' => 'Google Maps'])
|
||||
@section('css')
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@include('layouts.partials/page-title', ['title' => 'Maps', 'subtitle' => 'Google Maps'])
|
||||
<div id="map" style="width: 100%; height: 90vh;"></div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
||||
<script src="https://unpkg.com/togeojson@0.16.0"></script>
|
||||
<script src="https://unpkg.com/leaflet-omnivore@0.3.4/leaflet-omnivore.min.js"></script>
|
||||
<script src="https://unpkg.com/leaflet-kml/L.KML.js"></script>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
var map = L.map('map').setView([-6.9175, 107.6191], 10); // Jakarta
|
||||
|
||||
// Tambahkan peta dasar dari OpenStreetMap
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
attribution: '© OpenStreetMap contributors'
|
||||
}).addTo(map);
|
||||
|
||||
// Muat file KMZ
|
||||
omnivore.kml("{{ asset('storage/maps/rencanapolaruang_rtrw_2024_2044__rencana_pola_ruang.kml') }}")
|
||||
.on('ready', function () {
|
||||
try {
|
||||
var bounds = this.getBounds();
|
||||
if (bounds.isValid()) {
|
||||
map.fitBounds(bounds);
|
||||
} else {
|
||||
console.warn("Bounds tidak valid, gunakan fallback.");
|
||||
map.setView([-6.9175, 107.6191], 10); // Default ke Jakarta
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error setting bounds:", error);
|
||||
map.setView([-6.1751, 106.8650], 10);
|
||||
}
|
||||
})
|
||||
.addTo(map);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -5,6 +5,7 @@ use App\Http\Controllers\CustomersController;
|
||||
use App\Http\Controllers\Dashboards\LackOfPotentialController;
|
||||
use App\Http\Controllers\DataSettingController;
|
||||
use App\Http\Controllers\Dashboards\BigDataController;
|
||||
use App\Http\Controllers\GoogleApisController;
|
||||
use App\Http\Controllers\Home\HomeController;
|
||||
use App\Http\Controllers\Master\UsersController;
|
||||
use App\Http\Controllers\MenusController;
|
||||
@@ -32,6 +33,7 @@ Route::group(['middleware' => 'auth'], function(){
|
||||
Route::get('/bigdata', [BigDataController::class, 'index'])->name('dashboard.home');
|
||||
Route::get('/dashboard-pbg', [BigDataController::class, 'pbg'])->name('dashboard.pbg');
|
||||
Route::get('/lack-of-potential', [LackOfPotentialController::class, 'lack_of_potential'])->name('dashboard.lack_of_potential');
|
||||
Route::get('/maps', [GoogleApisController::class, 'index'])->name('dashboard.maps');
|
||||
});
|
||||
|
||||
// settings
|
||||
|
||||
Reference in New Issue
Block a user