Commit ced77bc2 authored by Muhamad's avatar Muhamad

Merge branch 'master' of http://git.khansia.co.id/Nahrowi/oku-gis

# Conflicts:
#	Application/__pycache__/views.cpython-37.pyc
parents 1e8a32e3 b0cc89be
......@@ -55,6 +55,7 @@ urlpatterns = [
path('c_bangunan', views.createbang, name='c_bangunan'),
path('create-jalan', views.createjalan, name='create-jalan'),
path('create-point', views.createpoint, name='create-point'),
path('c_lahan', views.createlahan, name='c_lahan'),
path('edit-tuplah', login_required(views.edittuplah), name='edit-tuplah'),
path('edit-tuplah-valid', views.edittuplahvalid, name='edit-tuplah-valid'),
......
......@@ -60,9 +60,25 @@ def search_auto(request):
def tuplah(request):
with conn.cursor() as desa:
desa.execute(f"SELECT json_build_object('type', 'Feature', 'legend', (a.id, a.legenda, st_area(a.geom::geography), a.gambar) ,'geometry', ST_AsGeoJSON( st_intersection(a.geom, b.geom):: geometry) :: json) from geo_tuplah a, geo_prov_kab b where b.kabupaten = 'OGAN KOMERING ULU'")
all = desa.fetchall()
desa.execute(f"""SELECT
json_build_object (
'type',
'Feature',
'legend',
( A.ID, A.legenda, st_area ( A.geom :: geography ), A.gambar ),
'geometry',
ST_AsGeoJSON ( st_intersection ( A.geom, b.geom ) :: geometry ) :: json
)
FROM
geo_tuplah A,
geo_prov_kab b
WHERE
b.kabupaten = 'OGAN KOMERING ULU'""")
all = desa.fetchall()
ltup = []
for i in all:
i[0]['legend']['f3'] = '{0:,.2f}'.format(i[0]['legend']['f3'])
ltup.append(i[0])
data = {'tuplah':all}
return Response(data)
......@@ -2526,6 +2542,45 @@ def upload_tampak(request):
return Response(respon)
@api_view(('GET',))
def createlahan(request):
poly_create = request.GET.get('polygon')
p_create = poly_create.replace('"','')
po_create = p_create.replace(', ','],[')
name = request.GET.get('name')
tipelh = request.GET.get('tipelh')
tahun = request.GET.get('tahun')
luas = request.GET.get('luas')
obid = 666
provinsi = "Sumatera Selatan"
gambar = "NONE"
latlng = po_create.split("],[")[0]
print(p_create)
print(latlng)
if name == "":
name = "Sumatera Selatan"
else:
name = name
with conn.cursor() as lahan:
lahan.execute("""INSERT INTO geo_tuplah(geom, objectid_1, name, provinsi, pl_19_r, legenda, gambar) VALUES (ST_GeomFromEWKT('SRID=4326;MULTIPOLYGON(((%s)))'), '%s', '%s', '%s', '%s', '%s', '%s')"""% (p_create, obid, name, provinsi, tahun, tipelh, gambar))
conn.commit()
data = {'status':'Success'}
data = 'SUCCESS'
info = 'data telah diperbaharui'
status = 0
# except:
# data = 'Sorry'
# info = 'Dalam Perbaikan'
# status = 1
respon={'data':data, 'info': info, 'status':status}
return Response(respon)
import re
@api_view(('POST',))
......@@ -3122,20 +3177,6 @@ def search_spes(request):
WHERE
a.namobj ILIKE '%{}%'
UNION
SELECT a.ID
,
a.namobj,
a.remark,
a.geom,
'geo_spbu'
FROM
geo_spbu a
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE
a.namobj ILIKE '%{}%'
UNION
SELECT a.ID
,
a.namobj,
......@@ -3192,7 +3233,7 @@ def search_spes(request):
WHERE
a.namobj ILIKE '%{}%'
LIMIT 10
""".format(inp, inp, inp, inp, inp, inp, inp, inp, inp, inp, inp))
""".format(inp, inp, inp, inp, inp, inp, inp, inp, inp, inp))
s_point = search_point.fetchall()
kill = s_point
elif tipe == ' Bangunan':
......
......@@ -816,6 +816,22 @@ input#change_stat {
border-top: 20px solid white;
}
#create,
#create-jal {
border: transparent;
border-radius: 5px;
margin: 10px;
}
#map-create-all>div.leaflet-control-container>div.leaflet-top.leaflet-left>div:nth-child(1)>div>div>a.leaflet-draw-draw-marker {
width: 100%!important;
padding: 0px!important;
}
#informasi_create>div {
margin: 10px;
}
@media (max-width: 1025px) {
.dock {
position: absolute;
......
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 23L4 25V7L12 5" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M20 27L12 23V5L20 9V27Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M20 9L28 7V25L20 27" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.75 18.6875L3.25 20.3125V5.6875L9.75 4.0625" stroke="#E86250" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.25 21.9375L9.75 18.6875V4.0625L16.25 7.3125V21.9375Z" stroke="#E86250" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.25 7.3125L22.75 5.6875V20.3125L16.25 21.9375" stroke="#E86250" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
......@@ -24,14 +24,18 @@ $("#sidebar").hide()
maps = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', { id: 'mapbox/light-v9', tileSize: 512, zoomOffset: -1 }).addTo(map);
OpenStreetMap.onclick = function() {
maps = L.tileLayer("https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&s=Gal&apistyle=s.t:0|s.e:l|p.v:off", {
map.removeLayer(maps)
//maps = L.tileLayer("https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&s=Gal&apistyle=s.t:0|s.e:l|p.v:off", {
maps = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
maxZoom: 22,
minZoom: 3,
}).addTo(map);
};
WorldImagery.onclick = function() {
// https://{s}.tiles.wmflabs.org/osm-no-labels/{z}/{x}/{y}.png
map.removeLayer(maps)
// https://{s}.tiles.wmflabs.org/osm-no-labels/{z}/{x}/{y}.png
maps = L.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", {
maxZoom: 22,
minZoom: 3,
......@@ -39,6 +43,7 @@ WorldImagery.onclick = function() {
};
BingSatellite.onclick = function() {
map.removeLayer(maps)
maps = L.tileLayer.bing({ bingMapsKey: BING_KEY, maxNativeZoom: 22 }).addTo(map);
setTimeout(function() {
$('.leaflet-bottom.leaflet-right>.leaflet-control-attribution.leaflet-control').html(`Powered by <a href="https://khansia.co.id" target="_blank">Khansia</a> with <a href="https://leafletjs.com" target="_blank">Leaflet</a>`)
......@@ -48,6 +53,7 @@ BingSatellite.onclick = function() {
GoogleSatellite.onclick = function() {
map.removeLayer(maps)
maps = L.tileLayer('http://mt0.google.com/vt/lyrs=y&hl=en&x={x}&y={y}&z={z}&s=Gal&apistyle=s.t:0|s.e:l|p.v:off', {
maxZoom: 22,
minZoom: 4,
......
......@@ -624,14 +624,7 @@
<span>` + raja + `</span>
</div>
</div>
<div>
<div>
<span>Perbaikan Terakhir</span>
</div>
<div>
<span>` + perbaikan_pt + `</span>
</div>
</div>
`);
......@@ -5023,9 +5016,8 @@
})
} else {
//location.reload();
$("#labelchange").html(`<h1 style="color: white;margin-top: 5px;margin-left: 8px;">
3D
</h1>`)
$("#labelchange").html(`<img src="static/img/icon-1/Vector3d.svg" alt="" style="height: 50px;
width: 50px;">`)
map_cesium.entities.removeAll();
//map_cesium.destroy();
setTimeout(function() {
......@@ -5047,7 +5039,7 @@
$(".no3d").css('display', 'none');
$("#legendapo").css('display', 'none');
$(".rar").css('display', 'none');
$("#labelchange").html(`<h1 style="color: white;margin-top: 5px;margin-left: 8px;">
$("#labelchange").html(`<h1 style="margin-top: 5px;margin-left: 8px;">
2D
</h1>`)
......@@ -7098,44 +7090,78 @@
list_history_panel += data_history
};
history = `
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center">
<img src="static/img/icon/samping_history.svg" alt="Image" style="height: 20px; width: 20px;">
</p>
<p class="text-center">
<b>History Perbaikan</b>
</p>
<br>
<label class="col-md-6"><b>Tanggal</b></label>
<label class="col-md-6"><b>Jenis Perbaikan</b></label>
` + list_history_panel + `
<p class="text-center" style="margin-top: 15px;">
<a id='btn_detail_per_bang' onclick="getdetailperbang(` + feature.properties.f1 + `)" data-toggle="modal" data-target="#modal_detail" class="btn btn-primary" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-list-ul" style="color:#ffffff"> </i><i style="margin-left: 5px;">View Detail</i></a>
<a href="#" id='btn_perbaikan_bangunan' data-toggle="modal" data-target="#input_perbaikan_bang" data-backdrop="static" data-keyboard="false" class="btn btn-primary" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-plus" style="color:#ffffff"> </i><i style="margin-left: 5px;">Tambah History Perbaikan</i></a>
</p>
</th>
</tr>`;
history = `
<div>
<div style="margin-top: 150px;">
<span>Perbaikan Terakhir</span>
<span>
<a id='btn_detail_per_bang' onclick="getdetailperbang(` + feature.properties.f1 + `)" data-toggle="modal" data-target="#modal_detail" style = "text-align:right; margin-right:26px;"><i>Detail</i></a>
</span>
</div>
<div>
<span>
<tr style="height: 40px;">
<th id="history_panel">
<div class="form-group" style="margin-bottom:0px;">
<div class="row">
<label class="col-md-6">` + list_history[0].split(",")[1] + `</label>
<label class="col-md-6">` + list_history[0].split(",")[2] + `</label>
</div>
</div>
<p class="text-center" style="margin-top: 5px;">
<a class="btn" id="btn_perbaikan_bangunan" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Input Perbaikan</i></a>
</p>
</th>
</tr>
</span>
</div>
</div>
`;
} else {
history = `
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center">
History Perbaikan
</p>
<br>
<p class="text-center" style="margin-top: 10px;"><i>Belum Ada History</i></p>
<p class="text-center" style="margin-top: 10px;">
<a href="#" id='btn_perbaikan_bangunan' data-toggle="modal" data-target="#input_perbaikan_bang" data-backdrop="static" data-keyboard="false" class="btn btn-primary" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-plus" style="color:#ffffff"> </i><i style="margin-left: 5px;">Tambah History Perbaikan</i></a>
</p>
</th>
</tr>`;
<div>
<div style="margin-top: 150px;">
<span>Perbaikan Terakhir</span>
</div>
<div>
<span>
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center" style="margin-top: 10px;"><i>Belum Ada History</i></p>
<p class="text-center" style="margin-top: 10px;">
<a class="btn" id="btn_perbaikan_bangunan" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Input Perbaikan</i></a>
</p>
</th>
</tr>
</span>
</div>
</div>
`;
}
} else {
history = ``
}
// if (feature.properties.f4 != null) {
// var list_history = feature.properties.f4
// console.log(list_history[0].split(",")[0])
// var perbaikan_bg = `
// <div class='row'>
// <label class="col-md-8">` + list_history[0].split(",")[1] + `</label>
// <a class="col-md-4" onclick="getdetailper(` + list_history[0].split(",")[0] + `)" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Detail</i></a>
// </div>
// <a class="btn" id="btn_perbaikan_bangunan" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Input Perbaikan</i></a>`
// } else {
// var perbaikan_bg = `<div class='row'>
// <div class="col-md-6">
// <label class="col-md-6">-</label>
// </div>
// </div>
// <a class="btn" id="btn_perbaikan_bangunan" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Input Perbaikan</i></a>
// `
// }
content_edit = `
<div class="modal-dialog" style="width: max-content;height: max-content;">
<div class="modal-content">
......@@ -7310,135 +7336,196 @@
</div>
</div>`;
content_inp_his_bang = `
<div class="modal-dialog" style="height: max-content;">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color:#40777c;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h6 class="modal-title">Renovasi Bangunan</h6>
</div>
<div class="modal-body" style="overflow-x: hidden;max-height: 300px;overflow-y: scroll;padding-left: 15px;">
<div class="tab-pane has-padding" id="panel-tab2">
<div class="tab-pane" id="bottom-justified-data">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<li onclick="changetabs(this)" class="active"><a href="#left-tab1-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl" data-toggle="tab">Informasi Umum</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="left-tab1-feas-upl">
<input type="text" class="hidden" id="poly_create_input_bang">
<input type="text" class="hidden" id="id_bang_perbaikan">
<input type="text" class="hidden" id="type_id_bang">
<div id="map-insert-renov-bang" style="height: 375px;width: 100%">
</div>
</div>
<div class="modal-dialog" style="height: max-content;">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color:#40777c;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h6 class="modal-title">Renovasi Bangunan</h6>
</div>
<div class="modal-body" style="max-height: 450px;overflow-y: auto;">
<div class="tab-pane has-padding" id="panel-tab2">
<div class="tab-pane" id="bottom-justified-data">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<li onclick="changetabs(this)" class="active"><a href="#left-tab1-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl" data-toggle="tab">Informasi Umum</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="left-tab1-feas-upl">
<input type="text" class="hidden" id="poly_create_input_bang">
<input type="text" class="hidden" id="id_bang_perbaikan" value="` + feature.properties.f1 + `" disable>
<input type="text" class="hidden" id="type_id_bang">
<div id="map-insert-renov-bang" style="height: 375px;width: 100%">
</div>
</div>
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Nama :</label>
<input type="text" id="nama_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Jenis :</label>
<input type="text" id="type_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kelurahan :</label>
<input type="text" id="kelurahan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kecamatan :</label>
<input type="text" id="kecamatan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Tanggal Disetujui :</label>
<input type="date" id="tgldisetujui_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Tanggal Mulai Perbaikan :</label>
<input type="date" id="tglmulaiperbaikan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Tanggal Selesai Perbaikan :</label>
<input type="date" id="tglselesaiperbaikan_bang" class="form-control" value="">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Anggaran :</label>
<input type="text" id="anggaran_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Pihak yang Mengesahkan :</label>
<input type="text" id="pihakpengesahan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Penanggung Jawab Lapangan :</label>
<input type="text" id="pjlapangan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Jenis Perbaikan :</label>
<input type="text" id="jenisperbaikan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kontraktor/Vendor :</label>
<input type="text" id="kontraktor_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Proposal (.pdf):</label>
<input type="file" id="proposal_bang">
</div>
<div class="form-group">
<label>Bukti Selesai Perbaikan (.png/.jpg/.jpeg/):</label>
<input type="file" id="buktiselesai_bang">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Nama :</label>
<input type="text" id="nama_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Jenis :</label>
<input type="text" id="type_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kelurahan :</label>
<input type="text" id="kelurahan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kecamatan :</label>
<input type="text" id="kecamatan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Tanggal Disetujui :</label>
<input type="date" id="tgldisetujui_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Tanggal Mulai Perbaikan :</label>
<input type="date" id="tglmulaiperbaikan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Tanggal Selesai Perbaikan :</label>
<input type="date" id="tglselesaiperbaikan_bang" class="form-control" value="">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Anggaran :</label>
<input type="text" id="anggaran_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Pihak yang Mengesahkan :</label>
<input type="text" id="pihakpengesahan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Penanggung Jawab Lapangan :</label>
<input type="text" id="pjlapangan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Jenis Perbaikan :</label>
<input type="text" id="jenisperbaikan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kontraktor/Vendor :</label>
<input type="text" id="kontraktor_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Proposal (.pdf):</label>
<input type="file" id="proposal_bang">
</div>
<div class="form-group">
<label>Bukti Selesai Perbaikan (.png/.jpg/.jpeg/):</label>
<input type="file" id="buktiselesai_bang">
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<input type="text" id="coorbangbaru" class="hidden" value="">
<button type="button" class="btn btn-info" id="save-perbaikan_bang" style="float: right; margin-top: 5px; margin-right: 10px;">SAVE</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<input type="text" id="coorbangbaru" class="hidden" value="">
<button type="button" class="btn btn-info" id="save-perbaikan_bang" style="float: right; margin-top: 5px; margin-right: 10px;">SAVE</button>
</div>
</div>
</div>`;
if (feature.properties.f4 != null) {
var list_history = feature.properties.f4
console.log(list_history[0].split(",")[0])
var perbaikan_bg = `<div class='row'>
<label class="col-md-8">` + list_history[0].split(",")[1] + `</label>
<a class="col-md-4" onclick="getdetailper(` + list_history[0].split(",")[0] + `)" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Detail</i></a>
</div>
<a class="col-md-6" class="btn" id="btn_perbaikan_jalan"><i>Input Perbaikan</i></a>`
</div>`;
} else {
var perbaikan_bg = `<div class='row'>
<div class="col-md-6">
<label class="col-md-6">Null</label>
</div>
</div>
<a class="btn" id="btn_perbaikan_hist" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Input Perbaikan</i></a>
`
}
content = `
<table class="table tasks-list">
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src=` + path_img + ` alt="Image" style="width: 100%;max-height: 368px;height:368">
</th>
</tr>
</thead>
<tbody>
<div class= "container">
<tr style="height: 100px;">
<th>
<div>
<h1 style="font-family: Google Sans,Roboto,Arial,sans-serif;
letter-spacing: 0;
font-weight: 400;">
<span style="font-size: x-large;">
` + feature.properties.f2 + `
</span>
</h1>
</div>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 30px;">
<th>
<span>
` + feature.administrasi.f12 + `
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p style="text-align:center;">
<img src="static/img/icon/samping_location.svg" alt="Image" style="height: 30px; width: 30px;">
</p>
<p>
<span>
` + alamat + feature.administrasi.f1 + `, ` + feature.administrasi.f2 + `, ` + feature.administrasi.f3 + `, ` + feature.administrasi.f4 + `
</span>
</p>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p style="text-align:center;">
<img src="static/img/icon/samping_informasi.svg" alt="Image" style="height: 30px; width: 30px;">
</p>
<p>
<span>Luas Bangunan : ` + feature.administrasi.f6 + `</span>
</p>
<p>
<span>Luas Tanah : ` + feature.administrasi.f7 + `</span>
</p>
<p>
<span>Tinggi Bangunan : ` + feature.administrasi.f8 + `</span>
</p>
<p>
<span>Pemilik : ` + feature.administrasi.f10 + `</span>
</p>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p class="text-center" style="margin-top: 5px;">
<a href="#" class="btn btn-primary" data-toggle="modal" data-target="#modal_bangunan_edit" id="btn_edit_bangunan" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-edit" style="color:#ffffff"> </i><i style="margin-left: 5px;">Edit Informasi Bangunan</i></a>
<a href="#" id='btn_delete_bangunan' class='btn
btn-primary btn_edit_bangunan' data-toggle="modal" data-target="#modal_bangunan_delete" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-trash" style="color:#ffffff"> </i><i style="margin-left: 5px;">Delete Bangunan</i></a>
</p>
</th>
</tr>
</div>
<div class="container">
` + history + `
</div>
</tbody>
</table>`;
$(".gambar_keterangan").html(`<img src="` + path_img + `" alt="" style="width:100%;height:240px;border-top-left-radius: 10px;border-bottom-left-radius: 10px;">`)
......@@ -7460,77 +7547,61 @@
<div class="col-md-6">
<div>
<div>
<span>Jenis Bangunan</span>
<span style="font-family: 'gilroylight';">Jenis Bangunan</span>
</div>
<div>
<span>
` + feature.administrasi.f12 + `
</span>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f12 + `</span>
</div>
</div>
<div>
<div>
<span>Luas Bangunan</span>
<div style="margin-top:5px;">
<span style="font-family: 'gilroylight';">Luas Bangunan</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f6 + ` m</span>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f6 + ` m</span>
</div>
</div>
<div>
<div>
<span>Luas Tanah</span>
<span style="font-family: 'gilroylight';">Luas Tanah</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f7 + ` m</span>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f7 + ` m</span>
</div>
</div>
</div>
<div class="col-md-6">
<div>
<div>
<span>Tinggi Bangunan</span>
<span style="font-family: 'gilroylight';">Tinggi Bangunan</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f8 + ` m</span>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f8 + ` m</span>
</div>
</div>
<div>
<div>
<span>Pemilik</span>
<div style="margin-top:5px;">
<span style="font-family: 'gilroylight';">Pemilik</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f10 + ` m</span>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f10 + ` m</span>
</div>
</div>
</div>
<div>
<div style="margin-top: 150px;">
<span>Perbaikan Terakhir</span>
</div>
<div>
<span>` + perbaikan_bg + `</span>
</div>
</div>
` + history + `
`);
$(".btn_action").html(`<div class="tombol-edit-keterangan text-center" style="background-color: #5A9AFB;position: absolute;width: 40px;height: 40px;bottom: 2px;right: 5px;border: 1pt solid rosybrown;border-radius: 8px;">
<a href="#" id="btn_edit_bangunan" data-toggle="modal" data-target="#modal_bangunan_edit" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-pencil5"></i></a>
</div>
<div class="tombol-delete-keterangan text-center" data-toggle="modal" data-target="#modal_bangunan_delete" style="background-color: indianred;position: absolute;width: 40px;height: 40px;bottom: 2px;right: 50px;border: 1pt solid rosybrown;border-radius: 10px;">
<a href="#" id="btn_delete_bangunan" data-toggle="modal" data-target="#modal_bangunan_delete" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-eraser2"></i></a>
</div>
`)
<a href="#" id="btn_edit_bangunan" data-toggle="modal" data-target="#modal_bangunan_edit" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-pencil5"></i></a>
</div>
<div class="tombol-delete-keterangan text-center" data-toggle="modal" data-target="#modal_bangunan_delete" style="background-color: indianred;position: absolute;width: 40px;height: 40px;bottom: 2px;right: 50px;border: 1pt solid rosybrown;border-radius: 10px;">
<a href="#" id="btn_delete_bangunan" data-toggle="modal" data-target="#modal_bangunan_delete" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-eraser2"></i></a>
</div>
`)
$("#isi_panel").html(content);
$("#modal_bangunan_edit").html(content_edit);
$("#modal_bangunan_delete").html(content_delete);
$("#input_perbaikan_bang").html(content_inp_his_bang);
......@@ -7598,9 +7669,6 @@
geo_bangunan.addData(data)
}
var checkBox_building = document.getElementById("geo_building");
map.on("movestart", function() {
geo_bangunan.clearLayers();
});
......@@ -7613,6 +7681,8 @@
var center = map.getBounds().getCenter();
var zoom = map.getZoom();
var checkBox_building = document.getElementById("geo_building");
if (checkBox_building.checked == true) {
if (zoom > 17) {
......@@ -7948,39 +8018,10 @@
});
var map_bang = new L.map('map-insert-renov-bang', {
editable: true,
zoomControl: false,
drawControl: true
}).setView([-2, 118], 5);
mapssx = L.tileLayer('https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', {
maxZoom: 22,
minZoom: 4,
}).addTo(map_bang);
var polyxxx = L.polygon([
[-4.1283969, 104.1674575],
[-4.128396, 104.1674947],
[-4.1284664, 104.1674964],
[-4.1284674, 104.1674593],
[-4.1283969, 104.1674575]
]).addTo(map_bang)
// var geo_bangunan_input = L.geoJson(null, {
// style: function(feature) {
// return {
// color: "#06FF08",
// weight: 8,
// opacity: 2,
// zIndex: 1000
// };
// }
// }).addTo(map_bang);
$(document).on("click", "#btn_perbaikan_bangunan", function() {
// $("#input_perbaikan_bang-s").css("display", "block");
var map_bang = new L.map('map-insert-renov-bang', {
editable: true,
editable: false,
zoomControl: false,
drawControl: true
}).setView([-2, 118], 5);
......@@ -7990,11 +8031,13 @@
minZoom: 4,
}).addTo(map_bang);
$("#input_perbaikan_bang").css("display", "block");
if (map_bang.hasLayer(polyxxx)) {
polyxxx.remove()
}
var id_polyx = $('#idbangunan').val();
// if (map_bang.hasLayer(polyxxx)) {
// polyxxx.remove()
// }
var id_polyx = $('#id_bang_perbaikan').val();
loaderPage(true);
$.ajax({
url: "{% url 'apps:input-perbaikan-bang' %}",
......@@ -8003,7 +8046,12 @@
},
dataType: 'json',
success: function(data) {
console.log(data)
setTimeout(function() {
map_bang.invalidateSize();
}, 1000);
loaderPage(false);
$("#nama_bang").val(data[0]);
$("#type_bang").val(data[4]);
$("#id_bang_perbaikan").val(data[3]);
......@@ -8012,7 +8060,7 @@
$("#kecamatan_bang").val(data[6]);
var latlngs = data[2];
console.log(data[2])
var lattitud, longitud;
map_bang.setView([data[2]['geometry']['coordinates'][0][0][0][1], data[2]['geometry']['coordinates'][0][0][0][0]], 19);
......@@ -8033,7 +8081,7 @@
})
}
})
})
});
$(document).on("click", "#save-perbaikan_bang", function(e) {
var polyginbang = $('#coorbangbaru').val();
......@@ -8047,7 +8095,7 @@
var anggaran = $("#anggaran_bang").val();
var proposal = $("#proposal_bang").val();
var bukti_selesai = $("#buktiselesai_bang").val();
console.log(bukti_selesai)
var pj = $("#pihakpengesahan_bang").val();
var pj_lapangan = $("#pjlapangan_bang").val();
var kontraktor = $("#kontraktor_bang").val();
......
......@@ -1154,6 +1154,7 @@
<input type="text" name="idtuplah" id="idtuplah" class="hidden" value="">
<input type="text" name="coordinatetuplah" id="coordinatetuplah" class="hidden" value="">
<input type="text" name="luastuplah" id="lwastuplah" class="hidden" value="">
<div class="col-md-12">
<div>
......@@ -1169,13 +1170,14 @@
<span>Luas Lahan</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.legend.f3 + `m2</span>
<span style="font-family: 'Roboto';">` + feature.legend.f3 + ` m2</span>
</div>
</div>
</div>`)
$('#idtuplah').val(feature.legend.f1);
$('#lwastuplah').val(feature.legend.f3);
$("#coordinatetuplah").val(feature.geometry);
$("#button_hide_panel").css("display", "block");
......@@ -1271,6 +1273,7 @@
}
var id_poly = $('#idtuplah').val();
var lwastup = $("#lwastuplah").val();
$.ajax({
url: "{% url 'api:edit-tuplah' %}",
......@@ -1282,6 +1285,7 @@
$("#modal-edit-tuplah").modal("show")
$("#modal_detail_non_kelurahan").modal("toggle")
loaderPage(false);
$("#luas_tuplah_edit").val(lwastup);
let response = data
if (response.code == 0) {
setTimeout(function() {
......@@ -1294,10 +1298,8 @@
var longg = 0;
for (var i = 0; i < lop_poly_edit.length; i++) {
geoj = lop_poly_edit[i];
console.log(lop_poly_edit[i])
for (var i = 0; i < geoj.length; i++) {
console.log(geoj[i])
polygigi = [geoj[i][1], geoj[i][0]]
list_poly_edit.push(polygigi);
latt += geoj[i][0]
......@@ -1306,8 +1308,6 @@
};
var lattt = latt / list_poly_edit.length
var longgg = longg / list_poly_edit.length
console.log(list_poly_edit)
map_edit_tuplah.setView([longgg, lattt], 14);
......@@ -3499,6 +3499,7 @@
$(".btn_create_jalan").click(function() {
$("#create_all > div > ul").css("display", "block")
$("#modal__create").modal("show");
$(".title-create").html("Create Jalan")
$(".tombol_action_create").html(`<input type="button" id="create-jal" value="Create" style="z-index: 1000;position:relative;">`)
......@@ -3623,6 +3624,7 @@
})
$(".btn_create_bangunan").click(function() {
$("#create_all > div > ul").css("display", "block")
$("#modal__create").modal("show");
$(".title-create").html("Create Bangunan")
$(".tombol_action_create").html(`<input type="button" id="create" value="Create" style="z-index: 1000;position:relative;">`)
......@@ -3819,6 +3821,174 @@
}
window.thisBaseDrawPolygonLayer = layer;
$("#poly_create_bangunan").val(JSON.stringify(kordinat));
var seeArea = L.GeometryUtil.geodesicArea(layer.getLatLngs()[0]);
var fixarea = seeArea.toFixed(3)
$("#luas_bangunan_create").val(fixarea);
});
polygon_options = {
showArea: false,
shapeOptions: {
stroke: true,
color: '#6e83f0',
weight: 1.5,
opacity: 2,
fill: false,
fillColor: null, //same as color by default
clickable: true
}
}
var polygonDraweredit = new L.Draw.Polygon(map_create_all, polygon_options);
polygonDraweredit.on("click", function(event) {
shapecoords.innerHTML = event.latlng.toString();
map_create_all.fire("click", event); // Trigger a map click as well.
});
map_create_all.on('draw:created', function(e) {
var type = e.layerType,
layer = e.layer;
var lay = layer.addTo(map_create_all);
Poly = lay;
});
$("#map-create-all > div.leaflet-control-container > div.leaflet-top.leaflet-left > div").css("display", "none")
});
$(".btn_create_lahan").click(function() {
$("#create_all > div > ul").css("display", "block")
$("#modal__create").modal("show");
$(".title-create").html("Create Lahan")
$(".tombol_action_create").html(`<input type="button" id="create" value="Create" style="z-index: 1000;position:relative;">`)
$(".tab_1").html("Koordinat")
$(".tab_2").html("Informasi Lahan")
$(".tombol_save_create").html(`<input type="button" class="btn btn-primary" id="create_save_lahan" value="SAVE" style="margin-right:30px;">
<input type="text" name="poly_create" class="hidden" id="poly_create_lahan" value="">`)
$("#koordinatjalan").html(`
<div class="form-group">
<div id="map-create-all" style="height: 300px;">
<div class="tombol_action_create">
<input type="button" id="create" value="Create" style="z-index: 1000;position:relative;">
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="img_lahan" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>`)
$("#informasi_create").html(`
<div class="row" style="margin-top: 15px;">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" >Nama Lahan</label>
<div class="col-lg-9">
<input id="name_create" type="text" class="form-control" value="" required>
</div>
</div>
</div>
<div class="row" style="margin-top: 15px;">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" >Jenis Lahan</label>
<div class="col-lg-9">
<select style="border-bottom: 1px solid rgb(83, 83, 83) !important;" id="tipe_point_lahan" data-placeholder="select point.." class="select-size-md">
<option value="null" selected disabled>-- Pilih Jenis Lahan --</option>
<option value="Belukar">Belukar</option>
<option value="Belukar Rawa">Belukar Rawa</option>
<option value="Hutan Lahan Kering Primer">Hutan Lahan Kering Primer</option>
<option value="Hutan Lahan Kering Sekunder">Hutan Lahan Kering Sekunder</option>
<option value="Hutan Tanaman">Hutan Tanaman</option>
<option value="Pemukiman">Pemukiman</option>
<option value="Perkebunan">Perkebunan</option>
<option value="Pertambangan">Pertambangan</option>
<option value="Pertanian Lahan Kering">Pertanian Lahan Kering</option>
<option value="Pertanian Lahan Kering Campur">Pertanian Lahan Kering Campur</option>
<option value="Savana / Padang rumput">Savana / Padang rumput</option>
<option value="Sawah">Sawah</option>
<option value="Tanah Terbuka">Tanah Terbuka</option>
<option value="Transmigrasi">Transmigrasi</option>
</select>
</div>
</div>
</div>
<div class="row" style="margin-top: 15px;">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" >Tahun</label>
<div class="col-lg-9">
<input id="tahun_create" type="text" class="form-control" value="" required>
</div>
</div>
</div>
<div class="row" style="margin-top: 15px;">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" >Luas Lahan</label>
<div class="col-lg-6">
<input id="luas_lahan_create" type="text" class="form-control" value="" required>
</div>
<div class="col-lg-3" style="margin-top:8px;">
<span>m2</span>
</div>
</div>
</div>
`);
var nowyear = new Date().getFullYear();
$("#tahun_create").val(nowyear);
var map_create_all = L.map('map-create-all', {
editable: true,
zoomControl: false,
drawControl: true
}).setView([e.latlng.lat, e.latlng.lng], 20);
L.tileLayer('https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', {
maxZoom: 22,
minZoom: 4,
}).addTo(map_create_all);
setTimeout(function() {
map_create_all.invalidateSize();
}, 500);
$('#create').click(function() {
polygonDraweredit.enable();
});
var Marker = {};
var Poly = {};
map_create_all.on(L.Draw.Event.CREATED, function(e) {
var layer = e.layer;
$("#poly_create_lahan").empty();
var type = e.layerType;
var layer = e.layer;
var shape = layer.toGeoJSON();
let geoShape = shape.geometry.coordinates[0];
let kordinat = "";
for (j in geoShape) {
kordinat += geoShape[j][0] + ' ' + geoShape[j][1];
if (j <= (geoShape.length - 2)) {
kordinat += ', ';
}
}
window.thisBaseDrawPolygonLayer = layer;
$("#poly_create_lahan").val(JSON.stringify(kordinat));
var seeArea = L.GeometryUtil.geodesicArea(layer.getLatLngs()[0]);
var fixarea = seeArea.toFixed(3)
$("#luas_lahan_create").val(fixarea);
});
polygon_options = {
......@@ -3858,6 +4028,7 @@
$(".tombol_action_create").html(``)
$(".tab_1").html("Koordinat")
$(".tab_2").html("Informasi Point")
$("#create_all > div > ul").css("display", "block")
$(".tombol_save_create").html(`<input type="button" class="btn btn-primary" id="btnsavepoint" value="SAVE">
<input type="text" name="poly_create_point" class="hidden" id="poly_create_point" value="">`)
......@@ -3967,7 +4138,7 @@
setTimeout(function() {
map_create_all.invalidateSize();
}, 500);
}, 1000);
$(".leaflet-draw-draw-marker").html('<span>Create</span>')
......@@ -4017,10 +4188,10 @@
map.closePopup();
});
$("#map-create-all > div.leaflet-control-container > div.leaflet-top.leaflet-left > div:nth-child(2) > div > div").css("display", "none")
$(".leaflet-draw-draw-marker").css("padding", "0px!important")
$(".leaflet-draw-draw-marker").css("width", "100%!important")
$("#map-create-all > div.leaflet-control-container > div.leaflet-top.leaflet-right").css("display", "none")
$("#map-create-all > div.leaflet-control-container > div.leaflet-top.leaflet-left > div:nth-child(1) > div > div > a.leaflet-draw-draw-polyline").css("display", "none")
$("#map-create-all > div.leaflet-control-container > div.leaflet-top.leaflet-left > div:nth-child(2) > div > div > a.leaflet-draw-draw-marker").css("display", "block!important")
})
......@@ -4099,60 +4270,99 @@
});
$(".btn_cek_KDBKLB").click(function() {
$("#koordinatjalan").addClass("active")
$("#informasi_create").removeClass("active")
$("#tab_koor").addClass("active")
$("#tab_info").removeClass("active")
$("#modal__create").modal("show");
$(".title-create").html("Cek KDB & KLB")
$(".tombol_action_create").html(`<input type="button" id="create-jal" value="Create" style="z-index: 1000;position:relative;">`)
$(".tombol_save_create").html('')
$(".tab_1").html("Koordinat")
$(".tab_2").html("Informasi")
$("#create_all > div > ul").css("display", "none")
$("#koordinatjalan").html(`
<div class="jumlah_lantai" style="margin-top: -15px;">jumlah_lantai : 0
</div>
<div class="form-group">
<div id="map-create-all" style="height: 300px;">
<!-- <div class="tombol_action_create">
<input type="button" class="leaflet-draw-draw-marker" value="Create" style="z-index: 1000;position:relative;">
</div> -->
<div style="margi:10px;">
<input type="button" id="create_poly_rumah" value="Create Polygon Rumah" style="z-index: 1000;position:relative;">
<input type="button" id="create_poly_tanah" value="Create Polygon Tanah" style="z-index: 1000;position:relative;display:none;">
<input type="button" id="delete_poly" value="Delete Polygon" style="z-index: 1000;position:relative;display:none;">
<div style="margin:10px;">
<input type="button" id="create_poly_rumah" value="Create Polygon Rumah" style="z-index: 1000;position:relative;border: transparent;border-radius: 5px;display:none;">
<input type="button" id="create_poly_tanah" value="Create Polygon Tanah" style="z-index: 1000;position:relative;border: transparent;border-radius: 5px;background: antiquewhite;">
<input type="button" id="delete_poly" value="Reset" style="z-index: 1000;position:relative;background: azure;border: transparent;border-radius: 5px;display:none;margin-top: 5px;">
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="row" style="margin-top: 5px;margin-right:5px!important;">
<div class="form-group">
<label class="control-label lbl-top">Luas Lantai (m2)</label>
<div class="">
<input id="luas_polygon_lantai" type="text" class="form-control" value="" required>
</div>
<div class="alert alert-danger" id="notificationluaslantai" style="display: none;margin: 0px;padding-top: 0px;padding-bottom: 0px;font-size: 10px;position: absolute;top: -5px;left: 110px;">
</div>
</div>
</div>
<div class="row" style="margin-top: 5px;margin-right:5px!important;">
<div class="form-group">
<label class="control-label lbl-top">Luas Rumah (m2)</label>
<div class="">
<input id="luas_polygon_rumah" type="text" class="form-control" value="" required>
</div>
<div class="alert alert-danger" id="notificationluasrumah" style="display: none;margin: 0px;padding-top: 0px;padding-bottom: 0px;font-size: 10px;position: absolute;top: -5px;left: 110px;">
</div>
</div>
</div>
<div class="row" style="margin-top: 5px;margin-right:5px!important;">
<div class="form-group">
<label class="control-label lbl-top">Luas Tanah (m2)</label>
<div class="">
<input id="luas_polygon_tanah" type="text" class="form-control" value="" required>
</div>
<div class="alert alert-danger" id="notificationluastanah" style="display: none;margin: 0px;padding-top: 0px;padding-bottom: 0px;font-size: 10px;position: absolute;top: -5px;left: 110px;">
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row" style="margin-top: 5px;margin-left:5px!important;">
<div class="form-group">
<label class="control-label lbl-top">Sisa Luas Tanah (m2):</label>
<div class="">
<input id="sisa_luas_tanah" type="text" class="form-control" value="" required disabled>
</div>
</div>
</div>
<div class="row" style="margin-top: 5px;margin-left:5px!important;">
<div class="form-group">
<label class="control-label lbl-top">KDB (%):</label>
<div class="">
<input id="KDB_polygon_rumah" type="text" class="form-control" value="" required disabled>
</div>
</div>
</div>
<div class="row" style="margin-top: 5px;margin-left:5px!important;">
<div class="form-group">
<label class="control-label lbl-top">KLB :</label>
<div class="">
<input id="KLB_polygon_rumah" type="text" class="form-control" value="" required disabled>
</div>
</div>
</div>
</div>
</div>
</div>`)
$("#informasi_create").html(`
<div class="row" style="margin-top: 15px;">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Luas Rumah</label>
<div class="col-lg-9">
<input id="luas_polygon_rumah" type="text" class="form-control" value="" required>
</div>
</div>
</div>
<div class="row" style="margin-top: 15px;">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Luas Tanah</label>
<div class="col-lg-9">
<input id="luas_polygon_tanah" type="text" class="form-control" value="" required>
</div>
</div>
</div>
<div class="row" style="margin-top: 15px;">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">KDB</label>
<div class="col-lg-9">
<input id="KDB_polygon_rumah" type="text" class="form-control" value="" required>
</div>
</div>
</div>
<div class="row" style="margin-top: 15px;">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">KLB</label>
<div class="col-lg-9">
<input id="KLB_polygon_rumah" type="text" class="form-control" value="" required>
</div>
</div>
</div>`);
$("#informasi_create").html(``);
var map_create_all = L.map('map-create-all', {
editable: true,
......@@ -4173,70 +4383,74 @@
$("#create_poly_rumah").click(function() {
$('#create_poly_rumah').css("display", "none")
$('#create_poly_tanah').css("display", "block")
$('#delete_poly').css("display", "block")
polygonDraweredit.enable();
$("#create_poly_tanah").val('tambah polygon rumah')
})
$("#create_poly_tanah").click(function() {
$('#create_poly_rumah').css("display", "none")
$('#create_poly_rumah').css("display", "block")
$('#create_poly_tanah').css("display", "none")
$('#delete_poly').css("display", "block")
polygonDraweredit_tanah.enable();
})
function get_luas(lt_p, lo_p) {
var lt_po = lt_p
var lo_po = lo_p
var lat_rad = []
var YY = []
var XX = []
var area = []
polygonDraweredit_tanah.enable();
for (var i = 0; i < lt_po.length; i++) {
lt_rad = lt_po[i] / 180 * (22 / 7)
lat_rad.push(lt_rad)
}
for (var y = 0; y < lt_po.length; y++) {
if (y == 0 || y == lt_po.length - 1) {
YY.push(0)
} else {
yyy = (lt_po[y] - lt_po[0]) / 360 * (6378137 * 2 * (22 / 7))
YY.push(yyy)
}
}
for (var x = 0; x < lo_po.length; x++) {
if (x == 0 || x == lo_po.length - 1) {
XX.push(0)
} else {
xxx = (lo_po[x] - lo_po[0]) / 360 * (6378137 * 2 * (22 / 7) * Math.cos(lat_rad[x]))
XX.push(xxx)
}
}
})
for (var i = 0; i < lo_po.length; i++) {
if (i == 0 || i == lo_po.length - 1) {
area.push(0)
} else {
are = ((YY[i - 1] * XX[i]) - (XX[i - 1] * YY[i])) / 2
area.push(are)
}
}
// function get_luas(lt_p, lo_p) {
// var lt_po = lt_p
// var lo_po = lo_p
//
// var lat_rad = []
// var YY = []
// var XX = []
// var area = []
//
// for (var i = 0; i < lt_po.length; i++) {
// lt_rad = lt_po[i] / 180 * (22 / 7)
// lat_rad.push(lt_rad)
// }
//
// for (var y = 0; y < lt_po.length; y++) {
// if (y == 0 || y == lt_po.length - 1) {
// YY.push(0)
// } else {
// yyy = (lt_po[y] - lt_po[0]) / 360 * (6378137 * 2 * (22 / 7))
// YY.push(yyy)
// }
// }
//
// for (var x = 0; x < lo_po.length; x++) {
// if (x == 0 || x == lo_po.length - 1) {
// XX.push(0)
// } else {
// xxx = (lo_po[x] - lo_po[0]) / 360 * (6378137 * 2 * (22 / 7) * Math.cos(lat_rad[x]))
// XX.push(xxx)
// }
// }
//
// for (var i = 0; i < lo_po.length; i++) {
// if (i == 0 || i == lo_po.length - 1) {
// area.push(0)
// } else {
// are = ((YY[i - 1] * XX[i]) - (XX[i - 1] * YY[i])) / 2
// area.push(are)
// }
// }
//
// function getSum(total, num) {
// return total + Math.round(num);
// }
//
// var luas_area = area.reduce(getSum, 0)
// return luas_area
// }
function getSum(total, num) {
return total + Math.round(num);
}
var luas_area = area.reduce(getSum, 0)
return luas_area
}
var luas_all = []
window.thisBaseDrawPolygonLayer = [];
map_create_all.on(L.Draw.Event.CREATED, function(e) {
var type = e.layerType;
......@@ -4246,23 +4460,50 @@
let geoShape = shape.geometry.coordinates[0];
let kordinat = "";
var lt_p = []
var lo_p = []
for (j in geoShape) {
kordinat += geoShape[j][0] + ' ' + geoShape[j][1];
lt_p.push(geoShape[j][1])
lo_p.push(geoShape[j][0])
if (j <= (geoShape.length - 2)) {
kordinat += ', ';
}
}
luas_all.push(get_luas(lt_p, lo_p))
alert(luas_all)
//res_kord.push(kordinat)
window.thisBaseDrawPolygonLayer = layer;
var seeArea = L.GeometryUtil.geodesicArea(layer.getLatLngs()[0]);
var fixarea = seeArea.toFixed(3)
luas_all.push(fixarea)
if (luas_all.length > 1) {
var luas_tanah = luas_all[0]
var luas_rumah = luas_all[1]
var luas_lantai = luas_all[1]
var jumlah_lantai = luas_all - 1
$("#luas_polygon_rumah").val(parseFloat(luas_rumah).toFixed(2))
$("#luas_polygon_tanah").val(parseFloat(luas_tanah).toFixed(2))
$("#sisa_luas_tanah").val((luas_all[0] - luas_all[1]).toFixed(2))
var aaa = 0
if (luas_all.length > 2) {
var array_lan = luas_all.slice(2)
for (var i = 0; i < array_lan.length; i++) {
luas_lantai = parseFloat(luas_lantai) + parseFloat(array_lan[i])
}
}
$("#luas_polygon_lantai").val(parseFloat(luas_lantai).toFixed(2))
$(".jumlah_lantai").html("jumlah lantai : " + (luas_all.length - 1))
var klb = luas_lantai / luas_tanah
var kdb = luas_rumah / luas_tanah * 100
$("#KDB_polygon_rumah").val(parseFloat(kdb).toFixed(2))
$("#KLB_polygon_rumah").val(parseFloat(klb).toFixed(2))
}
window.thisBaseDrawPolygonLayer.push(layer);
});
......@@ -4318,31 +4559,104 @@
});
$("#delete_poly").click(function() {
if (map_create_all.hasLayer(lay)) {
lay.remove()
}
})
if (window.thisBaseDrawPolygonLayer != []) {
for (var i = 0; i < window.thisBaseDrawPolygonLayer.length; i++) {
window.thisBaseDrawPolygonLayer[i].remove()
}
window.thisBaseDrawPolygonLayer = [];
luas_all = [];
$('#create_poly_rumah').css("display", "none")
$('#create_poly_tanah').css("display", "block")
$(".jumlah_lantai").html("jumlah lantai : 0")
$("#luas_polygon_rumah").val("")
$("#luas_polygon_tanah").val("")
$("#luas_polygon_lantai").val("")
$("#KDB_polygon_rumah").val("")
$("#KLB_polygon_rumah").val("")
$("#sisa_luas_tanah").val("")
}
});
function isi_all() {
var luas_rumah = $("#luas_polygon_rumah").val()
var luas_tanah = $("#luas_polygon_tanah").val()
var luas_lantai = $("#luas_polygon_lantai").val()
if (luas_rumah == null) {
luas_rumah = 1
}
if (luas_tanah == null) {
luas_tanah = 1
}
if (luas_lantai == null) {
luas_lantai = 1
}
var klb = luas_lantai / luas_tanah
var kdb = luas_rumah / luas_tanah * 100
$("#sisa_luas_tanah").val(luas_tanah - luas_rumah)
$("#KDB_polygon_rumah").val(kdb)
$("#KLB_polygon_rumah").val(klb)
}
$('#luas_polygon_rumah').on('input', function() {
isi_all()
// if (luas_tanah.indexOf(' ') !== -1 && luas_tanah != null) {
// var luas_tanah_ret = luas_tanah.split(" ")[0]
// } else if (luas_tanah.indexOf(' ') === -1 && luas_tanah != null) {
// var luas_tanah_ret = luas_tanah
// }
//
// if (luas_tanah !== null) {
// try {
//
// luas_tanah_ret = convert_to_float(luas_tanah)
// } catch {
// $("#notificationluastanah").css("display", "block")
// $("#notificationluastanah").html("Pastikan yang anda masukan adalah angka")
// }
// }
});
$('#luas_polygon_tanah').on('input', function() {
isi_all()
});
$('#luas_polygon_lantai').on('input', function() {
isi_all()
});
})
});
$(document).on("click", "#informasi_poo", function() {
var luas_rumah = $("#luas_polygon_rumah").val()
var luas_tanah = $("#luas_polygon_tanah").val()
if (luas_rumah != null) {
var luas_rumah_ret = luas_rumah.split(" ")[0]
} else {
var luas_rumah_ret = 1
}
})
if (luas_tanah != null) {
var luas_tanah_ret = luas_tanah.split(" ")[0]
} else {
var luas_tanah_ret = 1
}
var klb = luas_tanah_ret / luas_rumah_ret
var kdb = luas_rumah_ret / luas_tanah_ret * 100
});
$("#KDB_polygon_rumah").val(kdb + ' %')
$("#KLB_polygon_rumah").val(klb)
})
$(document).on("click", "#create_save_jalan", function(e) {
data = new FormData()
......@@ -4447,6 +4761,50 @@
});
});
$(document).on("click", "#create_save_lahan", function(e) {
var polygin = $('#poly_create_lahan').val();
var name_poly = $('#name_create').val();
var tdb = $('#tipe_point_lahan').val();
var alamat_poly = $('#tahun_create').val();
var lb_poly = $('#luas_lahan_create').val();
$.ajax({
url: "{% url 'api:c_lahan' %}",
data: {
'polygon': polygin,
'name': name_poly,
'tipelh': tdb,
'tahun': alamat_poly,
'luas': lb_poly,
},
dataType: 'json',
// type: 'POST',
// processData: false,
// contentType: false,
success: function(data) {
let response = data
if (response.status == 0) {
swal({
title: response.info,
text: response.data,
type: "success",
icon: "success",
confirmButtonColor: "#00BCD4"
})
} else {
swal({
title: response.info,
text: response.data,
type: "warning",
icon: "error",
confirmButtonColor: "#00BCD4"
})
}
map.closePopup();
}
});
});
$(document).on("click", "#btnsavepoint", function(e) {
data = new FormData()
......
......@@ -268,6 +268,10 @@
</div>
<div id="input_perbaikan_bang-s" class="modal fade">
</div>
<!-- modal tuplah -->
<div id="modal-edit-tuplah" class="modal fade">
<div class="modal-dialog" style="width: max-content;height: max-content;">
......@@ -291,7 +295,23 @@
<table>
<tr>
<th>
Image
Luas &nbsp;
</th>
<td>
<input id="luas_tuplah_edit" type="text" class="form-control" value="" style="width:fit-content;" disabled>
</td>
</tr>
<tr>
<th>
&nbsp;
</th>
<td>
&nbsp;
</td>
</tr>
<tr>
<th>
Image &nbsp;
</th>
<td>
<input type="file" id="imgtuplah" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
......@@ -324,8 +344,8 @@
<div class="modal-dialog modal-xs">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">3D Searching</h4>
<button type="button" class="close" style="color: white;" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" style="color: white;">3D Searching</h4>
</div>
<div class="modal-body">
<fieldset>
......@@ -625,7 +645,7 @@
<div class="col-md-4 text-center">
<a href="#" class="btn btn_create_lahan">
<div>
<img src="{% static 'img/icon-1/Vectorpoint.svg' %}" alt="" style="width: 35px;
<img src="{% static 'img/icon-1/SquareHalflahan.svg' %}" alt="" style="width: 35px;
height: 35px;">
</div>
<div style="margin-top: 10px;">
......@@ -636,7 +656,7 @@
<div class="col-md-4 text-center">
<a href="#" class="btn btn_cek_KDBKLB">
<div>
<img src="{% static 'img/icon-1/Vectorpoint.svg' %}" alt="" style="width: 35px;
<img src="{% static 'img/icon-1/kelurahan.svg' %}" alt="" style="width: 35px;
height: 35px;">
</div>
<div style="margin-top: 10px;">
......@@ -662,8 +682,8 @@
<div class="modal-body" id="create_all">
<div class="tabbable" style="height:450px!important;width: 560px!important;">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<li onclick="changetabs(this)" class="active"><a href=".koordinatjalan" data-toggle="tab" class="tab_1">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#informasi_create" data-toggle="tab" class="tab_2">Informasi Jalan</a></li>
<li onclick="changetabs(this)" id="tab_koor" class="active"><a href=".koordinatjalan" data-toggle="tab" class="tab_1">Koordinat</a></li>
<li onclick="changetabs(this)" id="tab_info"><a href="#informasi_create" data-toggle="tab" id="informasi_poo" class="tab_2">Informasi Jalan</a></li>
</ul>
<div class="tab-content">
......@@ -852,10 +872,7 @@
</div>
<div style="border-bottom: 1pt solid #E2E2E2;">
<div class="tab_personal_information" style="margin:0px;">
<div class="alert alert-danger" id="notificationsprop" style="display: none;margin: 0px;
padding-top: 0px;
padding-bottom: 0px;">
<div class="alert alert-danger" id="notificationsprop" style="display: none;margin: 0px;padding-top: 0px;padding-bottom: 0px;">
</div>
<form class="form-horizontal" id="formmen" method="post" enctype="multipart/form-data">
<div class="panel-body">
......
......@@ -8,7 +8,6 @@
<div id="labelchange">
<img src="{% static 'img/icon-1/Vector3d.svg' %}" alt="" style="height: 50px;
width: 50px;">
</div>
</a>
</div>
......
......@@ -29,14 +29,14 @@
</a>
</li>
<li style="margin-top: 60vh;position: absolute;">
<a href="#" id="btn-hide-all" class="side-bar-but" style="position: absolute;margin-top: 20px; display: block!important;">
<i class="icon-arrow-right13"></i>
<a href="#" id="btn-hide-all" class="side-bar-but" style="position: absolute; margin-top: 0px; display: none;">
<i class="icon-arrow-left12"></i>
</a>
</li>
</ul>
<ul class="navigation navigation-main navigation-accordion">
<ul class="navigation navigation-main navigation-accordion" style="height: 100px;">
<li>
<a href="#" class="side-bar-but" data-toggle="modal" data-target="#modal_help" data-backdrop="static" data-keyboard="false">
<img src="{% static 'img/icon-1/Vectoriconwarning.svg' %}" alt="" style="height: 17.875003814697266px;width: 17.875003814697266px;margin-left: -8px;">
......@@ -1170,7 +1170,7 @@
$("#manage_perbaikan").removeClass("active");
$("#panel-sm").removeClass("active");
$("#panel-sm2").removeClass("active");
$(this).css('display', 'none');
$(this).removeClass("hid");
});
......@@ -1179,7 +1179,7 @@
$("#manage_perbaikan").removeClass("active");
$("#panel-sm").removeClass("active");
$("#panel-sm2").removeClass("active");
$(this).css('display', 'none');
$(this).removeClass("hid");
};
......
......@@ -49,6 +49,10 @@
font-family: 'gilroyultralight';
src: url('/static/css/Gilroy-UltraLight.woff') format('woff');
}
.tab_kdb_klb {
display: none;
}
</style>
{% include 'includes/css-o.html' %} {% include 'includes/css-m.html' %}
......@@ -106,7 +110,7 @@
</head>
<body style="font-family: 'gilroylight';">
<body style="font-family: 'gilroylight';" oncontextmenu="return false">
......@@ -386,6 +390,32 @@
{% include 'includes/js-o.html' %} {% include 'includes/js-m.html' %}
<script type="text/javascript" src="{% static 'js/action.js' %}"></script>
<script>
// start disabled inspect
// document.addEventListener('contextmenu', function(e) {
// e.preventDefault();
// });
// document.onkeydown = function(e) {
// if(event.keyCode == 123) {
// return false;
// }
// if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) {
// return false;
// }
// if(e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)) {
// return false;
// }
// if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) {
// return false;
// }
// if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) {
// return false;
// }
// }
// end disabled inspect
var dar = null;
$('#search_spes li a').on('click', function() {
$('#input_search').val(null)
......@@ -551,61 +581,7 @@
// <option value="cagar_budaya">Cagar Budaya dan Tempat Wisata</option>
// <option value="gardu_listrik">Gardu Listrik</option>`
// }
var history
if (feature.administrasi.f11 == 'kantor_administrasi' || feature.administrasi.f11 == 'layanan_kesehatan' || feature.administrasi.f11 == 'puskesmas' ||
feature.administrasi.f11 == 'rumah_sakit' || feature.administrasi.f11 == 'sarana_pendidikan' || feature.administrasi.f11 == 'stasiun' ||
feature.administrasi.f11 == 'terminal_bus' || feature.administrasi.f11 == 'cagar_budaya' || feature.administrasi.f11 == 'gardu_listrik') {
if (feature.properties.f4 != null) {
var list_history = feature.properties.f4
var list_history_panel = ``
for (var i = 0; i < list_history.length; i++) {
var dt_history = list_history[i].split(",");
var data_history = `<div class="form-group" style="margin-bottom:0px;">
<div class="row">
<label class="col-md-6">` + dt_history[1] + `</label>
<label class="col-md-6">` + dt_history[2] + `</label>
</div>
</div>`;
list_history_panel += data_history
};
history = `
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center">
<img src="static/img/icon/samping_history.svg" alt="Image" style="height: 20px; width: 20px;">
</p>
<p class="text-center">
<b>History Perbaikan</b>
</p>
<br>
<label class="col-md-6"><b>Tanggal</b></label>
<label class="col-md-6"><b>Jenis Perbaikan</b></label>
` + list_history_panel + `
<p class="text-center" style="margin-top: 15px;">
<a id='btn_detail_per_bang' onclick="getdetailperbang(` + feature.properties.f1 + `)" data-toggle="modal" data-target="#modal_detail" class="btn btn-primary" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-list-ul" style="color:#ffffff"> </i><i style="margin-left: 5px;">View Detail</i></a>
<a href="#" id='btn_perbaikan_bangunan' data-toggle="modal" data-target="#input_perbaikan_bang" data-backdrop="static" data-keyboard="false" class="btn btn-primary" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-plus" style="color:#ffffff"> </i><i style="margin-left: 5px;">Tambah History Perbaikan</i></a>
</p>
</th>
</tr>`;
} else {
history = `
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center">
History Perbaikan
</p>
<br>
<p class="text-center" style="margin-top: 10px;"><i>Belum Ada History</i></p>
<p class="text-center" style="margin-top: 10px;">
<a href="#" id='btn_perbaikan_bangunan' data-toggle="modal" data-target="#input_perbaikan_bang" data-backdrop="static" data-keyboard="false" class="btn btn-primary" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-plus" style="color:#ffffff"> </i><i style="margin-left: 5px;">Tambah History Perbaikan</i></a>
</p>
</th>
</tr>`;
}
} else {
history = ``
}
content_edit = `
<div class="modal-dialog" style="width: max-content;height: max-content;">
......@@ -800,9 +776,9 @@
<div class="tab-content">
<div class="tab-pane active" id="left-tab1-feas-upl">
<input type="text" class="hidden" id="poly_create_input_bang">
<input type="text" class="hidden" id="id_bang_perbaikan">
<input type="text" class="hidden" id="id_bang_perbaikan" value="` + feature.properties.f1 + `" disable>
<input type="text" class="hidden" id="type_id_bang">
<div id="map-insert-renov-bang" style="height: 375px;width: 100%">
<div id="map-insert-renov-bang-s" style="height: 375px;width: 100%">
</div>
</div>
......@@ -886,92 +862,162 @@
</div>
</div>
</div>`;
// content = `
// <table class="table tasks-list">
// <thead style="text-align: center;">
// <tr>
// <th style="padding: 0 0 0 0px;">
// <img src=` + path_img + ` alt="Image" style="width: 100%;max-height: 368px;height:368">
// </th>
// </tr>
// </thead>
// <tbody>
// <div class= "container">
// <tr style="height: 100px;">
// <th>
// <div>
// <h1 style="font-family: Google Sans,Roboto,Arial,sans-serif;
// letter-spacing: 0;
// font-weight: 400;">
// <span style="font-size: x-large;">
// ` + feature.properties.f2 + `
// </span>
// </h1>
// </div>
// </th>
// </tr>
// </div>
// <div class= "container">
// <tr style="height: 30px;">
// <th>
// <span>
// ` + feature.administrasi.f12 + `
// </span>
// </th>
// </tr>
// </div>
// <div class= "container">
// <tr style="height: 40px;">
// <th>
// <p style="text-align:center;">
// <img src="static/img/icon/samping_location.svg" alt="Image" style="height: 30px; width: 30px;">
// </p>
// <p>
// <span>
// ` + alamat + feature.administrasi.f1 + `, ` + feature.administrasi.f2 + `, ` + feature.administrasi.f3 + `, ` + feature.administrasi.f4 + `
// </span>
// </p>
// </th>
// </tr>
// </div>
// <div class= "container">
// <tr style="height: 40px;">
// <th>
// <p style="text-align:center;">
// <img src="static/img/icon/samping_informasi.svg" alt="Image" style="height: 30px; width: 30px;">
// </p>
// <p>
// <span>Luas Bangunan : ` + feature.administrasi.f6 + `</span>
// </p>
// <p>
// <span>Luas Tanah : ` + feature.administrasi.f7 + `</span>
// </p>
// <p>
// <span>Tinggi Bangunan : ` + feature.administrasi.f8 + `</span>
// </p>
// <p>
// <span>Pemilik : ` + feature.administrasi.f10 + `</span>
// </p>
// </th>
// </tr>
// </div>
// <div class= "container">
// <tr style="height: 40px;">
// <th>
// <p class="text-center" style="margin-top: 5px;">
// <a href="#" class="btn btn-primary" data-toggle="modal" data-target="#modal_bangunan_edit" id="btn_edit_bangunan" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-edit" style="color:#ffffff"> </i><i style="margin-left: 5px;">Edit Informasi Bangunan</i></a>
// <a href="#" id='btn_delete_bangunan' class='btn
// btn-primary btn_edit_bangunan' data-toggle="modal" data-target="#modal_bangunan_delete" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-trash" style="color:#ffffff"> </i><i style="margin-left: 5px;">Delete Bangunan</i></a>
// </p>
// </th>
// </tr>
// </div>
// <div class="container">
// `+history+`
// </div>
// </tbody>
// </table>`;
// $("#isi_panel").html(content);
var history
if (feature.administrasi.f11 == 'kantor_administrasi' || feature.administrasi.f11 == 'layanan_kesehatan' || feature.administrasi.f11 == 'puskesmas' ||
feature.administrasi.f11 == 'rumah_sakit' || feature.administrasi.f11 == 'sarana_pendidikan' || feature.administrasi.f11 == 'stasiun' ||
feature.administrasi.f11 == 'terminal_bus' || feature.administrasi.f11 == 'cagar_budaya' || feature.administrasi.f11 == 'gardu_listrik') {
if (feature.properties.f4 != null) {
var list_history = feature.properties.f4
var list_history_panel = ``
for (var i = 0; i < list_history.length; i++) {
var dt_history = list_history[i].split(",");
var data_history = `<div class="form-group" style="margin-bottom:0px;">
<div class="row">
<label class="col-md-6">` + dt_history[1] + `</label>
<label class="col-md-6">` + dt_history[2] + `</label>
</div>
</div>`;
list_history_panel += data_history
};
history = `
<div>
<div style="margin-top: 150px;">
<span>Perbaikan Terakhir</span>
<span>
<a id='btn_detail_per_bang' onclick="getdetailperbang(` + feature.properties.f1 + `)" data-toggle="modal" data-target="#modal_detail" style = "text-align:right; margin-right:26px;"><i>Detail</i></a>
</span>
</div>
<div>
<span>
<tr style="height: 40px;">
<th id="history_panel">
<div class="form-group" style="margin-bottom:0px;">
<div class="row">
<label class="col-md-6">` + list_history[0].split(",")[1] + `</label>
<label class="col-md-6">` + list_history[0].split(",")[2] + `</label>
</div>
</div>
<p class="text-center" style="margin-top: 5px;">
<a href="#" id="btn_perbaikan_bangunan-s" data-toggle="modal" data-target="#input_perbaikan_bang-s"><i>Input Perbaikan</i></a>
</p>
</th>
</tr>
</span>
</div>
</div>
`;
} else {
history = `
<div>
<div style="margin-top: 150px;">
<span>Perbaikan Terakhir</span>
</div>
<div>
<span>
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center" style="margin-top: 10px;"><i>Belum Ada History</i></p>
<p class="text-center" style="margin-top: 10px;">
<a href="#" id="btn_perbaikan_bangunan-s" data-toggle="modal" data-target="#input_perbaikan_bang-s"><i>Input Perbaikan</i></a>
</p>
</th>
</tr>
</span>
</div>
</div>
`;
}
} else {
history = ``
}
content = `
<table class="table tasks-list">
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src=` + path_img + ` alt="Image" style="width: 100%;max-height: 368px;height:368">
</th>
</tr>
</thead>
<tbody>
<div class= "container">
<tr style="height: 100px;">
<th>
<div>
<h1 style="font-family: Google Sans,Roboto,Arial,sans-serif;
letter-spacing: 0;
font-weight: 400;">
<span style="font-size: x-large;">
` + feature.properties.f2 + `
</span>
</h1>
</div>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 30px;">
<th>
<span>
` + feature.administrasi.f12 + `
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p style="text-align:center;">
<img src="static/img/icon/samping_location.svg" alt="Image" style="height: 30px; width: 30px;">
</p>
<p>
<span>
` + alamat + feature.administrasi.f1 + `, ` + feature.administrasi.f2 + `, ` + feature.administrasi.f3 + `, ` + feature.administrasi.f4 + `
</span>
</p>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p style="text-align:center;">
<img src="static/img/icon/samping_informasi.svg" alt="Image" style="height: 30px; width: 30px;">
</p>
<p>
<span>Luas Bangunan : ` + feature.administrasi.f6 + `</span>
</p>
<p>
<span>Luas Tanah : ` + feature.administrasi.f7 + `</span>
</p>
<p>
<span>Tinggi Bangunan : ` + feature.administrasi.f8 + `</span>
</p>
<p>
<span>Pemilik : ` + feature.administrasi.f10 + `</span>
</p>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p class="text-center" style="margin-top: 5px;">
<a href="#" class="btn btn-primary" data-toggle="modal" data-target="#modal_bangunan_edit" id="btn_edit_bangunan" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-edit" style="color:#ffffff"> </i><i style="margin-left: 5px;">Edit Informasi Bangunan</i></a>
<a href="#" id='btn_delete_bangunan' class='btn
btn-primary btn_edit_bangunan' data-toggle="modal" data-target="#modal_bangunan_delete" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-trash" style="color:#ffffff"> </i><i style="margin-left: 5px;">Delete Bangunan</i></a>
</p>
</th>
</tr>
</div>
<div class="container">
` + history + `
</div>
</tbody>
</table>
`;
$(".gambar_keterangan").html(`<img src="` + path_img + `" alt="" style="width:100%;height:240px;border-top-left-radius: 10px;border-bottom-left-radius: 10px;">`)
$(".nama_keterangan").html(`<div>
<span style="font-size: large;">
......@@ -987,51 +1033,54 @@
`)
$(".isi_keterangan").html(`<input type="text" name="idjalan" id="idjalan" class="hidden" value="">
<input type="text" name="coordinatejalan" id="coordinatejalan" class="hidden" value="">
<div>
<div>
<span>Jenis Bangunan</span>
</div>
<div>
<span>
` + feature.administrasi.f12 + `
</span>
</div>
</div>
<div>
<div>
<span>Luas Bangunan</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f6 + ` m</span>
</div>
</div>
<div>
<div>
<span>Luas Tanah</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f7 + ` m</span>
</div>
</div>
<div>
<div>
<span>Tinggi Bangunan</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f8 + ` m</span>
</div>
</div>
<input type="text" name="coordinatejalan" id="coordinatejalan" class="hidden" value="">
<div class="col-md-6">
<div>
<div>
<span style="font-family: 'gilroylight';">Jenis Bangunan</span>
</div>
<div>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f12 + `</span>
</div>
</div>
<div>
<div style="margin-top:5px;">
<span style="font-family: 'gilroylight';">Luas Bangunan</span>
</div>
<div>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f6 + ` m</span>
</div>
</div>
<div>
<div>
<span style="font-family: 'gilroylight';">Luas Tanah</span>
</div>
<div>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f7 + ` m</span>
</div>
</div>
</div>
<div class="col-md-6">
<div>
<div>
<span style="font-family: 'gilroylight';">Tinggi Bangunan</span>
</div>
<div>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f8 + ` m</span>
</div>
</div>
<div>
<div>
<span>Pemilik</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f10 + ` m</span>
</div>
</div>`);
<div>
<div style="margin-top:5px;">
<span style="font-family: 'gilroylight';">Pemilik</span>
</div>
<div>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f10 + ` m</span>
</div>
</div>
</div>
` + history + `
`);
$(".btn_action").html(`<div class="tombol-edit-keterangan text-center" style="background-color: #5A9AFB;position: absolute;width: 40px;height: 40px;bottom: 2px;right: 5px;border: 1pt solid rosybrown;border-radius: 8px;">
<a href="#" id="btn_edit_bangunan" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-pencil5"></i></a>
......@@ -1040,96 +1089,10 @@
<a href="#" id="btn_delete_bangunan" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-eraser2"></i></a>
</div>
`)
content = `
<table class="table tasks-list">
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src=` + path_img + ` alt="Image" style="width: 100%;max-height: 368px;height:368">
</th>
</tr>
</thead>
<tbody>
<div class= "container">
<tr style="height: 100px;">
<th>
<div>
<h1 style="font-family: Google Sans,Roboto,Arial,sans-serif;
letter-spacing: 0;
font-weight: 400;">
<span style="font-size: x-large;">
` + feature.properties.f2 + `
</span>
</h1>
</div>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 30px;">
<th>
<span>
` + feature.administrasi.f12 + `
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p style="text-align:center;">
<img src="static/img/icon/samping_location.svg" alt="Image" style="height: 30px; width: 30px;">
</p>
<p>
<span>
` + alamat + feature.administrasi.f1 + `, ` + feature.administrasi.f2 + `, ` + feature.administrasi.f3 + `, ` + feature.administrasi.f4 + `
</span>
</p>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p style="text-align:center;">
<img src="static/img/icon/samping_informasi.svg" alt="Image" style="height: 30px; width: 30px;">
</p>
<p>
<span>Luas Bangunan : ` + feature.administrasi.f6 + `</span>
</p>
<p>
<span>Luas Tanah : ` + feature.administrasi.f7 + `</span>
</p>
<p>
<span>Tinggi Bangunan : ` + feature.administrasi.f8 + `</span>
</p>
<p>
<span>Pemilik : ` + feature.administrasi.f10 + `</span>
</p>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p class="text-center" style="margin-top: 5px;">
<a href="#" class="btn btn-primary" data-toggle="modal" data-target="#modal_bangunan_edit" id="btn_edit_bangunan" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-edit" style="color:#ffffff"> </i><i style="margin-left: 5px;">Edit Informasi Bangunan</i></a>
<a href="#" id='btn_delete_bangunan' class='btn
btn-primary btn_edit_bangunan' data-toggle="modal" data-target="#modal_bangunan_delete" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-trash" style="color:#ffffff"> </i><i style="margin-left: 5px;">Delete Bangunan</i></a>
</p>
</th>
</tr>
</div>
<div class="container">
` + history + `
</div>
</tbody>
</table>`;
$("#isi_panel").html(content);
$("#modal_bangunan_edit").html(content_edit);
$("#modal_bangunan_delete").html(content_delete);
$("#input_perbaikan_bang").html(content_inp_his_bang);
$("#input_perbaikan_bang-s").html(content_inp_his_bang);
panel_samp();
});
// $("#tipe_point_b_e").val('feature.administrasi.f11').change();
......@@ -1229,53 +1192,10 @@
});
map.setView([data['gen'][0][0]['geometry']['coordinates'][0][0][0][1], data['gen'][0][0]['geometry']['coordinates'][0][0][0][0]], 19);
geo_bangunan.addTo(map)
// if (checkBox_building.checked == false) {
// geo_bangunan.clearLayers();
// geo_bangunan.remove();
// }
// map.eachLayer(function (layer) {
// if (!!geo_bangunan.toGeoJSON) {
// map.removeLayer(geo_bangunan);
// }
// geo_bangunan.clearLayers()
// map.on("movestart", function() {
// geo_bangunan.clearLayers();
// });
// function gasin(){
// $.ajax({
// url: "{% url 'api:search_lanjut' %}",
// data: {
// 'type':dar,
// 'idx':idm,
// 'db':db
// },
// dataType: 'json',
// success: function(data) {
// // if (map.hasLayer(geo_bangunan)) {
// // geo_bangunan.clearLayers()
// // geo_bangunan.remove()
// // }
// let list_poly = [];
// for (var i = 0; i < data['gen'].length; i++) {
// geoj = data['gen'][i][0];
// list_poly.push(geoj);
// };
// // geo_bangunan.clearLayers()
// // geo_bangunan.remove()
// geo_json_bangunan(list_poly);
// }
// });
// map.setView([data['gen'][0][0]['geometry']['coordinates'][0][0][0][1], data['gen'][0][0]['geometry']['coordinates'][0][0][0][0]], 19);
// // geo_bangunan.clearLayers()
// geo_bangunan.addTo(map)
// }
// });
geo_bangunan.addTo(map);
$(document).on("click", "#btn_edit_bangunan", function() {
$("#modal_bangunan_edit").css('display', 'block');
var tipe1 = $('#tipe111').val();
$('#tipe_point_b_e option[value=' + tipe1 + ']').attr('selected', 'selected');
......@@ -1477,6 +1397,7 @@
});
$(document).on("click", "#btn_delete_bangunan", function() {
$("#modal_bangunan_delete").css('display', 'block');
var map_delete = new L.map('map-delete', {
editable: true,
zoomControl: false,
......@@ -1487,6 +1408,7 @@
maxZoom: 22,
minZoom: 4,
}).addTo(map_delete);
var id_polyhps = $('#idbangunanhps').val();
// console.log(id_polyhps)
loaderPage(true);
......@@ -1561,39 +1483,10 @@
});
var map_bang = new L.map('map-insert-renov-bang', {
editable: true,
zoomControl: false,
drawControl: true
}).setView([-2, 118], 5);
mapssx = L.tileLayer('https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', {
maxZoom: 22,
minZoom: 4,
}).addTo(map_bang);
var polyxxx = L.polygon([
[-4.1283969, 104.1674575],
[-4.128396, 104.1674947],
[-4.1284664, 104.1674964],
[-4.1284674, 104.1674593],
[-4.1283969, 104.1674575]
]).addTo(map_bang)
// var geo_bangunan_input = L.geoJson(null, {
// style: function(feature) {
// return {
// color: "#06FF08",
// weight: 8,
// opacity: 2,
// zIndex: 1000
// };
// }
// }).addTo(map_bang);
$(document).on("click", "#btn_perbaikan_bangunan", function() {
var map_bang = new L.map('map-insert-renov-bang', {
editable: true,
$(document).on("click", "#btn_perbaikan_bangunan-s", function() {
// $("#input_perbaikan_bang-s").css("display", "block");
var map_bang = new L.map('map-insert-renov-bang-s', {
editable: false,
zoomControl: false,
drawControl: true
}).setView([-2, 118], 5);
......@@ -1603,11 +1496,13 @@
minZoom: 4,
}).addTo(map_bang);
$("#input_perbaikan_bang").css("display", "block");
if (map_bang.hasLayer(polyxxx)) {
polyxxx.remove()
}
var id_polyx = $('#idbangunan').val();
// if (map_bang.hasLayer(polyxxx)) {
// polyxxx.remove()
// }
var id_polyx = $('#id_bang_perbaikan').val();
loaderPage(true);
$.ajax({
url: "{% url 'apps:input-perbaikan-bang' %}",
......@@ -1616,6 +1511,12 @@
},
dataType: 'json',
success: function(data) {
setTimeout(function() {
map_bang.invalidateSize();
}, 1000);
loaderPage(false);
$("#nama_bang").val(data[0]);
$("#type_bang").val(data[4]);
$("#id_bang_perbaikan").val(data[3]);
......@@ -1645,7 +1546,7 @@
})
}
})
})
});
$(document).on("click", "#save-perbaikan_bang", function(e) {
var polyginbang = $('#coorbangbaru').val();
......@@ -1725,7 +1626,7 @@
icon: "success",
confirmButtonColor: "#00BCD4"
}, function() {
$("#input_perbaikan_bang").css("display", "none");
$("#input_perbaikan_bang-s").css("display", "none");
})
} else {
swal({
......@@ -2113,7 +2014,7 @@
});
$(document).on("click", "#btn_jalan", function() {
$("#modal-jalan").css('display', 'block');
if (map_edit_jalan.hasLayer(polygon_edit_jalan)) {
polygon_edit_jalan.remove()
}
......@@ -2171,7 +2072,7 @@
//tes
$(document).on("click", "#btn_hapus_jalan", function() {
$("#modal-hapus-jalan").css('display', 'block');
var id_poly = $('#idjalan').val();
$.ajax({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment