Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OKU-GIS
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhamad
OKU-GIS
Commits
1dc705f3
Commit
1dc705f3
authored
Aug 02, 2021
by
Manggar Mahardhika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
88ae78e8
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1751 additions
and
710 deletions
+1751
-710
API/urls.py
API/urls.py
+1
-0
API/views.py
API/views.py
+180
-30
Application/urls.py
Application/urls.py
+1
-0
Application/views.py
Application/views.py
+23
-3
OKU/settings.py
OKU/settings.py
+2
-2
templates/includes/content.html
templates/includes/content.html
+122
-0
templates/includes/css-o.html
templates/includes/css-o.html
+6
-0
templates/includes/insert.html
templates/includes/insert.html
+4
-3
templates/includes/js-m.html
templates/includes/js-m.html
+799
-91
templates/includes/js-o.html
templates/includes/js-o.html
+573
-573
templates/includes/modal.html
templates/includes/modal.html
+40
-8
No files found.
API/urls.py
View file @
1dc705f3
...
@@ -47,6 +47,7 @@ urlpatterns = [
...
@@ -47,6 +47,7 @@ urlpatterns = [
path
(
'hapus'
,
views
.
hapus
,
name
=
'hapus'
),
path
(
'hapus'
,
views
.
hapus
,
name
=
'hapus'
),
path
(
'dkantor'
,
views
.
deletekantoradmin
,
name
=
'dkantor'
),
path
(
'dkantor'
,
views
.
deletekantoradmin
,
name
=
'dkantor'
),
path
(
'change-tipe'
,
views
.
changetipe
,
name
=
'change-tipe'
),
path
(
'c_bangunan'
,
views
.
createbang
,
name
=
'c_bangunan'
),
path
(
'c_bangunan'
,
views
.
createbang
,
name
=
'c_bangunan'
),
path
(
'create-jalan'
,
views
.
createjalan
,
name
=
'create-jalan'
),
path
(
'create-jalan'
,
views
.
createjalan
,
name
=
'create-jalan'
),
...
...
API/views.py
View file @
1dc705f3
...
@@ -104,7 +104,7 @@ def jalan(request):
...
@@ -104,7 +104,7 @@ def jalan(request):
print
(
kulon
,
lor
,
wetan
,
lor
,
wetan
,
kidul
,
kulon
,
kidul
,
kulon
,
lor
,
kulon
,
lor
,
wetan
,
lor
,
wetan
,
kidul
,
kulon
,
kidul
,
kulon
,
lor
)
print
(
kulon
,
lor
,
wetan
,
lor
,
wetan
,
kidul
,
kulon
,
kidul
,
kulon
,
lor
,
kulon
,
lor
,
wetan
,
lor
,
wetan
,
kidul
,
kulon
,
kidul
,
kulon
,
lor
)
with
conn
.
cursor
()
as
jalan
:
with
conn
.
cursor
()
as
jalan
:
jalan
.
execute
(
"SELECT json_build_object ('type', 'Feature', 'properties', ( gj.ID,
gj.
namrjl, st_length ( gj.geom :: geography ), gj.lebar_jalan, gj.remark, gj.gambar,(SELECT ARRAY_AGG ( '' || id || ',' || tgl_perbaikan || '' order by tgl_perbaikan DESC ) FROM tbl_perbaikan WHERE id_object = gj.ID and type_id = 2) ), 'geometry', ST_AsGeoJSON ( st_intersection(gj.geom, 'SRID=4326;POLYGON((
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s))') :: geometry ) :: json ) FROM geo_jalan gj WHERE st_intersects(gj.geom,'SRID=4326;POLYGON((
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s))') GROUP BY gj.id"
%
(
kulon
,
lor
,
wetan
,
lor
,
wetan
,
kidul
,
kulon
,
kidul
,
kulon
,
lor
,
kulon
,
lor
,
wetan
,
lor
,
wetan
,
kidul
,
kulon
,
kidul
,
kulon
,
lor
))
jalan
.
execute
(
"SELECT json_build_object ('type', 'Feature', 'properties', ( gj.ID, namrjl, st_length ( gj.geom :: geography ), gj.lebar_jalan, gj.remark, gj.gambar,(SELECT ARRAY_AGG ( '' || id || ',' || tgl_perbaikan || '' order by tgl_perbaikan DESC ) FROM tbl_perbaikan WHERE id_object = gj.ID and type_id = 2) ), 'geometry', ST_AsGeoJSON ( st_intersection(gj.geom, 'SRID=4326;POLYGON((
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s))') :: geometry ) :: json ) FROM geo_jalan gj WHERE st_intersects(gj.geom,'SRID=4326;POLYGON((
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s))') GROUP BY gj.id"
%
(
kulon
,
lor
,
wetan
,
lor
,
wetan
,
kidul
,
kulon
,
kidul
,
kulon
,
lor
,
kulon
,
lor
,
wetan
,
lor
,
wetan
,
kidul
,
kulon
,
kidul
,
kulon
,
lor
))
prov_res
=
jalan
.
fetchall
()
prov_res
=
jalan
.
fetchall
()
data
=
{
'gen'
:
prov_res
}
data
=
{
'gen'
:
prov_res
}
...
@@ -660,6 +660,11 @@ def validatedit(request):
...
@@ -660,6 +660,11 @@ def validatedit(request):
pro_b
=
request
.
POST
.
get
(
"pro_b"
)
pro_b
=
request
.
POST
.
get
(
"pro_b"
)
gmb_b
=
request
.
POST
.
get
(
"gambar"
)
gmb_b
=
request
.
POST
.
get
(
"gambar"
)
luast_b
=
request
.
POST
.
get
(
"luastanah_b"
)
luasb_b
=
request
.
POST
.
get
(
"luasbangunan_b"
)
tinggi_b
=
request
.
POST
.
get
(
"tinggibangunan_b"
)
pemilik_b
=
request
.
POST
.
get
(
"pemilik_b"
)
id_poly
=
request
.
POST
.
get
(
"id_poly"
)
id_poly
=
request
.
POST
.
get
(
"id_poly"
)
polygon
=
request
.
POST
.
get
(
"polygon"
)
polygon
=
request
.
POST
.
get
(
"polygon"
)
print
(
polygon
)
print
(
polygon
)
...
@@ -683,7 +688,7 @@ def validatedit(request):
...
@@ -683,7 +688,7 @@ def validatedit(request):
print
(
co_edit
,
name_b
,
info_b
,
desa_b
,
kec_b
,
kab_b
,
pro_b
,
namafile
,
int
(
id_poly
))
print
(
co_edit
,
name_b
,
info_b
,
desa_b
,
kec_b
,
kab_b
,
pro_b
,
namafile
,
int
(
id_poly
))
with
conn
.
cursor
()
as
buldings
:
with
conn
.
cursor
()
as
buldings
:
buldings
.
execute
(
"""UPDATE geo_bangunan set geom = st_geomfromgeojson('{"type":"MultiPolygon", "coordinates":[
%
s]}'),name='
%
s',information='
%
s',address_1='
%
s', address_2 = '
%
s', address_3 = '
%
s', provinsi='
%
s', gambar = '
%
s', is_deleted = 0
WHERE id =
%
s"""
%
(
co_edit
,
name_b
,
info_b
,
desa_b
,
kec_b
,
kab_b
,
pro_b
,
namafile
,
int
(
id_poly
)))
buldings
.
execute
(
"""UPDATE geo_bangunan set geom = st_geomfromgeojson('{"type":"MultiPolygon", "coordinates":[
%
s]}'),name='
%
s',information='
%
s',address_1='
%
s', address_2 = '
%
s', address_3 = '
%
s', provinsi='
%
s', gambar = '
%
s', is_deleted = 0
, luas_bangunan=
%
s, luas_tanah=
%
s, tinggi_bangunan=
%
s, pemilik='
%
s' WHERE id =
%
s"""
%
(
co_edit
,
name_b
,
info_b
,
desa_b
,
kec_b
,
kab_b
,
pro_b
,
namafile
,
luasb_b
,
luast_b
,
tinggi_b
,
pemilik_b
,
int
(
id_poly
)))
conn
.
commit
()
conn
.
commit
()
data
=
'SUCCESS'
data
=
'SUCCESS'
...
@@ -1508,16 +1513,76 @@ def createbang(request):
...
@@ -1508,16 +1513,76 @@ def createbang(request):
name
=
request
.
GET
.
get
(
'name'
)
name
=
request
.
GET
.
get
(
'name'
)
info
=
request
.
GET
.
get
(
'info'
)
info
=
request
.
GET
.
get
(
'info'
)
a
lamat
=
request
.
GET
.
get
(
'alamat'
)
a
talam
=
request
.
GET
.
get
(
'alamat'
)
lb
=
request
.
GET
.
get
(
'lb'
)
lb
=
request
.
GET
.
get
(
'lb'
)
lt
=
request
.
GET
.
get
(
'lt'
)
lt
=
request
.
GET
.
get
(
'lt'
)
tb
=
request
.
GET
.
get
(
'tb'
)
tibang
=
request
.
GET
.
get
(
'tb'
)
pemilik
=
request
.
GET
.
get
(
'pemilik'
)
ltbang
=
request
.
GET
.
get
(
'ltb'
)
kilimep
=
request
.
GET
.
get
(
'pemilik'
)
namafile
=
"None"
namafile
=
"None"
latlng
=
po_create
.
split
(
"],["
)[
0
]
latlng
=
po_create
.
split
(
"],["
)[
0
]
print
(
p_create
)
print
(
latlng
)
if
name
==
""
:
name
=
"None"
else
:
name
=
name
if
info
==
""
:
info
=
"None"
else
:
info
=
info
if
lb
==
""
:
lb
=
0
else
:
lb
=
lb
if
lt
==
""
:
lt
=
0
else
:
lt
=
lt
if
atalam
==
""
:
alamat
=
"None"
else
:
alamat
=
atalam
print
(
alamat
)
try
:
try
:
if
tibang
==
""
and
ltbang
!=
""
:
tb
=
ltbang
*
3
elif
tibang
==
""
and
ltbang
==
""
:
tb
=
0
ltb
=
0
else
:
tb
=
tibang
except
:
tb
=
0
print
(
tb
)
try
:
if
ltbang
==
""
and
tibang
!=
""
:
ltb
=
int
(
int
(
tibang
)
/
3
)
elif
tibang
==
""
and
ltbang
==
""
:
tb
=
0
ltb
=
0
else
:
ltb
=
ltbang
except
:
ltb
=
0
print
(
ltb
)
if
kilimep
==
""
:
pemilik
=
"unnamed"
else
:
pemilik
=
kilimep
print
(
pemilik
)
# try:
with
conn
.
cursor
()
as
kel
:
with
conn
.
cursor
()
as
kel
:
kel
.
execute
(
"SELECT desa, kecamatan, kab_kota, provinsi FROM geo_data_kelurahan WHERE st_intersects(geom, 'SRID=4326;POINT(
%
s)'::geometry)"
%
latlng
)
kel
.
execute
(
"SELECT desa, kecamatan, kab_kota, provinsi FROM geo_data_kelurahan WHERE st_intersects(geom, 'SRID=4326;POINT(
%
s)'::geometry)"
%
latlng
)
adm
=
kel
.
fetchall
()
adm
=
kel
.
fetchall
()
...
@@ -1525,21 +1590,22 @@ def createbang(request):
...
@@ -1525,21 +1590,22 @@ def createbang(request):
administrasi
=
adm
[
0
]
administrasi
=
adm
[
0
]
with
conn
.
cursor
()
as
buldings
:
with
conn
.
cursor
()
as
buldings
:
buldings
.
execute
(
"""INSERT INTO geo_bangunan(geom, name, information, sumber, alamat, address_1, address_2, address_3, provinsi, no, luas_bangunan, luas_tanah, tinggi_bangunan, gambar, pemilik) VALUES (ST_GeomFromEWKT('SRID=0;MULTIPOLYGON(((
%
s)))'), '
%
s', '
%
s', 'new', '
%
s', '
%
s', '
%
s', '
%
s', '
%
s', '0', '
%
s', '
%
s', '
%
s', '
%
s', '
%
s')"""
%
(
p_create
,
name
,
info
,
alamat
,
administrasi
[
0
],
administrasi
[
1
],
administrasi
[
2
],
administrasi
[
3
],
lb
,
lt
,
tb
,
namafile
,
pemilik
))
buldings
.
execute
(
"""INSERT INTO geo_bangunan(geom, name, information, sumber, alamat, address_1, address_2, address_3, provinsi, no, luas_bangunan, luas_tanah, tinggi_bangunan, lantai, gambar, pemilik) VALUES (ST_GeomFromEWKT('SRID=0;MULTIPOLYGON(((
%
s)))'), '
%
s', '
%
s', 'new', '
%
s', '
%
s', '
%
s', '
%
s', '
%
s', '0', '
%
s', '
%
s', '
%
s', '
%
s', '
%
s', '
%
s')"""
%
(
p_create
,
name
,
info
,
alamat
,
administrasi
[
0
],
administrasi
[
1
],
administrasi
[
2
],
administrasi
[
3
],
lb
,
lt
,
tb
,
l
tb
,
namafile
,
pemilik
))
conn
.
commit
()
conn
.
commit
()
data
=
{
'status'
:
'Success'
}
data
=
{
'status'
:
'Success'
}
data
=
'SUCCESS'
data
=
'SUCCESS'
info
=
'data telah diperbaharui'
info
=
'data telah diperbaharui'
status
=
0
status
=
0
except
:
#
except:
data
=
'Sorry'
#
data = 'Sorry'
info
=
'Dalam Perbaikan'
#
info = 'Dalam Perbaikan'
status
=
1
#
status = 1
respon
=
{
'data'
:
data
,
'info'
:
info
,
'status'
:
status
}
respon
=
{
'data'
:
data
,
'info'
:
info
,
'status'
:
status
}
return
Response
(
respon
)
return
Response
(
respon
)
import
re
@
api_view
((
'POST'
,))
@
api_view
((
'POST'
,))
def
createjalan
(
request
):
def
createjalan
(
request
):
polyline
=
request
.
POST
.
get
(
'polyline'
)
polyline
=
request
.
POST
.
get
(
'polyline'
)
...
@@ -1549,6 +1615,10 @@ def createjalan(request):
...
@@ -1549,6 +1615,10 @@ def createjalan(request):
tipe_jalan
=
request
.
POST
.
get
(
'tipe_jalan'
)
tipe_jalan
=
request
.
POST
.
get
(
'tipe_jalan'
)
img_jalan
=
request
.
FILES
.
get
(
'gambar'
)
img_jalan
=
request
.
FILES
.
get
(
'gambar'
)
panjang_jalan
=
re
.
sub
(
'[^0-9.]+'
,
''
,
str
(
panjang_jalan
))
if
lebar_jalan
==
''
:
lebar_jalan
=
0
print
(
panjang_jalan
)
coord
=
json
.
loads
(
str
(
polyline
))
coord
=
json
.
loads
(
str
(
polyline
))
print
(
coord
)
print
(
coord
)
...
@@ -1590,7 +1660,7 @@ def createjalan(request):
...
@@ -1590,7 +1660,7 @@ def createjalan(request):
try
:
try
:
with
conn
.
cursor
()
as
jalan
:
with
conn
.
cursor
()
as
jalan
:
jalan
.
execute
(
"""INSERT INTO geo_jalan(geom, namrjl, panjang_jalan, lebar_jalan, remark, gambar) VALUES (ST_GeomFromEWKT('SRID=4326;
%
s'), '
%
s',
%
s,
%
s,'
%
s','
%
s')"""
%
(
coordinat
,
name_jalan
,
panjang_jalan
,
lebar_jalan
,
tipe_jalan
,
ngambar
))
jalan
.
execute
(
"""INSERT INTO geo_jalan(geom, namrjl, panjang_jalan, lebar_jalan, remark, gambar) VALUES (ST_GeomFromEWKT('SRID=4326;
%
s'), '
%
s',
%
s,
%
s,'
%
s','
%
s')"""
%
(
coordinat
,
name_jalan
,
panjang_jalan
,
lebar_jalan
,
tipe_jalan
,
ngambar
))
conn
.
commit
()
conn
.
commit
()
data
=
'SUCCESS'
data
=
'SUCCESS'
...
@@ -1604,6 +1674,67 @@ def createjalan(request):
...
@@ -1604,6 +1674,67 @@ def createjalan(request):
respon
=
{
'data'
:
data
,
'info'
:
info
,
'status'
:
status
}
respon
=
{
'data'
:
data
,
'info'
:
info
,
'status'
:
status
}
return
Response
(
respon
)
return
Response
(
respon
)
@
api_view
((
'GET'
,))
def
changetipe
(
request
):
tipe_point
=
request
.
GET
.
get
(
'tipe'
)
if
tipe_point
==
'administrasi'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""SELECT DISTINCT remark FROM geo_kantor_administrasi"""
)
tipepoint
=
point
.
fetchall
()
if
tipe_point
==
'layanankesehatan'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""SELECT DISTINCT remark FROM geo_layanan_kesehatan"""
)
tipepoint
=
point
.
fetchall
()
if
tipe_point
==
'puskesmas'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""SELECT DISTINCT remark FROM geo_puskesmas"""
)
tipepoint
=
point
.
fetchall
()
if
tipe_point
==
'rumahsakit'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""SELECT DISTINCT remark FROM geo_rumah_sakit"""
)
tipepoint
=
point
.
fetchall
()
if
tipe_point
==
'saranaibadah'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""SELECT DISTINCT remark FROM geo_sarana_ibadah"""
)
tipepoint
=
point
.
fetchall
()
if
tipe_point
==
'saranapendidikan'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""SELECT DISTINCT remark FROM geo_sarana_pendidikan"""
)
tipepoint
=
point
.
fetchall
()
if
tipe_point
==
'cagarbudaya'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""SELECT DISTINCT remark FROM geo_cagar_budaya"""
)
tipepoint
=
point
.
fetchall
()
if
tipe_point
==
'spbu'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""SELECT DISTINCT remark FROM geo_spbu"""
)
tipepoint
=
point
.
fetchall
()
if
tipe_point
==
'stasiun'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""SELECT DISTINCT remark FROM geo_stasiun"""
)
tipepoint
=
point
.
fetchall
()
if
tipe_point
==
'terminalbus'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""SELECT DISTINCT remark FROM geo_terminal_bus"""
)
tipepoint
=
point
.
fetchall
()
if
tipe_point
==
'gardulistrik'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""SELECT DISTINCT remark FROM geo_gardu_listrik"""
)
tipepoint
=
point
.
fetchall
()
print
(
tipepoint
)
respon
=
{
'result'
:
tipepoint
}
return
Response
(
respon
)
@
api_view
((
'POST'
,))
@
api_view
((
'POST'
,))
def
createpoint
(
request
):
def
createpoint
(
request
):
...
@@ -1639,39 +1770,58 @@ def createpoint(request):
...
@@ -1639,39 +1770,58 @@ def createpoint(request):
try
:
try
:
if
tipe_point
==
'administrasi'
:
if
tipe_point
==
'administrasi'
:
with
conn
.
cursor
()
as
point
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""INSERT INTO geo_kantor_administrasi(geom, namobj, remark, luas_
bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s,
%
s,
%
s, '
%
s', '
%
s', 5,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_bangunan_point
,
luas_tanah_point
,
tinggi_bangunan
_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
point
.
execute
(
"""INSERT INTO geo_kantor_administrasi(geom, namobj, remark, luas_
tanah, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s, '
%
s', '
%
s', 5,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_tanah
_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
conn
.
commit
()
conn
.
commit
()
if
tipe_point
==
'layanankesehatan'
:
if
tipe_point
==
'layanankesehatan'
:
with
conn
.
cursor
()
as
point
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""INSERT INTO geo_layanan_kesehatan(geom, namobj, remark, luas_
bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s,
%
s,
%
s, '
%
s', '
%
s', 6,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_bangunan_point
,
luas_tanah_point
,
tinggi_bangunan
_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
point
.
execute
(
"""INSERT INTO geo_layanan_kesehatan(geom, namobj, remark, luas_
tanah, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s, '
%
s', '
%
s', 6,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_tanah
_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
conn
.
commit
()
conn
.
commit
()
if
tipe_point
==
'puskesmas'
:
if
tipe_point
==
'puskesmas'
:
with
conn
.
cursor
()
as
point
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""INSERT INTO geo_puskesmas(geom, namobj, remark, luas_
bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s,
%
s,
%
s, '
%
s', '
%
s', 7,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_bangunan_point
,
luas_tanah_point
,
tinggi_bangunan
_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
point
.
execute
(
"""INSERT INTO geo_puskesmas(geom, namobj, remark, luas_
tanah, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s, '
%
s', '
%
s', 7,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_tanah
_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
conn
.
commit
()
conn
.
commit
()
if
tipe_point
==
'rumahsakit'
:
if
tipe_point
==
'rumahsakit'
:
with
conn
.
cursor
()
as
point
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""INSERT INTO geo_rumah_sakit(geom, namobj, remark, luas_
bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s,
%
s,
%
s, '
%
s', '
%
s', 8,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_bangunan_point
,
luas_tanah_point
,
tinggi_bangunan
_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
point
.
execute
(
"""INSERT INTO geo_rumah_sakit(geom, namobj, remark, luas_
tanah, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s, '
%
s', '
%
s', 8,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_tanah
_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
conn
.
commit
()
conn
.
commit
()
if
tipe_point
==
'saranaibadah'
:
if
tipe_point
==
'saranaibadah'
:
with
conn
.
cursor
()
as
point
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""INSERT INTO geo_sarana_ibadah(geom, namobj, remark, luas_
bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s,
%
s,
%
s, '
%
s', '
%
s', 9,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_bangunan_point
,
luas_tanah_point
,
tinggi_bangunan
_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
point
.
execute
(
"""INSERT INTO geo_sarana_ibadah(geom, namobj, remark, luas_
tanah, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s, '
%
s', '
%
s', 9,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_tanah
_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
conn
.
commit
()
conn
.
commit
()
if
tipe_point
==
'saranapendidikan'
:
if
tipe_point
==
'saranapendidikan'
:
with
conn
.
cursor
()
as
point
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""INSERT INTO geo_sarana_pendidikan(geom, namobj, remark, luas_
bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s,
%
s,
%
s, '
%
s', '
%
s', 10,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_bangunan_point
,
luas_tanah_point
,
tinggi_bangunan
_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
point
.
execute
(
"""INSERT INTO geo_sarana_pendidikan(geom, namobj, remark, luas_
tanah, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s, '
%
s', '
%
s', 10,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_tanah
_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
conn
.
commit
()
conn
.
commit
()
if
tipe_point
==
'cagarbudaya'
:
if
tipe_point
==
'cagarbudaya'
:
with
conn
.
cursor
()
as
point
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""INSERT INTO geo_cagar_budaya(geom, namobj, remark, luas_bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s,
%
s,
%
s, '
%
s', '
%
s', 3,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_bangunan_point
,
luas_tanah_point
,
tinggi_bangunan_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
point
.
execute
(
"""INSERT INTO geo_cagar_budaya(geom, namobj, remark, luas_tanah, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s, '
%
s', '
%
s', 3,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_tanah_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
conn
.
commit
()
if
tipe_point
==
'spbu'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""INSERT INTO geo_spbu(geom, namobj, remark, luas_tanah, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s, '
%
s', '
%
s', 3,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_tanah_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
conn
.
commit
()
conn
.
commit
()
if
tipe_point
==
'stasiun'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""INSERT INTO geo_stasiun(geom, namobj, remark, luas_tanah, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s, '
%
s', '
%
s', 3,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_tanah_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
conn
.
commit
()
if
tipe_point
==
'terminalbus'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""INSERT INTO geo_terminal_bus(geom, namobj, remark, luas_tanah, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s, '
%
s', '
%
s', 3,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_tanah_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
conn
.
commit
()
if
tipe_point
==
'gardulistrik'
:
with
conn
.
cursor
()
as
point
:
point
.
execute
(
"""INSERT INTO geo_gardu_listrik(geom, namobj, remark, luas_tanah, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":
%
s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '
%
s','
%
s',
%
s, '
%
s', '
%
s', 3,'
%
s')"""
%
(
coordinat
,
name_create_point
,
info_create_point
,
luas_tanah_point
,
alamat_create_point
,
pemilik_point
,
ngambar
))
conn
.
commit
()
data
=
'SUCCESS'
data
=
'SUCCESS'
info
=
'data telah diperbaharui'
info
=
'data telah diperbaharui'
...
...
Application/urls.py
View file @
1dc705f3
...
@@ -13,6 +13,7 @@ urlpatterns = [
...
@@ -13,6 +13,7 @@ urlpatterns = [
path
(
'perbaikan'
,
views
.
perbaikanrenovasi
,
name
=
'perbaikan'
),
path
(
'perbaikan'
,
views
.
perbaikanrenovasi
,
name
=
'perbaikan'
),
path
(
'loadDetail'
,
views
.
loadDetail
,
name
=
'loadDetail'
),
path
(
'loadDetail'
,
views
.
loadDetail
,
name
=
'loadDetail'
),
path
(
'input-perbaikan'
,
views
.
inpuperbaikan
,
name
=
'input-perbaikan'
),
path
(
'input-perbaikan'
,
views
.
inpuperbaikan
,
name
=
'input-perbaikan'
),
path
(
'input-perbaikan-bang'
,
views
.
inputperbaikanbangunan
,
name
=
'input-perbaikan-bang'
),
path
(
'save-perbaikan'
,
views
.
saveperbaikan
,
name
=
'save-perbaikan'
),
path
(
'save-perbaikan'
,
views
.
saveperbaikan
,
name
=
'save-perbaikan'
),
path
(
'load-jl-by-id-detail'
,
views
.
loadbyiddetail
,
name
=
'load-jl-by-id-detail'
),
path
(
'load-jl-by-id-detail'
,
views
.
loadbyiddetail
,
name
=
'load-jl-by-id-detail'
),
...
...
Application/views.py
View file @
1dc705f3
...
@@ -75,7 +75,8 @@ class Dashboard(generic.TemplateView):
...
@@ -75,7 +75,8 @@ class Dashboard(generic.TemplateView):
geo_kantor_administrasi A
geo_kantor_administrasi A
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
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_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)"""
)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE a.is_deleted = 0"""
)
kantor_administrasi_res
=
kantor_administrasi
.
fetchall
()
kantor_administrasi_res
=
kantor_administrasi
.
fetchall
()
kantor_administrasi_result
=
[]
kantor_administrasi_result
=
[]
...
@@ -466,7 +467,6 @@ class Dashboard(generic.TemplateView):
...
@@ -466,7 +467,6 @@ class Dashboard(generic.TemplateView):
context
=
{
context
=
{
'title'
:
'Dashboard'
,
'title'
:
'Dashboard'
,
'kelurahan'
:
kel_res
,
'kelurahan'
:
kel_res
,
...
@@ -641,6 +641,26 @@ def inpuperbaikan(request):
...
@@ -641,6 +641,26 @@ def inpuperbaikan(request):
respon
=
res_data
[
0
]
respon
=
res_data
[
0
]
return
Response
(
respon
)
return
Response
(
respon
)
@
api_view
((
'GET'
,))
def
inputperbaikanbangunan
(
request
):
id
=
request
.
GET
.
get
(
'id_bangunan'
)
with
conn
.
cursor
()
as
data_per
:
data_per
.
execute
(
"""
SELECT
name,
type,
json_build_object ( 'type', 'Feature', 'geometry', ST_AsGeoJSON ( geom :: geometry ) :: json ),
ID
FROM
geo_bangunan
WHERE
ID =
%
s
"""
%
id
)
res_data
=
data_per
.
fetchall
()
respon
=
res_data
[
0
]
return
Response
(
respon
)
from
django.core.files.storage
import
FileSystemStorage
from
django.core.files.storage
import
FileSystemStorage
import
random
import
random
import
re
import
re
...
@@ -770,7 +790,7 @@ def saveperbaikan(request):
...
@@ -770,7 +790,7 @@ def saveperbaikan(request):
jenis_perbaikan
,
jenis_perbaikan
,
coordinat
))
coordinat
))
conn
.
commit
()
conn
.
commit
()
data
=
"
Alhamdulilah
"
data
=
"
Sukses
"
info
=
"Data Telah Berhasil di Perbaharui"
info
=
"Data Telah Berhasil di Perbaharui"
code
=
0
code
=
0
...
...
OKU/settings.py
View file @
1dc705f3
...
@@ -87,8 +87,8 @@ DATABASES = {
...
@@ -87,8 +87,8 @@ DATABASES = {
'PASSWORD'
:
'khansia215758'
,
'PASSWORD'
:
'khansia215758'
,
'HOST'
:
'30.10.20.102'
,
'HOST'
:
'30.10.20.102'
,
'PORT'
:
'5432'
,
'PORT'
:
'5432'
,
#
'HOST': '103.126.28.66',
#'HOST': '103.126.28.66',
#
'PORT': '8082',
#'PORT': '8082',
}
}
}
}
...
...
templates/includes/content.html
View file @
1dc705f3
...
@@ -121,6 +121,128 @@
...
@@ -121,6 +121,128 @@
</div>
</div>
<div
class=
"content-wrapper mymodal"
id=
"input_perbaikan_bang"
style=
"display: none;padding: 60px;"
>
<div
class=
"content"
style=
"padding: 15px;max-height: 550px;"
>
<!-- Main charts -->
<div
class=
"panel panel-flat"
style=
"display: none;"
>
<div
class=
"panel-body"
style=
"padding-top: 10px;"
>
<div
class=
"tabbable"
>
<ul
class=
"nav nav-tabs nav-tabs-bottom nav-justified"
>
<button
type=
"button"
class=
"close"
onclick=
"destroyWraper()"
>
×
</button>
<li
class=
"active"
><a
href=
"#left-tab-input-coordinat"
data-toggle=
"tab"
>
Koordinat
</a></li>
<li><a
href=
"#right-tab-input-informasi"
data-toggle=
"tab"
>
Insert Informasi
</a></li>
</ul>
</div>
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"left-tab-input-coordinat"
>
<div
class=
"modal-body"
style=
"max-height: 450px;overflow-y: auto;"
>
<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-bang"
style=
"height: 375px;width: 100%"
>
</div>
</div>
</div>
<div
class=
"tab-pane"
id=
"right-tab-input-informasi"
>
<div
class=
"modal-body"
style=
"max-height: 415px;overflow-y: auto;"
>
<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>
Type :
</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>
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>
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>
Penanggung Jawab Lapangan :
</label>
<input
type=
"text"
id=
"pjlapangan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Kontraktor :
</label>
<input
type=
"text"
id=
"kontraktor_bang"
class=
"form-control"
value=
""
>
</div>
<!-- <div class="form-group">
<label>Panjang Jalan Keseluruhan :</label>
<input type="text" id="panjangjalanall" class="form-control" value="">
</div>
<div class="form-group">
<label>Panjang Jalan Perbaikan :</label>
<input type="text" id="panjangjalanperbaikan" class="form-control" value="">
</div>
<div class="form-group">
<label>Lebar Jalan Perbaikan :</label>
<input type="text" id="lebarjalanperbaikan" 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>
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>
</div>
<div
class=
"panel-footer"
>
<button
type=
"button"
class=
"btn btn-info"
id=
"save-perbaikan_bang"
style=
"float: right; margin-right: 40px;"
>
SAVE
</button>
<button
type=
"button"
class=
"btn btn-link"
onclick=
"destroyWraper()"
style=
"float: right;"
>
Close
</button>
</div>
</div>
</div>
<!-- /main charts -->
</div>
<!-- editing kelurahan -->
<!-- editing kelurahan -->
<div
class=
"content-wrapper mymodal"
id=
"edit_kelurahan"
style=
"display: none;padding: 60px;"
>
<div
class=
"content-wrapper mymodal"
id=
"edit_kelurahan"
style=
"display: none;padding: 60px;"
>
<div
class=
"content"
style=
"padding: 15px;max-height: 550px;"
>
<div
class=
"content"
style=
"padding: 15px;max-height: 550px;"
>
...
...
templates/includes/css-o.html
View file @
1dc705f3
...
@@ -143,6 +143,9 @@
...
@@ -143,6 +143,9 @@
#btn_edit_bangunan
{
#btn_edit_bangunan
{
display
:
none
;
display
:
none
;
}
}
#btn_delete_bangunan
{
display
:
none
;
}
#btn_edit_kelurahan
{
#btn_edit_kelurahan
{
display
:
block
;
display
:
block
;
...
@@ -188,6 +191,9 @@
...
@@ -188,6 +191,9 @@
#btn_edit_adm
{
#btn_edit_adm
{
display
:
none
;
display
:
none
;
}
}
#btn_delete_adm
{
display
:
none
;
}
#btn_edit_rs
{
#btn_edit_rs
{
display
:
none
;
display
:
none
;
...
...
templates/includes/insert.html
View file @
1dc705f3
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
map_create_bangunan
.
on
(
L
.
Draw
.
Event
.
CREATED
,
function
(
e
)
{
map_create_bangunan
.
on
(
L
.
Draw
.
Event
.
CREATED
,
function
(
e
)
{
var
layer
=
e
.
layer
;
var
layer
=
e
.
layer
;
$
(
"
#poly_create
"
).
empty
();
$
(
"
#poly_create
_bangunan
"
).
empty
();
var
type
=
e
.
layerType
;
var
type
=
e
.
layerType
;
var
layer
=
e
.
layer
;
var
layer
=
e
.
layer
;
...
@@ -262,7 +262,7 @@
...
@@ -262,7 +262,7 @@
}
}
}
}
window
.
thisBaseDrawPolygonLayer
=
layer
;
window
.
thisBaseDrawPolygonLayer
=
layer
;
$
(
"
#poly_create
"
).
val
(
JSON
.
stringify
(
kordinat
));
$
(
"
#poly_create
_bangunan
"
).
val
(
JSON
.
stringify
(
kordinat
));
});
});
polygon_options
=
{
polygon_options
=
{
...
@@ -427,6 +427,7 @@
...
@@ -427,6 +427,7 @@
});
});
$
(
document
).
on
(
"
click
"
,
"
#create_save_jalan
"
,
function
(
e
)
{
$
(
document
).
on
(
"
click
"
,
"
#create_save_jalan
"
,
function
(
e
)
{
data
=
new
FormData
()
data
=
new
FormData
()
data
.
append
(
"
gambar
"
,
$
(
"
input[id^='img_jalan']
"
)[
0
].
files
[
0
]);
data
.
append
(
"
gambar
"
,
$
(
"
input[id^='img_jalan']
"
)[
0
].
files
[
0
]);
...
@@ -470,7 +471,7 @@
...
@@ -470,7 +471,7 @@
$
(
document
).
on
(
"
click
"
,
"
#create_save_bangunan
"
,
function
(
e
)
{
$
(
document
).
on
(
"
click
"
,
"
#create_save_bangunan
"
,
function
(
e
)
{
var
polygin
=
$
(
'
#poly_create
'
).
val
();
var
polygin
=
$
(
'
#poly_create
_bangunan
'
).
val
();
var
name_poly
=
$
(
'
#name_create
'
).
val
();
var
name_poly
=
$
(
'
#name_create
'
).
val
();
var
info_poly
=
$
(
'
#info_create
'
).
val
();
var
info_poly
=
$
(
'
#info_create
'
).
val
();
var
alamat_poly
=
$
(
'
#alamat_create
'
).
val
();
var
alamat_poly
=
$
(
'
#alamat_create
'
).
val
();
...
...
templates/includes/js-m.html
View file @
1dc705f3
{% for group in user.groups.all %} {% if group.name == 'Superadmin' %}
{% for group in user.groups.all %} {% if group.name == 'Superadmin' %}
<style>
<style>
.leaflet-popup
{
.leaflet-popup
{
display
:
block
;
display
:
block
;
}
}
#btn_edit_kelurahan
{
#btn_edit_kelurahan
{
display
:
block
;
display
:
block
;
}
}
...
@@ -47,7 +46,6 @@
...
@@ -47,7 +46,6 @@
#btn_edit_adm
{
#btn_edit_adm
{
display
:
block
;
display
:
block
;
}
}
#btn_delete_adm
{
#btn_delete_adm
{
display
:
block
;
display
:
block
;
}
}
...
@@ -72,7 +70,7 @@
...
@@ -72,7 +70,7 @@
display
:
block
;
display
:
block
;
}
}
.leaflet-popup
{
.leaflet-popup
{
display
:
block
;
display
:
block
;
}
}
</style>
</style>
...
@@ -81,7 +79,7 @@
...
@@ -81,7 +79,7 @@
<script>
<script>
var
kantor_administrasi
=
"
{{ kantor_administrasi }}
"
.
replace
(
/'/g
,
'
"
'
);
var
kantor_administrasi
=
"
{{ kantor_administrasi }}
"
.
replace
(
/'/g
,
'
"
'
);
var
result_kan_adm
=
JSON
.
parse
(
""
+
kantor_administrasi
+
""
)
var
result_kan_adm
=
JSON
.
parse
(
""
+
kantor_administrasi
+
""
)
// console.log(result_kan_adm[1]['administrasi']['f2']
)
console
.
log
(
result_kan_adm
)
geo_po_adm
=
L
.
geoJson
(
null
,
{
geo_po_adm
=
L
.
geoJson
(
null
,
{
pointToLayer
:
function
(
feature
,
latlng
)
{
pointToLayer
:
function
(
feature
,
latlng
)
{
...
@@ -278,6 +276,26 @@
...
@@ -278,6 +276,26 @@
});
});
return
marker
return
marker
}
}
else
if
(
feature
.
administrasi
.
f2
==
'
none
'
)
{
var
smallIcon
=
new
L
.
Icon
({
iconSize
:
[
20
,
20
],
iconAnchor
:
[
13
,
27
],
popupAnchor
:
[
1
,
-
24
],
iconUrl
:
'
static/img/icon/lurah.svg
'
,
shadowUrl
:
'
static/img/icon/shadow.svg
'
,
shadowSize
:
[
38
,
38
],
shadowAnchor
:
[
23
,
32
]
});
var
marker
=
L
.
marker
(
latlng
,
{
icon
:
smallIcon
});
marker
.
bindTooltip
(
feature
.
administrasi
.
f1
,
{
permanent
:
false
,
className
:
"
my-label
"
,
offset
:
[
0
,
0
]
});
return
marker
}
},
},
onEachFeature
:
function
(
feature
,
layer
)
{
onEachFeature
:
function
(
feature
,
layer
)
{
layer
.
on
({
layer
.
on
({
...
@@ -287,6 +305,7 @@
...
@@ -287,6 +305,7 @@
var
geocoderNominatim
=
new
L
.
Control
.
Geocoder
.
Nominatim
();
var
geocoderNominatim
=
new
L
.
Control
.
Geocoder
.
Nominatim
();
var
geogeo
=
geocodeService
.
reverse
().
latlng
(
e
.
latlng
).
run
(
function
(
error
,
result
)
{
var
geogeo
=
geocodeService
.
reverse
().
latlng
(
e
.
latlng
).
run
(
function
(
error
,
result
)
{
tay
=
result
.
address
.
Address
;
tay
=
result
.
address
.
Address
;
console
.
log
(
feature
.
administrasi
.
f8
)
// aladije(result.address.Address)
// aladije(result.address.Address)
if
(
feature
.
administrasi
.
f3
==
'
alamat
'
)
{
if
(
feature
.
administrasi
.
f3
==
'
alamat
'
)
{
if
(
tay
!=
''
)
{
if
(
tay
!=
''
)
{
...
@@ -306,12 +325,18 @@
...
@@ -306,12 +325,18 @@
var
raja
=
feature
.
administrasi
.
f10
;
var
raja
=
feature
.
administrasi
.
f10
;
}
}
if
(
feature
.
administrasi
.
f8
==
'
None
'
)
{
var
gmb
=
"
lurah.svg
"
;
}
else
{
var
gmb
=
feature
.
administrasi
.
f8
;
}
content
=
`
content
=
`
<table class="table table-hover tasks-list">
<table class="table table-hover tasks-list">
<thead style="text-align: center;">
<thead style="text-align: center;">
<tr>
<tr>
<th style="padding: 0 0 0 0px;">
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`
+
feature
.
administrasi
.
f8
+
`" alt="Image" style="width: 100%;max-height: 237px;height:237; margin-top: 40px;">
<img src="static/img/image/`
+
gmb
+
`" alt="Image" style="width: 100%;max-height: 237px;height:237; margin-top: 40px;">
</th>
</th>
</tr>
</tr>
</thead>
</thead>
...
@@ -383,7 +408,7 @@
...
@@ -383,7 +408,7 @@
</div>
</div>
</tbody>
</tbody>
</table>`
;
</table>`
;
content_delete
=
`
content_delete_adm
=
`
<div class="modal-dialog md">
<div class="modal-dialog md">
<div class="modal-content">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color: #40777c !important;">
<div class="modal-header bg-info" style="background-color: #40777c !important;">
...
@@ -422,7 +447,7 @@
...
@@ -422,7 +447,7 @@
</div>
</div>
</div>
</div>
</div>`
;
</div>`
;
content_edit
=
`
content_edit_adm
=
`
<div class="modal-dialog md">
<div class="modal-dialog md">
<div class="modal-content">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color: #40777c !important;">
<div class="modal-header bg-info" style="background-color: #40777c !important;">
...
@@ -435,13 +460,13 @@
...
@@ -435,13 +460,13 @@
<div class="tabbable">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<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)" class="active"><a href="#left-tab1-feas-upl
i
" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)" ><a href="#right-tab2-feas-upl" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)" ><a href="#right-tab2-feas-upl
i
" data-toggle="tab">Informasi Umum</a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane active" id="left-tab1-feas-upl">
<div class="tab-pane active" id="left-tab1-feas-upl
i
">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div class="form-group">
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
...
@@ -452,7 +477,7 @@
...
@@ -452,7 +477,7 @@
</div>
</div>
</div>
</div>
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="tab-pane" id="right-tab2-feas-upl
i
">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
...
@@ -534,8 +559,8 @@
...
@@ -534,8 +559,8 @@
</div>
</div>
</div>`
;
</div>`
;
$
(
"
#isi_panel
"
).
html
(
content
)
$
(
"
#isi_panel
"
).
html
(
content
)
$
(
"
#modald_adm
"
).
html
(
content_delete
)
$
(
"
#modald_adm
"
).
html
(
content_delete_adm
)
$
(
"
#modal_adm
"
).
html
(
content_edit
)
$
(
"
#modal_adm
"
).
html
(
content_edit_adm
)
})
})
hidelegend
();
hidelegend
();
...
@@ -630,7 +655,7 @@
...
@@ -630,7 +655,7 @@
data
.
append
(
'
alamat
'
,
$
(
'
#alamat_adm_edit
'
).
val
())
data
.
append
(
'
alamat
'
,
$
(
'
#alamat_adm_edit
'
).
val
())
data
.
append
(
'
perangkat
'
,
$
(
'
#perangkat_adm_edit
'
).
val
())
data
.
append
(
'
perangkat
'
,
$
(
'
#perangkat_adm_edit
'
).
val
())
data
.
append
(
'
point
'
,
poi
),
data
.
append
(
'
point
'
,
poi
),
data
.
append
(
'
gambar
'
,
$
(
'
#gambar
'
).
val
())
data
.
append
(
'
gambar
'
,
$
(
'
#gambar_adm_edit
'
).
val
())
$
.
ajax
({
$
.
ajax
({
url
:
"
{% url 'api:kantor' %}
"
,
url
:
"
{% url 'api:kantor' %}
"
,
...
@@ -793,12 +818,18 @@
...
@@ -793,12 +818,18 @@
}
else
{
}
else
{
var
raja
=
feature
.
administrasi
.
f10
;
var
raja
=
feature
.
administrasi
.
f10
;
}
}
if
(
feature
.
administrasi
.
f8
==
'
None
'
)
{
var
gmb
=
"
rs.svg
"
;
}
else
{
var
gmb
=
feature
.
administrasi
.
f8
;
}
content_lk
=
`
content_lk
=
`
<table class="table table-hover tasks-list">
<table class="table table-hover tasks-list">
<thead style="text-align: center;">
<thead style="text-align: center;">
<tr>
<tr>
<th style="padding: 0 0 0 0px;">
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`
+
feature
.
administrasi
.
f8
+
`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`
+
gmb
+
`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</th>
</tr>
</tr>
</thead>
</thead>
...
@@ -882,14 +913,14 @@
...
@@ -882,14 +913,14 @@
<div class="tabbable">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<li onclick="changetabs(this)" class="active"><a href="#right-tab2-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)" class="active"><a href="#right-tab2-feas-upl
i
" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#left-tab1-feas-upl" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)"><a href="#left-tab1-feas-upl
i
" data-toggle="tab">Informasi Umum</a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane" id="left-tab1-feas-upl">
<div class="tab-pane" id="left-tab1-feas-upl
i
">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
...
@@ -958,7 +989,7 @@
...
@@ -958,7 +989,7 @@
</div>
</div>
</div>
</div>
<div class="tab-pane active" id="right-tab2-feas-upl">
<div class="tab-pane active" id="right-tab2-feas-upl
i
">
<div class="form-group">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div class="form-group">
<div class="form-group">
...
@@ -1165,12 +1196,19 @@
...
@@ -1165,12 +1196,19 @@
}
else
{
}
else
{
var
raja
=
feature
.
administrasi
.
f10
;
var
raja
=
feature
.
administrasi
.
f10
;
}
}
if
(
feature
.
administrasi
.
f8
==
'
None
'
)
{
var
gmb
=
"
rs.svg
"
;
}
else
{
var
gmb
=
feature
.
administrasi
.
f8
;
}
content_puskes
=
`
content_puskes
=
`
<table class="table table-hover tasks-list">
<table class="table table-hover tasks-list">
<thead style="text-align: center;">
<thead style="text-align: center;">
<tr>
<tr>
<th style="padding: 0 0 0 0px;">
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`
+
feature
.
administrasi
.
f8
+
`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`
+
gmb
+
`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</th>
</tr>
</tr>
</thead>
</thead>
...
@@ -1254,13 +1292,13 @@
...
@@ -1254,13 +1292,13 @@
<div class="tabbable">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<li onclick="changetabs(this)" class="active"><a href="#right-tab2-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)" class="active"><a href="#right-tab2-feas-upl
i
" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#left-tab1-feas-upl" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)"><a href="#left-tab1-feas-upl
i
" data-toggle="tab">Informasi Umum</a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane" id="left-tab1-feas-upl">
<div class="tab-pane" id="left-tab1-feas-upl
i
">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
...
@@ -1329,7 +1367,7 @@
...
@@ -1329,7 +1367,7 @@
</div>
</div>
</div>
</div>
<div class="tab-pane active" id="right-tab2-feas-upl">
<div class="tab-pane active" id="right-tab2-feas-upl
i
">
<div class="form-group">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div class="form-group">
<div class="form-group">
...
@@ -1536,12 +1574,19 @@
...
@@ -1536,12 +1574,19 @@
}
else
{
}
else
{
var
raja
=
feature
.
administrasi
.
f10
;
var
raja
=
feature
.
administrasi
.
f10
;
}
}
if
(
feature
.
administrasi
.
f8
==
'
None
'
)
{
var
gmb
=
"
rs.svg
"
;
}
else
{
var
gmb
=
feature
.
administrasi
.
f8
;
}
content_rs
=
`
content_rs
=
`
<table class="table table-hover tasks-list">
<table class="table table-hover tasks-list">
<thead style="text-align: center;">
<thead style="text-align: center;">
<tr>
<tr>
<th style="padding: 0 0 0 0px;">
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`
+
feature
.
administrasi
.
f8
+
`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`
+
gmb
+
`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</th>
</tr>
</tr>
</thead>
</thead>
...
@@ -1612,7 +1657,7 @@
...
@@ -1612,7 +1657,7 @@
</div>
</div>
</tbody>
</tbody>
</table>`
;
</table>`
;
content_edit_rs
=
`
content_edit_rs
=
`
<div class="modal-dialog md">
<div class="modal-dialog md">
<div class="modal-content">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color: #40777c !important;">
<div class="modal-header bg-info" style="background-color: #40777c !important;">
...
@@ -1625,13 +1670,13 @@
...
@@ -1625,13 +1670,13 @@
<div class="tabbable">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<li onclick="changetabs(this)" class="active"><a href="#right-tab2-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)" class="active"><a href="#right-tab2-feas-upl
i
" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#left-tab1-feas-upl" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)"><a href="#left-tab1-feas-upl
i
" data-toggle="tab">Informasi Umum</a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane" id="left-tab1-feas-upl">
<div class="tab-pane" id="left-tab1-feas-upl
i
">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
...
@@ -1700,7 +1745,7 @@
...
@@ -1700,7 +1745,7 @@
</div>
</div>
</div>
</div>
<div class="tab-pane active" id="right-tab2-feas-upl">
<div class="tab-pane active" id="right-tab2-feas-upl
i
">
<div class="form-group">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div class="form-group">
<div class="form-group">
...
@@ -1963,13 +2008,13 @@
...
@@ -1963,13 +2008,13 @@
<div class="tabbable">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<li onclick="changetabs(this)" class="active"><a href="#right-tab2-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)" class="active"><a href="#right-tab2-feas-upl
i
" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#left-tab1-feas-upl" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)"><a href="#left-tab1-feas-upl
i
" data-toggle="tab">Informasi Umum</a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane" id="left-tab1-feas-upl">
<div class="tab-pane" id="left-tab1-feas-upl
i
">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
...
@@ -2038,7 +2083,7 @@
...
@@ -2038,7 +2083,7 @@
</div>
</div>
</div>
</div>
<div class="tab-pane active" id="right-tab2-feas-upl">
<div class="tab-pane active" id="right-tab2-feas-upl
i
">
<div class="form-group">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div class="form-group">
<div class="form-group">
...
@@ -2361,13 +2406,13 @@
...
@@ -2361,13 +2406,13 @@
<div class="tabbable">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<li onclick="changetabs(this)" class="active"><a href="#right-tab2-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)" class="active"><a href="#right-tab2-feas-upl
i
" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#left-tab1-feas-upl" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)"><a href="#left-tab1-feas-upl
i
" data-toggle="tab">Informasi Umum</a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane" id="left-tab1-feas-upl">
<div class="tab-pane" id="left-tab1-feas-upl
i
">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
...
@@ -2436,7 +2481,7 @@
...
@@ -2436,7 +2481,7 @@
</div>
</div>
</div>
</div>
<div class="tab-pane active" id="right-tab2-feas-upl">
<div class="tab-pane active" id="right-tab2-feas-upl
i
">
<div class="form-group">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div class="form-group">
<div class="form-group">
...
@@ -2733,13 +2778,13 @@
...
@@ -2733,13 +2778,13 @@
<div class="tabbable">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<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">Informasi Umum</a></li>
<li onclick="changetabs(this)" class="active"><a href="#left-tab1-feas-upl
i
" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl
i
" data-toggle="tab">Koordinat</a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane active" id="left-tab1-feas-upl">
<div class="tab-pane active" id="left-tab1-feas-upl
i
">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
...
@@ -2835,7 +2880,7 @@
...
@@ -2835,7 +2880,7 @@
</div>
</div>
</div>
</div>
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="tab-pane" id="right-tab2-feas-upl
i
">
<div class="form-group">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div class="form-group">
<div class="form-group">
...
@@ -3097,13 +3142,13 @@
...
@@ -3097,13 +3142,13 @@
<div class="tabbable">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<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">Informasi Umum</a></li>
<li onclick="changetabs(this)" class="active"><a href="#left-tab1-feas-upl
i
" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl
i
" data-toggle="tab">Koordinat</a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane active" id="left-tab1-feas-upl">
<div class="tab-pane active" id="left-tab1-feas-upl
i
">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
...
@@ -3199,7 +3244,7 @@
...
@@ -3199,7 +3244,7 @@
</div>
</div>
</div>
</div>
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="tab-pane" id="right-tab2-feas-upl
i
">
<div class="form-group">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div class="form-group">
<div class="form-group">
...
@@ -3460,13 +3505,13 @@
...
@@ -3460,13 +3505,13 @@
<div class="tabbable">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<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">Informasi Umum</a></li>
<li onclick="changetabs(this)" class="active"><a href="#left-tab1-feas-upl
i
" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl
i
" data-toggle="tab">Koordinat</a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane active" id="left-tab1-feas-upl">
<div class="tab-pane active" id="left-tab1-feas-upl
i
">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
...
@@ -3525,7 +3570,7 @@
...
@@ -3525,7 +3570,7 @@
</div>
</div>
</div>
</div>
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="tab-pane" id="right-tab2-feas-upl
i
">
<div class="form-group">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div class="form-group">
<div class="form-group">
...
@@ -3766,13 +3811,13 @@
...
@@ -3766,13 +3811,13 @@
<div class="tabbable">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<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">Informasi Umum</a></li>
<li onclick="changetabs(this)" class="active"><a href="#left-tab1-feas-upl
i
" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl
i
" data-toggle="tab">Koordinat</a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane active" id="left-tab1-feas-upl">
<div class="tab-pane active" id="left-tab1-feas-upl
i
">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
...
@@ -3831,7 +3876,7 @@
...
@@ -3831,7 +3876,7 @@
</div>
</div>
</div>
</div>
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="tab-pane" id="right-tab2-feas-upl
i
">
<div class="form-group">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div class="form-group">
<div class="form-group">
...
@@ -4084,13 +4129,13 @@
...
@@ -4084,13 +4129,13 @@
<div class="tabbable">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<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">Informasi Umum</a></li>
<li onclick="changetabs(this)" class="active"><a href="#left-tab1-feas-upl
i
" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl
i
" data-toggle="tab">Koordinat</a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane active" id="left-tab1-feas-upl">
<div class="tab-pane active" id="left-tab1-feas-upl
i
">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
<div class="modal-body" style="min-height: 450px;overflow-y: auto;">
...
@@ -4186,7 +4231,7 @@
...
@@ -4186,7 +4231,7 @@
</div>
</div>
</div>
</div>
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="tab-pane" id="right-tab2-feas-upl
i
">
<div class="form-group">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div class="form-group">
<div class="form-group">
...
@@ -4523,13 +4568,13 @@
...
@@ -4523,13 +4568,13 @@
var
hrf
=
$
(
params
).
find
(
"
a
"
).
attr
(
"
href
"
);
var
hrf
=
$
(
params
).
find
(
"
a
"
).
attr
(
"
href
"
);
if
(
hrf
==
'
#right-tab2-feas-upl
'
)
{
if
(
hrf
==
'
#right-tab2-feas-upl
i
'
)
{
$
(
"
#left-tab1-feas-upl
"
).
removeClass
(
"
show
"
)
$
(
"
#left-tab1-feas-upl
i
"
).
removeClass
(
"
show
"
)
// $("#right-tab2-feas-upl").attr("display", "block")
// $("#right-tab2-feas-upl
i
").attr("display", "block")
}
else
{
}
else
{
$
(
"
#right-tab2-feas-upl
"
).
removeClass
(
"
show
"
)
$
(
"
#right-tab2-feas-upl
i
"
).
removeClass
(
"
show
"
)
// $("#left-tab1-feas-upl").attr("display", "block")
// $("#left-tab1-feas-upl
i
").attr("display", "block")
}
}
}
}
...
@@ -4559,7 +4604,7 @@
...
@@ -4559,7 +4604,7 @@
}
}
}
}
//3d begin
//3d begin
function
map3d
()
{
function
map3d
()
{
var
checkBox_3d
=
document
.
getElementById
(
"
3d-maps
"
);
var
checkBox_3d
=
document
.
getElementById
(
"
3d-maps
"
);
if
(
checkBox_3d
.
checked
==
true
)
{
if
(
checkBox_3d
.
checked
==
true
)
{
...
@@ -4568,7 +4613,8 @@
...
@@ -4568,7 +4613,8 @@
Cesium
.
Ion
.
defaultAccessToken
=
'
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhOTc0NDkxMi02N2NkLTQwYjMtOTE1Yi1iMGNkZDU0Zjg3MGMiLCJpZCI6NDQ1ODgsImlhdCI6MTYxNDE0NjM5NH0.sRHzNNa7uV_huqGxERySWlL8J5UVx1VwU-pRwNd0GJk
'
;
Cesium
.
Ion
.
defaultAccessToken
=
'
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhOTc0NDkxMi02N2NkLTQwYjMtOTE1Yi1iMGNkZDU0Zjg3MGMiLCJpZCI6NDQ1ODgsImlhdCI6MTYxNDE0NjM5NH0.sRHzNNa7uV_huqGxERySWlL8J5UVx1VwU-pRwNd0GJk
'
;
var
worldTerrain
=
new
Cesium
.
ArcGISTiledElevationTerrainProvider
({
var
worldTerrain
=
new
Cesium
.
ArcGISTiledElevationTerrainProvider
({
url
:
"
https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer
"
,
url
:
"
https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer
"
,
});
});
var
map_cesium
=
new
Cesium
.
Viewer
(
'
map-cesium
'
);
var
map_cesium
=
new
Cesium
.
Viewer
(
'
map-cesium
'
);
// var map_cesium = new Cesium.Viewer('map-cesium', {
// var map_cesium = new Cesium.Viewer('map-cesium', {
...
@@ -4726,6 +4772,668 @@
...
@@ -4726,6 +4772,668 @@
$
(
"
#map-cesium
"
).
css
(
'
display
'
,
'
none
'
);
$
(
"
#map-cesium
"
).
css
(
'
display
'
,
'
none
'
);
}
}
}
}
//3d end
//3d end
var
geocodeService
=
L
.
esri
.
Geocoding
.
geocodeService
();
var
geocoderNominatim
=
new
L
.
Control
.
Geocoder
.
Nominatim
();
var
geo_bangunan
=
L
.
geoJson
(
null
,
{
style
:
function
(
feature
)
{
return
{
color
:
"
#ff0008
"
,
weight
:
1
,
opacity
:
2
,
zIndex
:
1000
};
},
onEachFeature
:
function
(
feature
,
layer
)
{
if
(
feature
.
properties
)
{
var
lattitud
,
longitud
;
if
(
feature
.
geometry
.
type
==
'
MultiPolygon
'
)
{
lattitud
=
feature
.
geometry
.
coordinates
[
0
][
0
][
0
][
1
];
longitud
=
feature
.
geometry
.
coordinates
[
0
][
0
][
0
][
0
];
}
else
{
lattitud
=
feature
.
geometry
.
coordinates
[
0
][
0
][
1
];
longitud
=
feature
.
geometry
.
coordinates
[
0
][
0
][
0
];
};
layer
.
on
({
click
:
function
(
e
)
{
var
geogeo
=
geocodeService
.
reverse
().
latlng
(
e
.
latlng
).
run
(
function
(
error
,
result
)
{
if
(
result
.
address
.
Address
!=
''
)
{
var
alamat
=
result
.
address
.
Address
+
`, `
}
else
{
var
alamat
=
''
};
if
(
feature
.
administrasi
.
f9
==
'
None
'
)
{
var
path_img
=
"
static/img/image_null.jpg
"
}
else
{
var
path_img
=
`"static/image/bangunan/`
+
feature
.
administrasi
.
f9
+
`"`
}
// var list_history = feature.properties.f7
// 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
>
//
<
a
class
=
"
col-md-3
"
onclick
=
"
getjalanper(` + dt_history[0] + `)
"
><
i
>
View
Ruas
<
/i></
a
>
//
<
a
class
=
"
col-md-3
"
onclick
=
"
getdetailper(` + dt_history[0] + `)
"
data
-
toggle
=
"
modal
"
data
-
target
=
"
#modal_detail
"
><
i
>
View
Detail
<
/i></
a
>
//
<
/div
>
//
<
/div>`
;
// list_history_panel += data_history
// };
// history = `
<
p
class
=
"
text-center
"
>
// History Perbaikan
//
<
/p
>
//
<
br
>
// ` + list_history_panel + `
//
<
p
class
=
"
text-center
"
style
=
"
margin-top: 10px;
"
>
//
<
a
href
=
"
#
"
id
=
'
btn_perbaikan_jalan
'
class
=
"
btn btn-default
"
><
i
>
Tambah
History
Perbaikan
<
/i></
a
>
//
<
/p>`
;
content_edit
=
`
<div class="modal-dialog" style="width: max-content;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">×</button>
<h6 class="modal-title">Edit Polygon Bangunan dan Informasinya</h6>
</div>
<div class="modal-body" style="max-height: 450px;overflow-y: auto;">
<div class="row">
<div class="col-md-5">
<div id="map-edit" style="width:400px;height: 350px;">
</div>
</div>
<div class="col-md-4">
<input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunan" value="`
+
feature
.
geometry
+
`">
<table>
<tr>
<th>
Image
</th>
<td>
<input type="file" id="imgbangunan" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
<input style="display:none;" id="gambar" type="text" class="form-control" value="`
+
feature
.
administrasi
.
f9
+
`"required>
</td>
</tr>
<tr>
<td>
<input type="text" name="idbangunan" id="idbangunan" class="form-control hidden" value="`
+
feature
.
properties
.
f1
+
`" disable>
<input style="display:none;" id="coordinateZoneeditbang" type="text" class="form-control" value=""required>
</td>
</tr>
<tr>
<th>Nama Bangunan</th>
<td>
<input type="text" name="namebangunan" id="namebangunan" class="form-control" value="`
+
feature
.
properties
.
f2
+
`">
</td>
</tr>
<tr>
<th>Informasi Bangunan</th>
<td>
<input type="text" name="infobangunan" id="infobangunan" class="form-control" value="`
+
feature
.
properties
.
f3
+
`">
</td>
</tr>
<tr>
<th>Kelurahan</th>
<td>
<input type=" text " name="nmkelurahan " id="nmkelurahan" class="form-control " value="`
+
feature
.
administrasi
.
f1
+
`">
</td>
</tr>
<tr>
<th>Kecamatan</th>
<td>
<input type="text " name="nmkecamatan " id="nmkecamatan" class="form-control " value="`
+
feature
.
administrasi
.
f2
+
`">
</td>
</tr>
<tr>
<th>Kab/Kota</th>
<td>
<input type="text " name="nmkabkota " id="nmkabkota" class="form-control " value="`
+
feature
.
administrasi
.
f3
+
`">
</td>
</tr>
<tr>
<th>Provinsi</th>
<td>
<input type="text " name="nmprovinsi " id="nmprovinsi" class="form-control " value="`
+
feature
.
administrasi
.
f4
+
`">
</td>
</tr>
</table>
</div>
<div class="col-md-3 ">
<table>
<tr>
<th>Luas Bangunan</th>
<td>
<input type="text " name="luasbangunan " id="luasbangunan" class="form-control " value="`
+
feature
.
administrasi
.
f6
+
`">
</td>
</tr>
<tr>
<th>Luas Tanah</th>
<td>
<input type="text " name="luastanah " id="luastanah" class="form-control " value="`
+
feature
.
administrasi
.
f7
+
`">
</td>
</tr>
<tr>
<th>Tinggi Bangunan</th>
<td>
<input type="text " name="tinggibangunan " id="tinggibangunan" class="form-control " value="`
+
feature
.
administrasi
.
f8
+
`">
</td>
</tr>
<tr>
<th>Pemilik</th>
<td>
<input type="text " name="pemilik " id="pemilik" class="form-control " value="`
+
feature
.
administrasi
.
f10
+
`">
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="modal-footer ">
<button type="button " class="btn btn-link " data-dismiss="modal ">Close</button>
<button type="button " id="btnsavebangunan" class="btn btn-info ">Save changes</button>
</div>
</div>
</div>`
;
content_delete
=
`
<div class="modal-dialog" style="width: max-content;height: max-content;">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color:#40777c;">
<table>
<tr>
<th><h6 class="modal-title">Delete Bangunan dan Informasinya</h6></th>
<td><button type="button" class="close" data-dismiss="modal">×</button></td>
</tr>
</table>
</div>
<div class="form-group" style="margin-bottom:10px;">
<div id="map-delete" style="width: 300px;height: 250px;position: relative;margin-left: 10px;margin-right: 10px;margin-top: 10px;"></div>
<div class="form-group">
<div class="col-lg-12" style="margin-top:10px;margin-bottom:10px;">
<input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunanhps" value="">
<input type="text" name="idbangunan" id="idbangunanhps" class="form-control hidden" value="`
+
feature
.
properties
.
f1
+
`" disable>
<input type="text" name="namebangunan" id="namebangunanhps" class="form-control" value="`
+
feature
.
properties
.
f2
+
`">
<input type="text" name="infobangunan" id="infobangunanhps" class="form-control" value="`
+
feature
.
properties
.
f3
+
`">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" id="btnsavedeletebangunan" class="btn btn-info">Hapus</button>
</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
.
properties
.
f3
+
`
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<span>
`
+
alamat
+
feature
.
administrasi
.
f1
+
`, `
+
feature
.
administrasi
.
f2
+
`, `
+
feature
.
administrasi
.
f3
+
`, `
+
feature
.
administrasi
.
f4
+
`
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<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>
<p class="text-center" style="margin-top: 25px;">
<a href="#" class="btn btn-default" data-toggle="modal" data-target="#modal_bangunan_edit" id="btn_edit_bangunan" data-backdrop="static" data-keyboard="false"><i>Edit Informasi Bangunan</i></a>
<a href="#" id='btn_delete_bangunan' class='btn
btn-default btn_edit_bangunan' data-toggle="modal" data-target="#modal_bangunan_delete" data-backdrop="static" data-keyboard="false"><i>Delete Bangunan</i></a>
</p>
</th>
</tr>
</div>
<div class="container">
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center">
History Perbaikan
</p>
<br>
<p class="text-center" style="margin-top: 10px;">
<a href="#" id='btn_perbaikan_bangunan' class="btn btn-default"><i>Tambah History Perbaikan</i></a>
</p>
</th>
</tr>
</div>
</tbody>
</table>`
;
$
(
"
#isi_panel
"
).
html
(
content
);
$
(
"
#modal_bangunan_edit
"
).
html
(
content_edit
);
$
(
"
#modal_bangunan_delete
"
).
html
(
content_delete
);
});
// $('#idbangunan').val(feature.properties.f1);
// $('#namebangunan').val(feature.properties.f2);
// $('#infobangunan').val(feature.properties.f3);
// $('#nmkelurahan').val(feature.administrasi.f1);
// $('#nmkecamatan').val(feature.administrasi.f2);
// $('#nmkabkota').val(feature.administrasi.f3);
// $('#nmprovinsi').val(feature.administrasi.f4);
// $('#luasbangunan').val(feature.administrasi.f6);
// $('#luastanah').val(feature.administrasi.f7);
// $('#tinggibangunan').val(feature.administrasi.f8);
// $('#pemilik').val(feature.administrasi.f10);
// $('#gambar').val(feature.administrasi.f9);
// $("#coordinatebangunan").val(feature.geometry);
$
(
"
#panel-samping
"
).
css
(
"
display
"
,
"
block
"
);
$
(
"
#button_hide_panel
"
).
css
(
"
display
"
,
"
block
"
);
// $('#idbangunanhps').val(feature.properties.f1);
// $('#namebangunanhps').val(feature.properties.f2);
// $('#infobangunanhps').val(feature.properties.f3);
panel_samp
()
}
});
pool
.
push
({
name
:
feature
.
properties
.
f2
,
id
:
L
.
stamp
(
layer
),
lat
:
lattitud
,
lng
:
longitud
});
}
layer
.
on
({
mouseover
:
function
(
e
)
{
var
layer
=
e
.
target
;
layer
.
setStyle
({
weight
:
1
,
Color
:
"
#067800
"
,
fillColor
:
"
#067800
"
,
});
if
(
!
L
.
Browser
.
ie
&&
!
L
.
Browser
.
opera
)
{
layer
.
bringToFront
();
}
},
mouseout
:
function
(
e
)
{
geo_bangunan
.
resetStyle
(
e
.
target
);
}
});
}
});
function
geo_json_bangunan
(
data
)
{
geo_bangunan
.
addData
(
data
)
}
var
checkBox_building
=
document
.
getElementById
(
"
geo_building
"
);
var
checkBox_2d
=
document
.
getElementById
(
"
2d-maps
"
);
map
.
on
(
"
movestart
"
,
function
()
{
geo_bangunan
.
clearLayers
();
});
map
.
on
(
"
moveend
"
,
function
()
{
var
wetan
=
map
.
getBounds
().
getEast
();
var
kulon
=
map
.
getBounds
().
getWest
();
var
lor
=
map
.
getBounds
().
getNorth
()
var
kidul
=
map
.
getBounds
().
getSouth
();
var
center
=
map
.
getBounds
().
getCenter
();
var
zoom
=
map
.
getZoom
();
if
(
checkBox_building
.
checked
==
true
||
checkBox_2d
.
checked
==
true
)
{
if
(
zoom
>
17
)
{
if
(
map
.
hasLayer
(
geo_bangunan
))
{
geo_bangunan
.
clearLayers
()
geo_bangunan
.
remove
()
}
$
.
ajax
({
url
:
"
{% url 'api:building' %}
"
,
data
:
{
'
wetan
'
:
wetan
,
'
kulon
'
:
kulon
,
'
lor
'
:
lor
,
'
kidul
'
:
kidul
},
dataType
:
'
json
'
,
success
:
function
(
data
)
{
let
list_poly
=
[];
for
(
var
i
=
0
;
i
<
data
[
'
gen
'
].
length
;
i
++
)
{
geoj
=
data
[
'
gen
'
][
i
][
0
];
list_poly
.
push
(
geoj
);
};
geo_json_bangunan
(
list_poly
);
}
});
}
geo_bangunan
.
addTo
(
map
)
}
else
{
geo_bangunan
.
clearLayers
();
geo_bangunan
.
remove
()
}
});
var
map_edit
=
new
L
.
map
(
'
map-edit
'
,
{
editable
:
true
,
zoomControl
:
false
,
drawControl
:
true
}).
setView
([
-
2
,
118
],
5
);
mapss
=
L
.
tileLayer
(
'
https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}
'
,
{
maxZoom
:
22
,
minZoom
:
4
,
}).
addTo
(
map_edit
);
var
polylyly
=
L
.
polygon
([
[
-
4.1283969
,
104.1674575
],
[
-
4.128396
,
104.1674947
],
[
-
4.1284664
,
104.1674964
],
[
-
4.1284674
,
104.1674593
],
[
-
4.1283969
,
104.1674575
]
]).
addTo
(
map_edit
)
$
(
document
).
on
(
"
click
"
,
"
#btn_edit_bangunan
"
,
function
()
{
var
map_edit
=
new
L
.
map
(
'
map-edit
'
,
{
editable
:
true
,
zoomControl
:
false
,
drawControl
:
true
}).
setView
([
-
2
,
118
],
5
);
mapss
=
L
.
tileLayer
(
'
https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}
'
,
{
maxZoom
:
22
,
minZoom
:
4
,
}).
addTo
(
map_edit
);
var
id_poly
=
$
(
'
#idbangunan
'
).
val
();
loaderPage
(
true
);
$
.
ajax
({
url
:
"
{% url 'api:edit' %}
"
,
data
:
{
'
id_poly
'
:
id_poly
},
dataType
:
'
json
'
,
success
:
function
(
data
)
{
setTimeout
(
function
()
{
map_edit
.
invalidateSize
();
},
1000
);
loaderPage
(
false
);
map_edit
.
setView
([
data
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
][
0
][
1
],
data
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
][
0
][
0
]],
19
);
let
lop_poly_edit
=
data
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
];
let
list_poly_edit
=
[];
for
(
var
i
=
0
;
i
<
lop_poly_edit
.
length
;
i
++
)
{
geoj
=
lop_poly_edit
[
i
][
0
];
polygigi
=
[
lop_poly_edit
[
i
][
1
],
lop_poly_edit
[
i
][
0
]]
list_poly_edit
.
push
(
polygigi
);
};
var
polyly
=
L
.
polygon
(
list_poly_edit
).
addTo
(
map_edit
)
polyly
.
enableEdit
();
var
hasil
=
(
JSON
.
stringify
(
polyly
.
toGeoJSON
()))
$
(
'
#btnsavebangunan
'
).
click
(
function
()
{
$
(
"
#coordinatebangunan
"
).
val
(
hasil
);
})
}
})
});
$
(
document
).
on
(
"
click
"
,
"
#btnsavebangunan
"
,
function
()
{
var
data
=
new
FormData
();
data
.
append
(
"
file
"
,
$
(
"
input[id^='imgbangunan']
"
)[
0
].
files
[
0
]);
data
.
append
(
"
csrfmiddlewaretoken
"
,
"
{{ csrf_token }}
"
);
data
.
append
(
'
name_b
'
,
$
(
'
#namebangunan
'
).
val
())
data
.
append
(
'
polygon
'
,
$
(
'
#coordinatebangunan
'
).
val
())
data
.
append
(
'
info_b
'
,
$
(
'
#infobangunan
'
).
val
())
data
.
append
(
'
desa_b
'
,
$
(
'
#nmkelurahan
'
).
val
())
data
.
append
(
'
kec_b
'
,
$
(
'
#nmkecamatan
'
).
val
())
data
.
append
(
'
kab_b
'
,
$
(
'
#nmkabkota
'
).
val
())
data
.
append
(
'
pro_b
'
,
$
(
'
#nmprovinsi
'
).
val
())
data
.
append
(
'
id_poly
'
,
$
(
'
#idbangunan
'
).
val
())
data
.
append
(
'
gambar
'
,
$
(
'
#gambar
'
).
val
())
data
.
append
(
'
luasbangunan_b
'
,
$
(
'
#luasbangunan
'
).
val
())
data
.
append
(
'
luastanah_b
'
,
$
(
'
#luastanah
'
).
val
())
data
.
append
(
'
tinggibangunan_b
'
,
$
(
'
#tinggibangunan
'
).
val
())
data
.
append
(
'
pemilik_b
'
,
$
(
'
#pemilik
'
).
val
())
$
.
ajax
({
url
:
"
{% url 'api:validatedit' %}
"
,
data
:
data
,
dataType
:
'
json
'
,
type
:
'
POST
'
,
processData
:
false
,
contentType
:
false
,
success
:
function
(
data
)
{
let
response
=
data
if
(
response
.
code
==
0
)
{
swal
({
title
:
response
.
info
,
text
:
response
.
data
,
type
:
"
success
"
,
icon
:
"
success
"
,
confirmButtonColor
:
"
#00BCD4
"
},
function
()
{
$
(
"
#modal_bangunan_edit
"
).
css
(
'
display
'
,
'
none
'
);
})
}
else
{
swal
({
title
:
response
.
info
,
text
:
response
.
data
,
type
:
"
warning
"
,
icon
:
"
error
"
,
confirmButtonColor
:
"
#00BCD4
"
})
}
}
})
});
$
(
document
).
on
(
"
click
"
,
"
#btn_delete_bangunan
"
,
function
()
{
var
map_delete
=
new
L
.
map
(
'
map-delete
'
,
{
editable
:
true
,
zoomControl
:
false
,
drawControl
:
true
}).
setView
([
-
2
,
118
],
5
);
mapss
=
L
.
tileLayer
(
'
https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}
'
,
{
maxZoom
:
22
,
minZoom
:
4
,
}).
addTo
(
map_delete
);
var
id_polyhps
=
$
(
'
#idbangunanhps
'
).
val
();
// console.log(id_polyhps)
loaderPage
(
true
);
$
.
ajax
({
url
:
"
{% url 'api:edit' %}
"
,
data
:
{
'
id_poly
'
:
id_polyhps
},
dataType
:
'
json
'
,
success
:
function
(
data
)
{
setTimeout
(
function
()
{
map_delete
.
invalidateSize
();
},
1000
);
loaderPage
(
false
);
map_delete
.
setView
([
data
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
][
0
][
1
],
data
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
][
0
][
0
]],
19
);
let
lop_poly_edit
=
data
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
];
let
list_poly_edit
=
[];
for
(
var
i
=
0
;
i
<
lop_poly_edit
.
length
;
i
++
)
{
geoj
=
lop_poly_edit
[
i
][
0
];
polygigi
=
[
lop_poly_edit
[
i
][
1
],
lop_poly_edit
[
i
][
0
]]
list_poly_edit
.
push
(
polygigi
);
};
var
polyly
=
L
.
polygon
(
list_poly_edit
).
addTo
(
map_delete
)
$
(
'
#btnsavedeletebangunan
'
).
click
(
function
()
{
var
hasil
=
(
JSON
.
stringify
(
polyly
.
toGeoJSON
()))
$
(
"
#coordinatebangunan
"
).
val
(
hasil
);
})
}
})
});
$
(
document
).
on
(
"
click
"
,
"
#btnsavedeletebangunan
"
,
function
()
{
var
data
=
new
FormData
();
data
.
append
(
'
id_poly
'
,
$
(
'
#idbangunan
'
).
val
())
$
.
ajax
({
url
:
"
{% url 'api:hapus' %}
"
,
data
:
data
,
dataType
:
'
json
'
,
type
:
'
POST
'
,
processData
:
false
,
contentType
:
false
,
success
:
function
(
data
)
{
let
response
=
data
if
(
response
.
code
==
0
)
{
swal
({
title
:
response
.
info
,
text
:
response
.
data
,
type
:
"
success
"
,
icon
:
"
success
"
,
confirmButtonColor
:
"
#00BCD4
"
},
function
()
{
$
(
"
#modal_bangunan_delete
"
).
css
(
'
display
'
,
'
none
'
);
})
}
else
{
swal
({
title
:
'
Error
'
,
text
:
'
Hubungi Mereka
'
,
type
:
"
warning
"
,
icon
:
"
error
"
,
confirmButtonColor
:
"
#00BCD4
"
})
}
}
})
});
// var map_bang = new L.map('map-insert-bang', {
// editable: true,
// zoomControl: false,
// drawControl: true
// }).setView([-2, 118], 5);
// mapss = 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)
// $(document).on("click", "#btn_perbaikan_bangunan", function() {
// if (map_bang.hasLayer(polyxxx)) {
// polyxxx.remove()
// }
// var id_polyx = $('#idbangunan').val();
// $("#input_perbaikan_bang").css("display", "block");
// $.ajax({
// url: "{% url 'apps:input-perbaikan-bang' %}",
// data: {
// 'id_bangunan': id_polyx
// },
// dataType: 'json',
// success: function(data) {
// $("#nama_bang").val(data[0]);
// $("#type_bang").val(data[1]);
// $("#id_bang_perbaikan").val(data[3]);
// $("#type_id_bang").val("1")
// var latlngs = data[2];
// map_bang.setView([latlngs['geometry']['coordinates'][0][0][1], latlngs['geometry']['coordinates'][0][0][0]], 19)
// let lop_poly_edit = data['geometry']['coordinates'][0][0];
// let list_poly_edit = [];
// for (var i = 0; i
<
lop_poly_edit
.
length
;
i
++
)
{
// geoj = lop_poly_edit[i][0];
// polygigi = [lop_poly_edit[i][1], lop_poly_edit[i][0]]
// list_poly_edit.push(polygigi);
// };
// polylyly = L.polygon(list_poly_edit).addTo(map_bang)
// polylyly.enableEdit();
// var hasil = (JSON.stringify(polylyly.toGeoJSON()))
// }
// })
// })
</script>
</script>
{% include 'includes/insert.html' %}
{% include 'includes/insert.html' %}
\ No newline at end of file
templates/includes/js-o.html
View file @
1dc705f3
...
@@ -1426,597 +1426,597 @@
...
@@ -1426,597 +1426,597 @@
});
});
var
geocodeService
=
L
.
esri
.
Geocoding
.
geocodeService
();
// var geocodeService = L.esri.Geocoding.geocodeService();
var
geocoderNominatim
=
new
L
.
Control
.
Geocoder
.
Nominatim
();
// var geocoderNominatim = new L.Control.Geocoder.Nominatim();
var
geo_bangunan
=
L
.
geoJson
(
null
,
{
// var geo_bangunan = L.geoJson(null, {
style
:
function
(
feature
)
{
// style: function(feature) {
return
{
// return {
color
:
"
#ff0008
"
,
// color: "#ff0008",
weight
:
1
,
// weight: 1,
opacity
:
2
,
// opacity: 2,
zIndex
:
1000
// zIndex: 1000
};
// };
},
// },
onEachFeature
:
function
(
feature
,
layer
)
{
if
(
feature
.
properties
)
{
var
lattitud
,
longitud
;
if
(
feature
.
geometry
.
type
==
'
MultiPolygon
'
)
{
lattitud
=
feature
.
geometry
.
coordinates
[
0
][
0
][
0
][
1
];
longitud
=
feature
.
geometry
.
coordinates
[
0
][
0
][
0
][
0
];
}
else
{
lattitud
=
feature
.
geometry
.
coordinates
[
0
][
0
][
1
];
longitud
=
feature
.
geometry
.
coordinates
[
0
][
0
][
0
];
};
layer
.
on
({
click
:
function
(
e
)
{
var
geogeo
=
geocodeService
.
reverse
().
latlng
(
e
.
latlng
).
run
(
function
(
error
,
result
)
{
if
(
result
.
address
.
Address
!=
''
)
{
var
alamat
=
result
.
address
.
Address
+
`, `
}
else
{
var
alamat
=
''
};
if
(
feature
.
administrasi
.
f9
==
'
None
'
)
{
var
path_img
=
"
static/img/image_null.jpg
"
}
else
{
var
path_img
=
`"static/image/bangunan/`
+
feature
.
administrasi
.
f9
+
`"`
}
var
list_history
=
feature
.
properties
.
f7
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;">
// onEachFeature: function(feature, layer) {
<div class="row">
// if (feature.properties) {
<label class="col-md-6">`
+
dt_history
[
1
]
+
`</label>
<a class="col-md-3" onclick="getjalanper(`
+
dt_history
[
0
]
+
`)"><i>View Ruas</i></a>
<a class="col-md-3" onclick="getdetailper(`
+
dt_history
[
0
]
+
`)" data-toggle="modal" data-target="#modal_detail"><i>View Detail</i></a>
</div>
</div>`
;
list_history_panel
+=
data_history
};
history
=
`<p class="text-center">
// var lattitud, longitud;
History Perbaikan
// if (feature.geometry.type == 'MultiPolygon') {
</p>
// lattitud = feature.geometry.coordinates[0][0][0][1];
<br>
// longitud = feature.geometry.coordinates[0][0][0][0];
`
+
list_history_panel
+
`
<p class="text-center" style="margin-top: 10px;">
<a href="#" id='btn_perbaikan_jalan' class="btn btn-default"><i>Tambah History Perbaikan</i></a>
</p>`
;
content_edit
=
`
// } else {
<div class="modal-dialog" style="width: max-content;height: max-content;">
// lattitud = feature.geometry.coordinates[0][0][1];
<div class="modal-content">
// longitud = feature.geometry.coordinates[0][0][0];
<div class="modal-header bg-info" style="background-color:#40777c;">
// };
<button type="button" class="close" data-dismiss="modal">×</button>
<h6 class="modal-title">Edit Polygon Bangunan dan Informasinya</h6>
</div>
<div class="modal-body" style="max-height: 450px;overflow-y: auto;">
<div class="row">
<div class="col-md-5">
<div id="map-edit" style="width:400px;height: 350px;">
</div>
</div>
<div class="col-md-4">
<input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunan" value="`
+
feature
.
geometry
+
`">
<table>
<tr>
<th>
Image
</th>
<td>
<input type="file" id="imgbangunan" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
<input style="display:none;" id="gambar" type="text" class="form-control" value="`
+
feature
.
administrasi
.
f9
+
`"required>
</td>
</tr>
<tr>
<td>
<input type="text" name="idbangunan" id="idbangunan" class="form-control hidden" value="`
+
feature
.
properties
.
f1
+
`" disable>
<input style="display:none;" id="coordinateZoneeditbang" type="text" class="form-control" value=""required>
</td>
</tr>
<tr>
<th>Nama Bangunan</th>
<td>
<input type="text" name="namebangunan" id="namebangunan" class="form-control" value="`
+
feature
.
properties
.
f2
+
`">
</td>
</tr>
<tr>
<th>Informasi Bangunan</th>
<td>
<input type="text" name="infobangunan" id="infobangunan" class="form-control" value="`
+
feature
.
properties
.
f3
+
`">
</td>
</tr>
<tr>
<th>Kelurahan</th>
<td>
<input type=" text " name="nmkelurahan " id="nmkelurahan" class="form-control " value="`
+
feature
.
administrasi
.
f1
+
`">
</td>
</tr>
<tr>
<th>Kecamatan</th>
<td>
<input type="text " name="nmkecamatan " id="nmkecamatan" class="form-control " value="`
+
feature
.
administrasi
.
f2
+
`">
</td>
</tr>
<tr>
<th>Kab/Kota</th>
<td>
<input type="text " name="nmkabkota " id="nmkabkota" class="form-control " value="`
+
feature
.
administrasi
.
f3
+
`">
</td>
</tr>
<tr>
<th>Provinsi</th>
<td>
<input type="text " name="nmprovinsi " id="nmprovinsi" class="form-control " value="`
+
feature
.
administrasi
.
f4
+
`">
</td>
</tr>
</table>
// layer.on({
</div>
// click: function(e) {
// var geogeo = geocodeService.reverse().latlng(e.latlng).run(function(error, result) {
<div class="col-md-3 ">
// if (result.address.Address != '') {
// var alamat = result.address.Address + `, `
// } else {
// var alamat = ''
// };
<table>
// if (feature.administrasi.f9 == 'None') {
<tr>
// var path_img = "static/img/image_null.jpg"
<th>Luas Bangunan</th>
// } else {
<td>
// var path_img = `"static/image/bangunan/` + feature.administrasi.f9 + `"`
<input type="text " name="luasbangunan " id="luasbangunan" class="form-control " value="`
+
feature
.
administrasi
.
f6
+
`">
// }
</td>
</tr>
<tr>
<th>Luas Tanah</th>
<td>
<input type="text " name="luastanah " id="luastanah" class="form-control " value="`
+
feature
.
administrasi
.
f7
+
`">
</td>
</tr>
<tr>
<th>Tinggi Bangunan</th>
<td>
<input type="text " name="tinggibangunan " id="tinggibangunan" class="form-control " value="`
+
feature
.
administrasi
.
f8
+
`">
</td>
</tr>
<tr>
<th>Pemilik</th>
<td>
<input type="text " name="pemilik " id="pemilik" class="form-control " value="`
+
feature
.
administrasi
.
f10
+
`">
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="modal-footer ">
// // var list_history = feature.properties.f7
<button type="button " class="btn btn-link " data-dismiss="modal ">Close</button>
<button type="button " id="btnsavebangunan" class="btn btn-info ">Save changes</button>
// // var list_history_panel = ``
</div>
// // for (var i = 0; i
<
list_history
.
length
;
i
++
)
{
</div>
// // var dt_history = list_history[i].split(",");
</div>`
;
content_delete
=
`
// // var data_history = `
<
div
class
=
"
form-group
"
style
=
"
margin-bottom:0px;
"
>
<div class="modal-dialog" style="width: max-content;height: max-content;">
// //
<
div
class
=
"
row
"
>
<div class="modal-content">
// //
<
label
class
=
"
col-md-6
"
>
` + dt_history[1] + `
<
/label
>
<div class="modal-header bg-info" style="background-color:#40777c;">
// //
<
a
class
=
"
col-md-3
"
onclick
=
"
getjalanper(` + dt_history[0] + `)
"
><
i
>
View
Ruas
<
/i></
a
>
<table>
// //
<
a
class
=
"
col-md-3
"
onclick
=
"
getdetailper(` + dt_history[0] + `)
"
data
-
toggle
=
"
modal
"
data
-
target
=
"
#modal_detail
"
><
i
>
View
Detail
<
/i></
a
>
<tr>
// //
<
/div
>
<th><h6 class="modal-title">Delete Bangunan dan Informasinya</h6></th>
// //
<
/div>`
;
<td><button type="button" class="close" data-dismiss="modal">×</button></td>
// // list_history_panel += data_history
</tr>
// // };
</table>
</div>
// // history = `
<
p
class
=
"
text-center
"
>
<div class="form-group" style="margin-bottom:10px;">
// // History Perbaikan
<div id="map-delete" style="width: 300px;height: 250px;position: relative;margin-left: 10px;margin-right: 10px;margin-top: 10px;"></div>
// //
<
/p
>
<div class="form-group">
// //
<
br
>
<div class="col-lg-12" style="margin-top:10px;margin-bottom:10px;">
// // ` + list_history_panel + `
<input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunanhps" value="">
// //
<
p
class
=
"
text-center
"
style
=
"
margin-top: 10px;
"
>
<input type="text" name="idbangunan" id="idbangunanhps" class="form-control hidden" value="`
+
feature
.
properties
.
f1
+
`" disable>
// //
<
a
href
=
"
#
"
id
=
'
btn_perbaikan_jalan
'
class
=
"
btn btn-default
"
><
i
>
Tambah
History
Perbaikan
<
/i></
a
>
<input type="text" name="namebangunan" id="namebangunanhps" class="form-control" value="`
+
feature
.
properties
.
f2
+
`">
// //
<
/p>`
;
<input type="text" name="infobangunan" id="infobangunanhps" class="form-control" value="`
+
feature
.
properties
.
f3
+
`">
</div>
// content_edit = `
</div>
//
<
div
class
=
"
modal-dialog
"
style
=
"
width: max-content;height: max-content;
"
>
</div>
//
<
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
"
>
Edit
Polygon
Bangunan
dan
Informasinya
<
/h6
>
//
<
/div
>
//
<
div
class
=
"
modal-body
"
style
=
"
max-height: 450px;overflow-y: auto;
"
>
//
<
div
class
=
"
row
"
>
//
<
div
class
=
"
col-md-5
"
>
//
<
div
id
=
"
map-edit
"
style
=
"
width:400px;height: 350px;
"
>
//
<
/div
>
//
<
/div
>
//
<
div
class
=
"
col-md-4
"
>
//
<
input
type
=
"
text
"
class
=
"
hidden
"
name
=
"
coordinatebangunan
"
id
=
"
coordinatebangunan
"
value
=
"
`+feature.geometry+`
"
>
//
<
table
>
//
<
tr
>
//
<
th
>
// Image
//
<
/th
>
//
<
td
>
//
<
input
type
=
"
file
"
id
=
"
imgbangunan
"
name
=
"
images[]
"
multiple
accept
=
"
image/jpg,image/png,image/jpeg,image/gif
"
>
//
<
input
style
=
"
display:none;
"
id
=
"
gambar
"
type
=
"
text
"
class
=
"
form-control
"
value
=
"
`+feature.administrasi.f9+`
"
required
>
//
<
/td
>
//
<
/tr
>
//
<
tr
>
//
<
td
>
//
<
input
type
=
"
text
"
name
=
"
idbangunan
"
id
=
"
idbangunan
"
class
=
"
form-control hidden
"
value
=
"
`+feature.properties.f1+`
"
disable
>
//
<
input
style
=
"
display:none;
"
id
=
"
coordinateZoneeditbang
"
type
=
"
text
"
class
=
"
form-control
"
value
=
""
required
>
//
<
/td
>
//
<
/tr
>
//
<
tr
>
//
<
th
>
Nama
Bangunan
<
/th
>
//
<
td
>
//
<
input
type
=
"
text
"
name
=
"
namebangunan
"
id
=
"
namebangunan
"
class
=
"
form-control
"
value
=
"
`+feature.properties.f2+`
"
>
//
<
/td
>
//
<
/tr
>
//
<
tr
>
//
<
th
>
Informasi
Bangunan
<
/th
>
//
<
td
>
//
<
input
type
=
"
text
"
name
=
"
infobangunan
"
id
=
"
infobangunan
"
class
=
"
form-control
"
value
=
"
`+feature.properties.f3+`
"
>
//
<
/td
>
//
<
/tr
>
//
<
tr
>
//
<
th
>
Kelurahan
<
/th
>
//
<
td
>
//
<
input
type
=
"
text
"
name
=
"
nmkelurahan
"
id
=
"
nmkelurahan
"
class
=
"
form-control
"
value
=
"
`+feature.administrasi.f1+`
"
>
//
<
/td
>
//
<
/tr
>
//
<
tr
>
//
<
th
>
Kecamatan
<
/th
>
//
<
td
>
//
<
input
type
=
"
text
"
name
=
"
nmkecamatan
"
id
=
"
nmkecamatan
"
class
=
"
form-control
"
value
=
"
`+feature.administrasi.f2+`
"
>
//
<
/td
>
//
<
/tr
>
//
<
tr
>
//
<
th
>
Kab
/
Kota
<
/th
>
//
<
td
>
//
<
input
type
=
"
text
"
name
=
"
nmkabkota
"
id
=
"
nmkabkota
"
class
=
"
form-control
"
value
=
"
`+feature.administrasi.f3+`
"
>
//
<
/td
>
//
<
/tr
>
//
<
tr
>
//
<
th
>
Provinsi
<
/th
>
//
<
td
>
//
<
input
type
=
"
text
"
name
=
"
nmprovinsi
"
id
=
"
nmprovinsi
"
class
=
"
form-control
"
value
=
"
`+feature.administrasi.f4+`
"
>
//
<
/td
>
//
<
/tr
>
<div class="modal-footer">
//
<
/table
>
<button type="button" id="btnsavedeletebangunan" class="btn btn-info">Hapus</button>
//
<
/div
>
</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
.
properties
.
f3
+
`
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<span>
`
+
alamat
+
feature
.
administrasi
.
f1
+
`, `
+
feature
.
administrasi
.
f2
+
`, `
+
feature
.
administrasi
.
f3
+
`, `
+
feature
.
administrasi
.
f4
+
`
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<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>
<p class="text-center" style="margin-top: 25px;">
<a href="#" class="btn btn-default" data-toggle="modal" data-target="#modal_bangunan_edit" id="btn_edit_bangunan" data-backdrop="static" data-keyboard="false"><i>Edit Informasi Bangunan</i></a>
<a href="#" id='btn_delete_bangunan' class='btn
btn-default btn_edit_bangunan' data-toggle="modal" data-target="#modal_bangunan_delete" data-backdrop="static" data-keyboard="false"><i>Delete Bangunan</i></a>
</p>
</th>
</tr>
</div>
<div class="container">
<tr style="height: 40px;">
<th id="history_panel">
`
+
history
+
`
</th>
</tr>
</div>
</tbody>
</table>`
;
$
(
"
#isi_panel
"
).
html
(
content
);
$
(
"
#modal_bangunan_edit
"
).
html
(
content_edit
);
$
(
"
#modal_bangunan_delete
"
).
html
(
content_delete
);
});
// $('#idbangunan').val(feature.properties.f1);
// $('#namebangunan').val(feature.properties.f2);
// $('#infobangunan').val(feature.properties.f3);
// $('#nmkelurahan').val(feature.administrasi.f1);
// $('#nmkecamatan').val(feature.administrasi.f2);
// $('#nmkabkota').val(feature.administrasi.f3);
// $('#nmprovinsi').val(feature.administrasi.f4);
// $('#luasbangunan').val(feature.administrasi.f6);
// $('#luastanah').val(feature.administrasi.f7);
// $('#tinggibangunan').val(feature.administrasi.f8);
// $('#pemilik').val(feature.administrasi.f10);
// $('#gambar').val(feature.administrasi.f9);
// $("#coordinatebangunan").val(feature.geometry);
$
(
"
#panel-samping
"
).
css
(
"
display
"
,
"
block
"
);
$
(
"
#button_hide_panel
"
).
css
(
"
display
"
,
"
block
"
);
// $('#idbangunanhps').val(feature.properties.f1);
//
<
div
class
=
"
col-md-3
"
>
// $('#namebangunanhps').val(feature.properties.f2);
// $('#infobangunanhps').val(feature.properties.f3);
panel_samp
()
//
<
table
>
}
//
<
tr
>
});
//
<
th
>
Luas
Bangunan
<
/th
>
//
<
td
>
//
<
input
type
=
"
text
"
name
=
"
luasbangunan
"
id
=
"
luasbangunan
"
class
=
"
form-control
"
value
=
"
`+feature.administrasi.f6+`
"
>
//
<
/td
>
//
<
/tr
>
//
<
tr
>
//
<
th
>
Luas
Tanah
<
/th
>
//
<
td
>
//
<
input
type
=
"
text
"
name
=
"
luastanah
"
id
=
"
luastanah
"
class
=
"
form-control
"
value
=
"
`+feature.administrasi.f7+`
"
>
//
<
/td
>
//
<
/tr
>
//
<
tr
>
//
<
th
>
Tinggi
Bangunan
<
/th
>
//
<
td
>
//
<
input
type
=
"
text
"
name
=
"
tinggibangunan
"
id
=
"
tinggibangunan
"
class
=
"
form-control
"
value
=
"
`+feature.administrasi.f8+`
"
>
//
<
/td
>
//
<
/tr
>
//
<
tr
>
//
<
th
>
Pemilik
<
/th
>
//
<
td
>
//
<
input
type
=
"
text
"
name
=
"
pemilik
"
id
=
"
pemilik
"
class
=
"
form-control
"
value
=
"
`+feature.administrasi.f10+`
"
>
//
<
/td
>
//
<
/tr
>
//
<
/table
>
//
<
/div
>
//
<
/div
>
//
<
/div
>
pool
.
push
({
//
<
div
class
=
"
modal-footer
"
>
name
:
feature
.
properties
.
f2
,
//
<
button
type
=
"
button
"
class
=
"
btn btn-link
"
data
-
dismiss
=
"
modal
"
>
Close
<
/button
>
id
:
L
.
stamp
(
layer
),
//
<
button
type
=
"
button
"
id
=
"
btnsavebangunan
"
class
=
"
btn btn-info
"
>
Save
changes
<
/button
>
lat
:
lattitud
,
//
<
/div
>
lng
:
longitud
//
<
/div
>
});
//
<
/div>`
;
}
// content_delete=`
layer
.
on
({
//
<
div
class
=
"
modal-dialog
"
style
=
"
width: max-content;height: max-content;
"
>
mouseover
:
function
(
e
)
{
//
<
div
class
=
"
modal-content
"
>
var
layer
=
e
.
target
;
//
<
div
class
=
"
modal-header bg-info
"
style
=
"
background-color:#40777c;
"
>
layer
.
setStyle
({
//
<
table
>
weight
:
1
,
//
<
tr
>
Color
:
"
#067800
"
,
//
<
th
><
h6
class
=
"
modal-title
"
>
Delete
Bangunan
dan
Informasinya
<
/h6></
th
>
fillColor
:
"
#067800
"
,
//
<
td
><
button
type
=
"
button
"
class
=
"
close
"
data
-
dismiss
=
"
modal
"
>&
times
;
<
/button></
td
>
//
<
/tr
>
//
<
/table
>
//
<
/div
>
//
<
div
class
=
"
form-group
"
style
=
"
margin-bottom:10px;
"
>
//
<
div
id
=
"
map-delete
"
style
=
"
width: 300px;height: 250px;position: relative;margin-left: 10px;margin-right: 10px;margin-top: 10px;
"
><
/div
>
//
<
div
class
=
"
form-group
"
>
//
<
div
class
=
"
col-lg-12
"
style
=
"
margin-top:10px;margin-bottom:10px;
"
>
//
<
input
type
=
"
text
"
class
=
"
hidden
"
name
=
"
coordinatebangunan
"
id
=
"
coordinatebangunanhps
"
value
=
""
>
//
<
input
type
=
"
text
"
name
=
"
idbangunan
"
id
=
"
idbangunanhps
"
class
=
"
form-control hidden
"
value
=
"
`+feature.properties.f1+`
"
disable
>
//
<
input
type
=
"
text
"
name
=
"
namebangunan
"
id
=
"
namebangunanhps
"
class
=
"
form-control
"
value
=
"
`+feature.properties.f2+`
"
>
//
<
input
type
=
"
text
"
name
=
"
infobangunan
"
id
=
"
infobangunanhps
"
class
=
"
form-control
"
value
=
"
`+feature.properties.f3+`
"
>
//
<
/div
>
//
<
/div
>
//
<
/div
>
});
//
<
div
class
=
"
modal-footer
"
>
if
(
!
L
.
Browser
.
ie
&&
!
L
.
Browser
.
opera
)
{
//
<
button
type
=
"
button
"
id
=
"
btnsavedeletebangunan
"
class
=
"
btn btn-info
"
>
Hapus
<
/button
>
layer
.
bringToFront
();
//
<
/div
>
}
//
<
/div
>
},
//
<
/div>`
;
mouseout
:
function
(
e
)
{
// content = `
geo_bangunan
.
resetStyle
(
e
.
target
);
//
<
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.properties.f3 + `
//
<
/span
>
//
<
/th
>
//
<
/tr
>
//
<
/div
>
//
<
div
class
=
"
container
"
>
//
<
tr
style
=
"
height: 40px;
"
>
//
<
th
>
//
<
span
>
// ` + alamat + feature.administrasi.f1 + `, ` + feature.administrasi.f2 + `, ` + feature.administrasi.f3 + `, ` + feature.administrasi.f4 + `
//
<
/span
>
//
<
/th
>
//
<
/tr
>
//
<
/div
>
//
<
div
class
=
"
container
"
>
//
<
tr
style
=
"
height: 40px;
"
>
//
<
th
>
//
<
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
>
//
<
p
class
=
"
text-center
"
style
=
"
margin-top: 25px;
"
>
//
<
a
href
=
"
#
"
class
=
"
btn btn-default
"
data
-
toggle
=
"
modal
"
data
-
target
=
"
#modal_bangunan_edit
"
id
=
"
btn_edit_bangunan
"
data
-
backdrop
=
"
static
"
data
-
keyboard
=
"
false
"
><
i
>
Edit
Informasi
Bangunan
<
/i></
a
>
//
<
a
href
=
"
#
"
id
=
'
btn_delete_bangunan
'
class
=
'
btn
// btn-default btn_edit_bangunan
'
data
-
toggle
=
"
modal
"
data
-
target
=
"
#modal_bangunan_delete
"
data
-
backdrop
=
"
static
"
data
-
keyboard
=
"
false
"
><
i
>
Delete
Bangunan
<
/i></
a
>
//
<
/p
>
//
<
/th
>
//
<
/tr
>
//
<
/div
>
//
<
div
class
=
"
container
"
>
//
<
tr
style
=
"
height: 40px;
"
>
//
<
th
id
=
"
history_panel
"
>
// ` + history + `
//
<
/th
>
//
<
/tr
>
//
<
/div
>
//
<
/tbody
>
//
<
/table>`
;
// $("#isi_panel").html(content);
// $("#modal_bangunan_edit").html(content_edit);
// $("#modal_bangunan_delete").html(content_delete);
// });
// // $('#idbangunan').val(feature.properties.f1);
// // $('#namebangunan').val(feature.properties.f2);
// // $('#infobangunan').val(feature.properties.f3);
// // $('#nmkelurahan').val(feature.administrasi.f1);
// // $('#nmkecamatan').val(feature.administrasi.f2);
// // $('#nmkabkota').val(feature.administrasi.f3);
// // $('#nmprovinsi').val(feature.administrasi.f4);
// // $('#luasbangunan').val(feature.administrasi.f6);
// // $('#luastanah').val(feature.administrasi.f7);
// // $('#tinggibangunan').val(feature.administrasi.f8);
// // $('#pemilik').val(feature.administrasi.f10);
// // $('#gambar').val(feature.administrasi.f9);
// // $("#coordinatebangunan").val(feature.geometry);
// $("#panel-samping").css("display", "block");
// $("#button_hide_panel").css("display", "block");
function
geo_json_bangunan
(
data
)
{
// // $('#idbangunanhps').val(feature.properties.f1);
geo_bangunan
.
addData
(
data
)
// // $('#namebangunanhps').val(feature.properties.f2);
}
// // $('#infobangunanhps').val(feature.properties.f3);
// panel_samp()
// }
// });
var
checkBox_building
=
document
.
getElementById
(
"
geo_building
"
);
// pool.push({
var
checkBox_2d
=
document
.
getElementById
(
"
2d-maps
"
);
// name: feature.properties.f2,
// id: L.stamp(layer),
// lat: lattitud,
// lng: longitud
// });
// }
// layer.on({
// mouseover: function(e) {
// var layer = e.target;
// layer.setStyle({
// weight: 1,
// Color: "#067800",
// fillColor: "#067800",
map
.
on
(
"
movestart
"
,
function
()
{
// });
geo_bangunan
.
clearLayers
();
// if (!L.Browser.ie && !L.Browser.opera) {
});
// layer.bringToFront();
// }
// },
// mouseout: function(e) {
// geo_bangunan.resetStyle(e.target);
// }
// });
// }
// });
map
.
on
(
"
moveend
"
,
function
()
{
// function geo_json_bangunan(data) {
var
wetan
=
map
.
getBounds
().
getEast
();
// geo_bangunan.addData(data)
var
kulon
=
map
.
getBounds
().
getWest
();
// }
var
lor
=
map
.
getBounds
().
getNorth
()
var
kidul
=
map
.
getBounds
().
getSouth
();
var
center
=
map
.
getBounds
().
getCenter
();
var
zoom
=
map
.
getZoom
();
if
(
checkBox_building
.
checked
==
true
||
checkBox_2d
.
checked
==
true
)
{
if
(
zoom
>
17
)
{
// var checkBox_building = document.getElementById("geo_building");
if
(
map
.
hasLayer
(
geo_bangunan
))
{
// var checkBox_2d = document.getElementById("2d-maps");
geo_bangunan
.
clearLayers
()
geo_bangunan
.
remove
()
}
$
.
ajax
({
url
:
"
{% url 'api:building' %}
"
,
data
:
{
'
wetan
'
:
wetan
,
'
kulon
'
:
kulon
,
'
lor
'
:
lor
,
'
kidul
'
:
kidul
},
dataType
:
'
json
'
,
success
:
function
(
data
)
{
let
list_poly
=
[];
// map.on("movestart", function() {
for
(
var
i
=
0
;
i
<
data
[
'
gen
'
].
length
;
i
++
)
{
// geo_bangunan.clearLayers();
geoj
=
data
[
'
gen
'
][
i
][
0
];
// });
list_poly
.
push
(
geoj
);
};
geo_json_bangunan
(
list_poly
);
}
});
}
geo_bangunan
.
addTo
(
map
)
// map.on("moveend", function() {
}
else
{
// var wetan = map.getBounds().getEast();
geo_bangunan
.
clearLayers
();
// var kulon = map.getBounds().getWest();
geo_bangunan
.
remove
()
// var lor = map.getBounds().getNorth()
}
// var kidul = map.getBounds().getSouth();
});
// var center = map.getBounds().getCenter();
// var zoom = map.getZoom();
var
map_edit
=
new
L
.
map
(
'
map-edit
'
,
{
// if (checkBox_building.checked == true || checkBox_2d.checked == true) {
editable
:
true
,
zoomControl
:
false
,
drawControl
:
true
}).
setView
([
-
2
,
118
],
5
);
mapss
=
L
.
tileLayer
(
'
https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}
'
,
{
// if (zoom > 17) {
maxZoom
:
22
,
// if (map.hasLayer(geo_bangunan)) {
minZoom
:
4
,
// geo_bangunan.clearLayers()
}).
addTo
(
map_edit
);
// geo_bangunan.remove()
// }
// $.ajax({
// url: "{% url 'api:building' %}",
// data: {
// 'wetan': wetan,
// 'kulon': kulon,
// 'lor': lor,
// 'kidul': kidul
// },
// dataType: 'json',
// success: function(data) {
var
polylyly
=
L
.
polygon
([
// let list_poly = [];
[
-
4.1283969
,
104.1674575
],
// for (var i = 0; i
<
data
[
'
gen
'
].
length
;
i
++
)
{
[
-
4.128396
,
104.1674947
],
// geoj = data['gen'][i][0];
[
-
4.1284664
,
104.1674964
],
// list_poly.push(geoj);
[
-
4.1284674
,
104.1674593
],
// };
[
-
4.1283969
,
104.1674575
]
// geo_json_bangunan(list_poly);
]).
addTo
(
map_edit
)
// }
// });
// }
$
(
document
).
on
(
"
click
"
,
"
#btn_edit_bangunan
"
,
function
()
{
// geo_bangunan.addTo(map)
if
(
map_edit
.
hasLayer
(
polylyly
))
{
// } else
{
polylyly
.
remove
()
// geo_bangunan.clearLayers();
}
// geo_bangunan.remove()
var
id_poly
=
$
(
'
#idbangunan
'
).
val
();
// }
loaderPage
(
true
);
// }
);
$
.
ajax
({
// var map_edit = new L.map('map-edit', {
url
:
"
{% url 'api:edit' %}
"
,
// editable: true,
data
:
{
// zoomControl: false,
'
id_poly
'
:
id_poly
// drawControl: true
},
// }).setView([-2, 118], 5);
dataType
:
'
json
'
,
success
:
function
(
data
)
{
// mapss = L.tileLayer('https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', {
// maxZoom: 22,
// minZoom: 4,
// }).addTo(map_edit);
// var polylyly = L.polygon([
// [-4.1283969, 104.1674575],
// [-4.128396, 104.1674947],
// [-4.1284664, 104.1674964],
// [-4.1284674, 104.1674593],
// [-4.1283969, 104.1674575]
// ]).addTo(map_edit)
// $(document).on("click", "#btn_edit_bangunan", function() {
// if (map_edit.hasLayer(polylyly)) {
// polylyly.remove()
// }
// var id_poly = $('#idbangunan').val();
// loaderPage(true);
setTimeout
(
function
()
{
// $.ajax({
map_edit
.
invalidateSize
();
// url: "{% url 'api:edit' %}",
},
1000
);
// data: {
loaderPage
(
false
);
// 'id_poly': id_poly
// },
// dataType: 'json',
// success: function(data) {
map_edit
.
setView
([
data
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
][
0
][
1
],
data
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
][
0
][
0
]],
19
);
// setTimeout(function() {
// map_edit.invalidateSize();
// }, 1000);
// loaderPage(false);
// map_edit.setView([data['geometry']['coordinates'][0][0][0][1], data['geometry']['coordinates'][0][0][0][0]], 19);
let
lop_poly_edit
=
data
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
];
let
list_poly_edit
=
[];
for
(
var
i
=
0
;
i
<
lop_poly_edit
.
length
;
i
++
)
{
geoj
=
lop_poly_edit
[
i
][
0
];
polygigi
=
[
lop_poly_edit
[
i
][
1
],
lop_poly_edit
[
i
][
0
]]
list_poly_edit
.
push
(
polygigi
);
};
polylyly
=
L
.
polygon
(
list_poly_edit
).
addTo
(
map_edit
)
// let lop_poly_edit = data['geometry']['coordinates'][0][0];
polylyly
.
enableEdit
();
// let list_poly_edit = [];
var
hasil
=
(
JSON
.
stringify
(
polyly
.
toGeoJSON
()))
// for (var i = 0; i
<
lop_poly_edit
.
length
;
i
++
)
{
$
(
'
#btnsavebangunan
'
).
click
(
function
()
{
// geoj = lop_poly_edit[i][0];
var
hasil
=
(
JSON
.
stringify
(
polylyly
.
toGeoJSON
()))
// polygigi = [lop_poly_edit[i][1], lop_poly_edit[i][0]]
$
(
"
#coordinatebangunan
"
).
val
(
hasil
);
// list_poly_edit.push(polygigi);
})
// };
}
})
});
$
(
document
).
on
(
"
click
"
,
"
#btnsavebangunan
"
,
function
()
{
// polylyly = L.polygon(list_poly_edit).addTo(map_edit)
var
data
=
new
FormData
();
// polylyly.enableEdit();
data
.
append
(
"
file
"
,
$
(
"
input[id^='imgbangunan']
"
)[
0
].
files
[
0
]);
// var hasil = (JSON.stringify(polyly.toGeoJSON()))
data
.
append
(
"
csrfmiddlewaretoken
"
,
"
{{ csrf_token }}
"
);
// $('#btnsavebangunan').click(function() {
data
.
append
(
'
name_b
'
,
$
(
'
#namebangunan
'
).
val
())
// var hasil = (JSON.stringify(polylyly.toGeoJSON()))
data
.
append
(
'
polygon
'
,
$
(
'
#coordinatebangunan
'
).
val
())
// $("#coordinatebangunan").val(hasil);
data
.
append
(
'
info_b
'
,
$
(
'
#infobangunan
'
).
val
())
// })
data
.
append
(
'
desa_b
'
,
$
(
'
#nmkelurahan
'
).
val
())
// }
data
.
append
(
'
kec_b
'
,
$
(
'
#nmkecamatan
'
).
val
())
// })
data
.
append
(
'
kab_b
'
,
$
(
'
#nmkabkota
'
).
val
())
// });
data
.
append
(
'
pro_b
'
,
$
(
'
#nmprovinsi
'
).
val
())
data
.
append
(
'
id_poly
'
,
$
(
'
#idbangunan
'
).
val
())
data
.
append
(
'
gambar
'
,
$
(
'
#gambar
'
).
val
())
data
.
append
(
'
luasbangunan
'
,
$
(
'
#luasbangunan
'
).
val
())
data
.
append
(
'
luastanah
'
,
$
(
'
#luastanah
'
).
val
())
data
.
append
(
'
tinggibangunan
'
,
$
(
'
#tinggibangunan
'
).
val
())
data
.
append
(
'
pemilik
'
,
$
(
'
#pemilik
'
).
val
())
$
.
ajax
({
// $(document).on("click", "#btnsavebangunan", function() {
url
:
"
{% url 'api:validatedit' %}
"
,
// var data = new FormData();
data
:
data
,
// data.append("file", $("input[id^='imgbangunan']")[0].files[0]);
dataType
:
'
json
'
,
// data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
type
:
'
POST
'
,
// data.append('name_b', $('#namebangunan').val())
processData
:
false
,
// data.append('polygon', $('#coordinatebangunan').val())
contentType
:
false
,
// data.append('info_b', $('#infobangunan').val())
success
:
function
(
data
)
{
// data.append('desa_b', $('#nmkelurahan').val())
let
response
=
data
// data.append('kec_b', $('#nmkecamatan').val())
if
(
response
.
code
==
0
)
{
// data.append('kab_b', $('#nmkabkota').val())
swal
({
// data.append('pro_b', $('#nmprovinsi').val())
title
:
response
.
info
,
// data.append('id_poly', $('#idbangunan').val())
text
:
response
.
data
,
// data.append('gambar', $('#gambar').val())
type
:
"
success
"
,
icon
:
"
success
"
,
// data.append('luasbangunan', $('#luasbangunan').val())
confirmButtonColor
:
"
#00BCD4
"
// data.append('luastanah', $('#luastanah').val())
},
function
()
{
// data.append('tinggibangunan', $('#tinggibangunan').val())
$
(
"
#modal_bangunan_edit
"
).
css
(
'
display
'
,
'
none
'
);
// data.append('pemilik', $('#pemilik').val())
})
}
else
{
swal
({
title
:
response
.
info
,
text
:
response
.
data
,
type
:
"
warning
"
,
icon
:
"
error
"
,
confirmButtonColor
:
"
#00BCD4
"
})
}
// $.ajax({
}
// url: "{% url 'api:validatedit' %}",
})
// data: data,
// dataType: 'json',
// type: 'POST',
// processData: false,
// contentType: false,
// success: function(data) {
// let response = data
// if (response.code == 0) {
// swal({
// title: response.info,
// text: response.data,
// type: "success",
// icon: "success",
// confirmButtonColor: "#00BCD4"
// }, function() {
// $("#modal_bangunan_edit").css('display', 'none');
// })
// } else {
// swal({
// title: response.info,
// text: response.data,
// type: "warning",
// icon: "error",
// confirmButtonColor: "#00BCD4"
// })
});
// }
// }
// })
$
(
document
).
on
(
"
click
"
,
"
#btn_delete_bangunan
"
,
function
()
{
// });
var
map_delete
=
new
L
.
map
(
'
map-delete
'
,
{
editable
:
true
,
zoomControl
:
false
,
drawControl
:
true
}).
setView
([
-
2
,
118
],
5
);
mapss
=
L
.
tileLayer
(
'
https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}
'
,
{
// $(document).on("click", "#btn_delete_bangunan", function() {
maxZoom
:
22
,
// var map_delete = new L.map('map-delete', {
minZoom
:
4
,
// editable: true,
}).
addTo
(
map_delete
);
// zoomControl: false,
var
id_polyhps
=
$
(
'
#idbangunanhps
'
).
val
();
// drawControl: true
// console.log(id_polyhps)
// }).setView([-2, 118], 5);
loaderPage
(
true
);
// mapss = L.tileLayer('https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', {
// maxZoom: 22,
// minZoom: 4,
// }).addTo(map_delete);
// var id_polyhps = $('#idbangunanhps').val();
// // console.log(id_polyhps)
// loaderPage(true);
$
.
ajax
({
//
$.ajax({
url
:
"
{% url 'api:edit' %}
"
,
//
url: "{% url 'api:edit' %}",
data
:
{
//
data: {
'
id_poly
'
:
id_polyhps
//
'id_poly': id_polyhps
},
//
},
dataType
:
'
json
'
,
//
dataType: 'json',
success
:
function
(
data
)
{
//
success: function(data) {
setTimeout
(
function
()
{
//
setTimeout(function() {
map_delete
.
invalidateSize
();
//
map_delete.invalidateSize();
},
1000
);
//
}, 1000);
loaderPage
(
false
);
//
loaderPage(false);
map_delete
.
setView
([
data
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
][
0
][
1
],
data
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
][
0
][
0
]],
19
);
//
map_delete.setView([data['geometry']['coordinates'][0][0][0][1], data['geometry']['coordinates'][0][0][0][0]], 19);
let
lop_poly_edit
=
data
[
'
geometry
'
][
'
coordinates
'
][
0
][
0
];
//
let lop_poly_edit = data['geometry']['coordinates'][0][0];
let
list_poly_edit
=
[];
//
let list_poly_edit = [];
for
(
var
i
=
0
;
i
<
lop_poly_edit
.
length
;
i
++
)
{
//
for (var i = 0; i
<
lop_poly_edit
.
length
;
i
++
)
{
geoj
=
lop_poly_edit
[
i
][
0
];
//
geoj = lop_poly_edit[i][0];
polygigi
=
[
lop_poly_edit
[
i
][
1
],
lop_poly_edit
[
i
][
0
]]
//
polygigi = [lop_poly_edit[i][1], lop_poly_edit[i][0]]
list_poly_edit
.
push
(
polygigi
);
//
list_poly_edit.push(polygigi);
};
//
};
var
polyly
=
L
.
polygon
(
list_poly_edit
).
addTo
(
map_delete
)
//
var polyly = L.polygon(list_poly_edit).addTo(map_delete)
$
(
'
#btnsavedeletebangunan
'
).
click
(
function
()
{
//
$('#btnsavedeletebangunan').click(function() {
var
hasil
=
(
JSON
.
stringify
(
polyly
.
toGeoJSON
()))
//
var hasil = (JSON.stringify(polyly.toGeoJSON()))
$
(
"
#coordinatebangunan
"
).
val
(
hasil
);
//
$("#coordinatebangunan").val(hasil);
})
//
})
}
//
}
})
//
})
});
//
});
$
(
document
).
on
(
"
click
"
,
"
#btnsavedeletebangunan
"
,
function
()
{
//
$(document).on("click", "#btnsavedeletebangunan", function() {
var
data
=
new
FormData
();
//
var data = new FormData();
data
.
append
(
'
id_poly
'
,
$
(
'
#idbangunan
'
).
val
())
//
data.append('id_poly', $('#idbangunan').val())
$
.
ajax
({
//
$.ajax({
url
:
"
{% url 'api:hapus' %}
"
,
//
url: "{% url 'api:hapus' %}",
data
:
data
,
//
data: data,
dataType
:
'
json
'
,
//
dataType: 'json',
type
:
'
POST
'
,
//
type: 'POST',
processData
:
false
,
//
processData: false,
contentType
:
false
,
//
contentType: false,
success
:
function
(
data
)
{
//
success: function(data) {
let
response
=
data
//
let response = data
if
(
response
.
code
==
0
)
{
//
if (response.code == 0) {
swal
({
//
swal({
title
:
response
.
info
,
//
title: response.info,
text
:
response
.
data
,
//
text: response.data,
type
:
"
success
"
,
//
type: "success",
icon
:
"
success
"
,
//
icon: "success",
confirmButtonColor
:
"
#00BCD4
"
//
confirmButtonColor: "#00BCD4"
},
function
()
{
//
}, function() {
$
(
"
#modal_bangunan_delete
"
).
css
(
'
display
'
,
'
none
'
);
//
$("#modal_bangunan_delete").css('display', 'none');
})
//
})
}
else
{
//
} else {
swal
({
//
swal({
title
:
'
Error
'
,
//
title: 'Error',
text
:
'
Hubungi Mereka
'
,
//
text: 'Hubungi Mereka',
type
:
"
warning
"
,
//
type: "warning",
icon
:
"
error
"
,
//
icon: "error",
confirmButtonColor
:
"
#00BCD4
"
//
confirmButtonColor: "#00BCD4"
})
//
})
}
//
}
}
//
}
})
//
})
});
//
});
var
geo_jalan
=
L
.
geoJson
(
null
,
{
var
geo_jalan
=
L
.
geoJson
(
null
,
{
style
:
function
(
feature
)
{
style
:
function
(
feature
)
{
...
@@ -2074,7 +2074,7 @@
...
@@ -2074,7 +2074,7 @@
layer
.
on
({
layer
.
on
({
click
:
function
(
e
)
{
click
:
function
(
e
)
{
var
geogeo
=
geocodeService
.
reverse
().
latlng
(
e
.
latlng
).
run
(
function
(
error
,
result
)
{
var
geogeo
=
geocodeService
.
reverse
().
latlng
(
e
.
latlng
).
run
(
function
(
error
,
result
)
{
if
(
feature
.
properties
.
f6
==
'
N
ONE
'
)
{
if
(
feature
.
properties
.
f6
==
'
N
one
'
)
{
var
path_img
=
"
static/img/image_null.jpg
"
var
path_img
=
"
static/img/image_null.jpg
"
}
else
{
}
else
{
var
path_img
=
`"static/image/jalan/`
+
feature
.
properties
.
f6
+
`"`
var
path_img
=
`"static/image/jalan/`
+
feature
.
properties
.
f6
+
`"`
...
...
templates/includes/modal.html
View file @
1dc705f3
...
@@ -126,6 +126,7 @@
...
@@ -126,6 +126,7 @@
<div
class=
"modal-body"
style=
"max-height: 450px;overflow-y: auto;"
>
<div
class=
"modal-body"
style=
"max-height: 450px;overflow-y: auto;"
>
<div
class=
"tab-pane has-padding"
id=
"panel-tab2"
>
<div
class=
"tab-pane has-padding"
id=
"panel-tab2"
>
<div
class=
"tab-pane"
id=
"bottom-justified-data"
>
<div
class=
"tab-pane"
id=
"bottom-justified-data"
>
<input
type=
"text"
name=
"idjalan"
id=
"idjalan"
class=
"form-control hidden"
value=
""
>
<div
class=
"tabbable"
>
<div
class=
"tabbable"
>
<ul
class=
"nav nav-tabs nav-tabs-bottom nav-justified"
>
<ul
class=
"nav nav-tabs nav-tabs-bottom nav-justified"
>
...
@@ -140,7 +141,7 @@
...
@@ -140,7 +141,7 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-lg-2 control-label"
style=
"margin-top:10px"
>
Image
</label>
<label
class=
"col-lg-2 control-label"
style=
"margin-top:10px"
>
Image
</label>
<div
class=
"col-lg-9"
style=
"margin-top:10px"
>
<div
class=
"col-lg-9"
style=
"margin-top:10px"
>
<input
type=
"file"
id=
"img
bangun
an"
name=
"images[]"
multiple
accept=
"image/jpg,image/png,image/jpeg,image/gif"
>
<input
type=
"file"
id=
"img
jal
an"
name=
"images[]"
multiple
accept=
"image/jpg,image/png,image/jpeg,image/gif"
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -149,8 +150,8 @@
...
@@ -149,8 +150,8 @@
<div
class=
"row"
style=
"height: 337px;"
>
<div
class=
"row"
style=
"height: 337px;"
>
<input
type=
"text"
class=
"hidden"
name=
"coordinate
bangunan"
id=
"coordinatebangun
an"
value=
""
>
<input
type=
"text"
class=
"hidden"
name=
"coordinate
jalan"
id=
"coordinatejal
an"
value=
""
>
<input
type=
"text"
name=
"id
bangunan"
id=
"idbangun
an"
class=
"form-control hidden"
value=
""
disable
>
<input
type=
"text"
name=
"id
jalan"
id=
"idjal
an"
class=
"form-control hidden"
value=
""
disable
>
<table
style=
"margin-left: 50px;
<table
style=
"margin-left: 50px;
width: 100vh;"
>
width: 100vh;"
>
<tr>
<tr>
...
@@ -199,7 +200,7 @@
...
@@ -199,7 +200,7 @@
<div
class=
"modal-footer "
>
<div
class=
"modal-footer "
>
<button
type=
"button"
class=
"btn btn-link"
onclick=
"destroyfade()"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-link"
onclick=
"destroyfade()"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
id=
"btnsave
bangun
an"
class=
"btn btn-info"
>
Save changes
</button>
<button
type=
"button"
id=
"btnsave
jal
an"
class=
"btn btn-info"
>
Save changes
</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -471,7 +472,7 @@
...
@@ -471,7 +472,7 @@
<div
class=
"row"
style=
"margin-top: 15px;"
>
<div
class=
"row"
style=
"margin-top: 15px;"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-lg-3 control-label lbl-top"
style=
"margin-top: 15px;"
>
Tipe
Point
</label>
<label
class=
"col-lg-3 control-label lbl-top"
style=
"margin-top: 15px;"
>
Jenis
Point
</label>
<div
class=
"col-lg-9"
>
<div
class=
"col-lg-9"
>
<select
style=
"border-bottom: 1px solid rgb(83, 83, 83) !important;"
id=
"tipe_point"
data-placeholder=
"select point.."
class=
"select-size-md"
>
<select
style=
"border-bottom: 1px solid rgb(83, 83, 83) !important;"
id=
"tipe_point"
data-placeholder=
"select point.."
class=
"select-size-md"
>
<option
value=
"null"
selected
disabled
>
-- Pilih Jenis Point --
</option>
<option
value=
"null"
selected
disabled
>
-- Pilih Jenis Point --
</option>
...
@@ -494,9 +495,11 @@
...
@@ -494,9 +495,11 @@
<div
class=
"row"
style=
"margin-top: 15px;"
>
<div
class=
"row"
style=
"margin-top: 15px;"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-lg-3 control-label lbl-top"
style=
"margin-top: 15px;"
>
Informasi Bangunan
</label>
<label
class=
"col-lg-3 control-label lbl-top"
style=
"margin-top: 15px;"
>
Tipe Point
</label>
<div
class=
"col-lg-9"
>
<div
class=
"col-lg-9"
>
<input
id=
"info_create_point"
type=
"text"
class=
"form-control"
value=
""
placeholder=
"Rumah/Gedung/Ruko/Pabrik/dsb"
required
>
<select
style=
"border-bottom: 1px solid rgb(83, 83, 83) !important;width: 220px;"
id=
"tipe_point_2"
data-placeholder=
"select point.."
class=
"select-size-md"
>
<option
value=
"null"
selected
disabled
>
-- Pilih Tipe Point --
</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -578,3 +581,32 @@
...
@@ -578,3 +581,32 @@
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$
(
"
#tipe_point
"
).
change
(
function
()
{
var
tipe
=
$
(
this
).
val
();
$
.
ajax
({
url
:
"
{% url 'api:change-tipe' %}
"
,
data
:
{
'
tipe
'
:
tipe
},
dataType
:
'
json
'
,
success
:
function
(
data
)
{
console
.
log
(
data
)
var
data_all_kab
=
[]
for
(
var
i
=
0
;
i
<
data
[
'
result
'
].
length
;
i
++
)
{
var
data_k
=
data
[
'
result
'
][
i
][
0
];
console
.
log
(
data_k
)
var
data_kab
=
`<option value="`
+
data_k
+
`">`
+
data_k
+
`</option>`
;
data_all_kab
.
push
(
data_kab
)
};
$
(
'
#tipe_point_2
'
).
html
(
`<option value="null" selected disabled>-- Pilih Tipe Point --</option>`
+
data_all_kab
);
}
});
});
</script>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment