Merge pull request #26 from arieeefajar/fix/master-land

fix(master-land): change layer map to googleSat
This commit is contained in:
Arie Fajar Bachtiar 2025-03-14 19:48:23 +07:00 committed by GitHub
commit 7e88bf968e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 23 deletions

View File

@ -15,17 +15,7 @@ class LandController extends Controller
{
public function index()
{
// $lands = Land::orderBy('created_at', 'desc')->get();
// if ($lands->isEmpty()) {
// return view('master-data.lahan.index', compact('lands'));
// }
// $province = Province::where('id', $lands->first()->province_code)->first();
// $regency = $province->regency()->where('id', $lands->first()->regency_code)->first();
// $district = $regency->district()->where('id', $lands->first()->district_code)->first();
// return view('master-data.lahan.index', compact('lands', 'province', 'regency', 'district'));
$lands = Land::with('province', 'regency')->orderBy('created_at', 'desc')->get();
return view('master-data.lahan.index', compact('lands'));
}
@ -174,10 +164,6 @@ public function update(Request $request, $id)
$polygon = json_decode($request->polygon, true);
// if (isset($polygon[0])) {
// $polygon = $polygon[0]; // Ambil array pertama jika ada
// }
if ($validator->fails()) {
toast($validator->messages()->all()[0], 'error')->position('top')->autoclose(3000);
return redirect()->back()->withInput();

View File

@ -1,4 +1,4 @@
var map, drawnItems, drawControl, googleStreets, iconMarker;
var map, drawnItems, drawControl, googleSat, iconMarker;
var currentMarker = null;
function initMap() {
@ -6,8 +6,8 @@ function initMap() {
attributionControl: false,
}).setView([-8.157416852745705, 113.72281580436439], 16);
googleStreets = L.tileLayer(
"http://{s}.google.com/vt?lyrs=m&x={x}&y={y}&z={z}",
googleSat = L.tileLayer(
"http://{s}.google.com/vt?lyrs=s&x={x}&y={y}&z={z}",
{
maxZoom: 20,
subdomains: ["mt0", "mt1", "mt2", "mt3"],

View File

@ -1,4 +1,4 @@
var mapEdit, drawnItems, drawControl, googleStreets, iconMarker;
var mapEdit, drawnItems, drawControl, googleSat, iconMarker;
var currentMarkerEdit = null;
var formEdit = document.getElementById("edit-form");
@ -40,8 +40,8 @@ function initMapEdit() {
attributionControl: false,
}).setView([-8.157416852745705, 113.72281580436439], 16);
googleStreets = L.tileLayer(
"http://{s}.google.com/vt?lyrs=m&x={x}&y={y}&z={z}",
googleSat = L.tileLayer(
"http://{s}.google.com/vt?lyrs=s&x={x}&y={y}&z={z}",
{
maxZoom: 20,
subdomains: ["mt0", "mt1", "mt2", "mt3"],

View File

@ -144,8 +144,8 @@
</div>
<div class="modal-footer" id="add-footer" style="display: none">
<div class="hstack gap-2 justify-content-end">
<button type="button" class="btn btn-light"
data-bs-dismiss="modal">Tutup</button>
<a href="{{ Auth::user()->role == 'admin' ? route('master_data.lahan.index') : route('lahan.index') }}"
class="btn btn-light">Kembali</a>
<button type="submit" class="btn btn-success" id="add-btn">Simpan</button>
</div>
</div>

View File

@ -154,7 +154,7 @@
</div>
<div class="modal-footer" id="edit-footer">
<div class="hstack gap-2 justify-content-end">
<a href="{{ route('master_data.lahan.index') }}"
<a href="{{ Auth::user()->role == 'admin' ? route('master_data.lahan.index') : route('lahan.index') }}"
class="btn btn-light">Kembali</a>
<button type="submit" class="btn btn-success" id="edit-btn">Update</button>
</div>