Memperbaiki penamaan folder dan menambahkan index.html sebagai landing page
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
$conn = new mysqli("localhost", "root", "", "webgis"); // UBAH DB
|
||||
|
||||
$sql = "SELECT * FROM jalan_polyline";
|
||||
$result = $conn->query($sql);
|
||||
$data_jalan = array();
|
||||
|
||||
if ($result->num_rows > 0) {
|
||||
while($row = $result->fetch_assoc()) {
|
||||
// Parse string geojson menjadi object agar mudah dibaca Javascript
|
||||
$row['geojson'] = json_decode($row['geojson']);
|
||||
$data_jalan[] = $row;
|
||||
}
|
||||
}
|
||||
echo json_encode($data_jalan);
|
||||
$conn->close();
|
||||
?>
|
||||
Reference in New Issue
Block a user