Commit 6e69280d authored by Muhamad's avatar Muhamad

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

parents 6075f684 2c448ef9
...@@ -169,6 +169,7 @@ ...@@ -169,6 +169,7 @@
<li><input type="hidden" value="bangunan" /><a href="#"><i class="icon-home4 text-muted text-size-base" style="color: #5A9AFB;"></i> Bangunan</a></li> <li><input type="hidden" value="bangunan" /><a href="#"><i class="icon-home4 text-muted text-size-base" style="color: #5A9AFB;"></i> Bangunan</a></li>
<li><input type="hidden" value="jalan" /><a href="#"><i class="icon-git-branch text-muted text-size-base" style="color: #5A9AFB;"></i> Jalan</a></li> <li><input type="hidden" value="jalan" /><a href="#"><i class="icon-git-branch text-muted text-size-base" style="color: #5A9AFB;"></i> Jalan</a></li>
<li><input type="hidden" value="point" /><a href="#"><i class="icon-location4 text-muted text-size-base" style="color: #5A9AFB;"></i> Point</a></li> <li><input type="hidden" value="point" /><a href="#"><i class="icon-location4 text-muted text-size-base" style="color: #5A9AFB;"></i> Point</a></li>
<li><input type="hidden" value="koordinat" /><a href="#"><i class="icon-location4 text-muted text-size-base" style="color: #5A9AFB;"></i> Koordinat</a></li>
<li><input type="hidden" value="reset" /><a href="#"><i class="icon-reset text-muted text-size-base" style="color: #5A9AFB;"></i> Reset</a></li> <li><input type="hidden" value="reset" /><a href="#"><i class="icon-reset text-muted text-size-base" style="color: #5A9AFB;"></i> Reset</a></li>
</ul> </ul>
</div> </div>
...@@ -454,12 +455,19 @@ ...@@ -454,12 +455,19 @@
dar = tes dar = tes
if (dar == ' Point') { if (dar == ' Point') {
$("#pilihcari").html('<i class="icon-location4 text-muted text-size-base" style="color: #5A9AFB;"></i>') $("#pilihcari").html('<i class="icon-location4 text-muted text-size-base" style="color: #5A9AFB;"></i>')
$("#input_search").attr('placeholder', 'Search...')
} else if (dar == ' Bangunan') { } else if (dar == ' Bangunan') {
$("#pilihcari").html('<i class="icon-home4 text-muted text-size-base" style="color: #5A9AFB;"></i>') $("#pilihcari").html('<i class="icon-home4 text-muted text-size-base" style="color: #5A9AFB;"></i>')
$("#input_search").attr('placeholder', 'Search...')
} else if (dar == ' Jalan') { } else if (dar == ' Jalan') {
$("#pilihcari").html('<i class="icon-git-branch text-muted text-size-base" style="color: #5A9AFB;"></i>') $("#pilihcari").html('<i class="icon-git-branch text-muted text-size-base" style="color: #5A9AFB;"></i>')
$("#input_search").attr('placeholder', 'Search...')
} else if (dar == ' Koordinat'){
$("#pilihcari").html('<i class="icon-location4 text-muted text-size-base" style="color: #5A9AFB;"></i>')
$("#input_search").attr('placeholder', '-4.04663, 103.915915')
} else if (dar == ' Reset') { } else if (dar == ' Reset') {
$("#pilihcari").html('') $("#pilihcari").html('')
$("#input_search").attr('placeholder', 'Search...')
} }
}); });
...@@ -539,7 +547,7 @@ ...@@ -539,7 +547,7 @@
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 dapoin = [data[0][0]['geometry']['coordinates'][1], data[0][0]['geometry']['coordinates'][0]] var dapoin = [data[0][0]['geometry']['coordinates'][1], data[0][0]['geometry']['coordinates'][0]]
//console.log(data[0]) console.log(dapoin)
// map.setView([data[0]['geometry']['coordinates'][0][0][0][1], data[0]['geometry']['coordinates'][0][0][0][0]], 19); // map.setView([data[0]['geometry']['coordinates'][0][0][0][1], data[0]['geometry']['coordinates'][0][0][0][0]], 19);
// var result_point = JSON.parse("" + data + "") // var result_point = JSON.parse("" + data + "")
// //console.log(result_point) // //console.log(result_point)
...@@ -2533,6 +2541,57 @@ ...@@ -2533,6 +2541,57 @@
}); });
} }
}); });
} else if (dar == ' Koordinat'){
var geocodeService = L.esri.Geocoding.geocodeService();
var geocoderNominatim = new L.Control.Geocoder.Nominatim();
var str = $('#input_search').val()
var dapoin = str.split(',').map(Number);
console.log(dapoin)
var geo_koor = L.marker(dapoin)
conten = `
<div id="bottom-justified-data" style="text-align: center;">
<div >
<div style="font-family: Google Sans,Roboto,Arial,sans-serif;
letter-spacing: 0">
<p>
` + str + `
</p>
</div>
</div>
</div>
`;
geo_koor.bindTooltip(conten, {
permanent: true,
className: "my-label",
direction: 'top',
offset: [0, -25]
});
geo_koor.addTo(map);
map.setView(dapoin, 19);
$(document).on("click", "#btn_search_spes", function() {
geo_koor.remove();
});
$('#search_spes li a').on('click', function() {
$('#input_search').val(null)
tes = $(this).text();
dar = tes
if (dar == ' Reset') {
// geo_koor.clearLayers();
geo_koor.remove();
// map.eachLayer((geo_koor) => {
// layer.remove();
// });
}
});
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment