-1

Here's my code:

<!DOCTYPE html>
<html>
<?php 
    session_start();
    if($_SESSION['status']!="login"){
        header("location:../index.php?pesan=belum_login");
    }
    ?>

    <h4>Selamat datang, <?php echo $_SESSION['nama']; ?>!</h4>

    <br/>
    <br/>

    <a href="logout.php">LOGOUT</a>

<head>
    <meta charset="utf-8" />
    <title>Map Panel & Lampu</title>
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" />
    <style>
        body {
            margin: 0;
            padding: 0;
        }

        #map {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>

<body>
<?php $id=$_GET['id']; ?>
    <div id="map"></div>
<script src="leaflet-src.js"></script>
<script type="text/javascript" src="dist/leaflet.ajax.js"></script>
<script src="spin.js"></script>
<script src="leaflet.spin.js"></script>
      <script type="text/javascript">
      var m= L.map('map').setView([-5.1478036504745255,119.42012756104154], 13);

    var mopt = {
        url: 'https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1Ijoicnlhbjkzc3AiLCJhIjoiY2pkMDJxZ2xpMGxjYTJxbzRtd3EzZnRzcCJ9.WsRQpljGbYjxw7za2_cPtA', 
            maxZoom: 29,
        options: {attribution:' � <a href="#" target="_blank">#</a>'}
  };
var mq=L.tileLayer(mopt.url,mopt.options);

mq.addTo(m);

function popUp(f,l){
    var out = [];
    draggable: true
    if (f.properties){
        for(key in f.properties){
            out.push(key+": "+f.properties[key]);
        }
        l.bindPopup(out.join("<br />"));
    }
}

var icon1 = L.icon({
  iconUrl: 'images/markericonkh.png',
  iconSize: [11, 11],
  
});

var icon2 = L.icon({
  iconUrl: 'images/panel.png',
  iconSize: [20, 20],
 
});

var jsonTest1 = new L.GeoJSON.AJAX("geojson.php?idpanel=<?php echo $id; ?>",{
  pointToLayer: function(point, latlng) {
    return L.marker(latlng, {icon: icon1});
  },
  onEachFeature: popUp
.bindLabel('A sweet static label!', { noHide: true })
  }).addTo(m);

var jsonTest2 = new L.GeoJSON.AJAX("geojsonpl.php?idpanel=<?php echo $id; ?>",{
  pointToLayer: function(point, latlng) {
    return L.marker(latlng, {icon: icon2});
  },
  onEachFeature: popUp
.bindLabel('A sweet static label!', { noHide: true })
}).addTo(m);
</script>
</body>

</html>
3
  • Does your code work? If not, what unexpected behavior do you see from it?
    – PolyGeo
    Oct 11 at 7:09
  • 1
    Please edit your question and describe what is your question.
    – TomazicM
    Oct 11 at 7:20
  • Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works
    – Ian Turton
    Oct 14 at 5:53