Skip to content

Commit

Permalink
Merge pull request #44 from Rizki36/#43-bug-modal-pondok-produk
Browse files Browse the repository at this point in the history
fix: fix bug link google and img
  • Loading branch information
Rizki36 committed May 29, 2022
2 parents b56e723 + 46ee23a commit ed99669
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/Http/Requests/StoreLokasiRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function rules()
'lat' => 'required|numeric',
'lng' => 'required|numeric',
'tipe' => 'required|numeric|in:1,2',
'link_google_maps' => 'required|string',
'link_google_maps' => 'required|string|url',
'id_kecamatan' => 'required|string|max:255',
'id_kelurahan' => 'required|string|max:255',
'foto' => 'required|image|mimes:jpeg,png,jpg|max:2048',
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/UpdateLokasiRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function rules()
'lat' => 'required|numeric',
'lng' => 'required|numeric',
'tipe' => 'required|numeric|in:1,2',
'link_google_maps' => 'required|string',
'link_google_maps' => 'required|string|url',
'id_kecamatan' => 'required|string|max:255',
'id_kelurahan' => 'required|string|max:255',
];
Expand Down
11 changes: 6 additions & 5 deletions resources/views/pondok.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
style="background-color: white;position: absolute;z-index: 9;width: 300px;top: 20;left:40px">
<label>Kecamatan</label>
<select id="kecamatan-filter" class="form-control">
<option>Filter Kecamatan</option>
<option value="">Filter Kecamatan</option>
@foreach ($kecamatan as $k)
<option value="{{ $k->id }}">{{ $k->nama }}</option>
@endforeach
Expand Down Expand Up @@ -155,9 +155,10 @@
$kecamatanFilter.addEventListener('change', function() {
const kecamatan = this.value;
if (!kecamatan)
map.setFilter('places', []);
if (kecamatan == '') {
map.setFilter('places', null);
return;
}
const layerID = `kec-${kecamatan}`;
map.setFilter('places', ['==', 'id_kecamatan', kecamatan]);
});
Expand All @@ -174,7 +175,7 @@ function showModal(data) {
$alamatDetail.innerHTML = data?.alamat
$deskripsiDetail.innerHTML = data?.deskripsi
$linkDetail.href = data?.link_google_maps
$imgDetail.src = data?.gambar
$imgDetail.src = `{{ asset('images') }}/${data?.foto}`
modalDetail.show($modalEl)
}
Expand Down
10 changes: 6 additions & 4 deletions resources/views/produk.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
style="background-color: white;position: absolute;z-index: 9;width: 300px;top: 20;left:40px">
<label>Kecamatan</label>
<select id="kecamatan-filter" class="form-control">
<option>Filter Kecamatan</option>
<option value="">Filter Kecamatan</option>
@foreach ($kecamatan as $k)
<option value="{{ $k->id }}">{{ $k->nama }}</option>
@endforeach
Expand Down Expand Up @@ -155,8 +155,10 @@
$kecamatanFilter.addEventListener('change', function() {
const kecamatan = this.value;
if (!kecamatan)
map.setFilter('places', []);
if (kecamatan == '') {
map.setFilter('places', null);
return;
}
const layerID = `kec-${kecamatan}`;
map.setFilter('places', ['==', 'id_kecamatan', kecamatan]);
Expand All @@ -174,7 +176,7 @@ function showModal(data) {
$alamatDetail.innerHTML = data?.alamat
$deskripsiDetail.innerHTML = data?.deskripsi
$linkDetail.href = data?.link_google_maps
$imgDetail.src = data?.gambar
$imgDetail.src = `{{ asset('images') }}/${data?.foto}`
modalDetail.show($modalEl)
}
Expand Down

0 comments on commit ed99669

Please sign in to comment.