desa fetch
This commit is contained in:
parent
f480216e5c
commit
e714218b9d
Binary file not shown.
@ -383,7 +383,7 @@ class apiController:
|
||||
elif level == 'kecamatan':
|
||||
cur.execute("SELECT id, kode, nama, null as lat, null as lng, koordinat as path FROM wil_kecamatan WHERE kabupaten_kota_id = %s", (parent_code,))
|
||||
elif level == 'desa':
|
||||
cur.execute("SELECT id, kode, nama, null as lat, null as lng, koordinat as path FROM wil_desa WHERE kecamatan_id = %s", (parent_code,))
|
||||
cur.execute("SELECT id, kode, nama, null as lat, null as lng,path FROM wil_desa WHERE kecamatan_id = %s", (parent_code,))
|
||||
else:
|
||||
return {"type": "FeatureCollection", "features": []}
|
||||
features = []
|
||||
|
||||
@ -647,7 +647,7 @@
|
||||
// Tambahkan ke dropdown kabupaten
|
||||
$('#kecamatanDropdown').select2({
|
||||
data: results,
|
||||
placeholder: 'Pilih Kabupaten/Kota',
|
||||
placeholder: 'Pilih Kecamatan',
|
||||
allowClear: true
|
||||
});
|
||||
}
|
||||
@ -656,8 +656,8 @@
|
||||
loadLayer(`/geojson/kecamatan/${kodeKabupaten}`, () => {}, 'kecamatan');
|
||||
}).select2();
|
||||
|
||||
document.getElementById('kecamatanDropdown').addEventListener('change', function (e) {
|
||||
const kodeKecamatan = e.target.value;
|
||||
$('#kecamatanDropdown').on('change', function (e) {
|
||||
const kodeKecamatan = $(this).val();
|
||||
localStorage.setItem('kode_kecamatan', kodeKecamatan);
|
||||
loadLayer(`/geojson/desa/${kodeKecamatan}`, () => {}, 'desa');
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user