// CENTERED VIEW DAN ZOOM LEVEL var map = L.map('map',{zoomControl: false}).setView([-0.789275,122.921327], 5); var zoomHome = L.Control.zoomHome({position: 'topleft'}); zoomHome.addTo(map); L.control.scale({imperial: false}).addTo(map); // ------------------- VECTOR LAYER---------------------------- //LAYER-MASYARAKATADAT var layer_MADAT = new L.GeoJSON.AJAX("layer/request_masyarakatadat.php",{ pointToLayer: function(feature, latlng){ return new L.CircleMarker(latlng, {radius: 7, fillColor:"#ff0000", color:"null", fillOpacity: 0.6}); }, onEachFeature: function(feature, layer){ layer.bindPopup("

" + "" + "Komunitas" + "" + "
" + "" + "" + feature.properties.komunitas + ""+ "" + "

" + "

" + "" + "Desa" + "" + "
" + "" + "" + feature.properties.desa + ""+ "" + "

" + "

" + "" + "Kecamatan" + "" + "
" + "" + "" + feature.properties.kecamatan + ""+ "" + "

" + "

" + "" + "Kabupaten" + "" + "
" + "" + "" + feature.properties.kabupaten + ""+ "" + "

" + "

" + "" + "Provinsi" + "" + "
" + "" + "" + feature.properties.provinsi + ""+ "" +"

" + "

" + "" + "Luas" + "" + "
" + "" + "" + feature.properties.luas + " Hektare" + ""+ "" +"

" ); } }).addTo(map); //LAYER-TEMATIK var layer_hsa = new L.GeoJSON.AJAX("layer/geojson/hutan_sa.geojson",{ // sekarang perintahnya diawali dengan variabel style: function(feature){ var fillColor = "#ffd700"; // ini style yang akan digunakan return { color: "#999", dashArray: '3', weight: 0, fillColor: fillColor, fillOpacity: 1 }; // style border sertaa transparansi }, onEachFeature: function(feature, layer){ layer.bindPopup("
" + feature.properties.fungsi + "
"), // popup yang akan ditampilkan diambil dari filed kab_kot that = this; // perintah agar menghasilkan efek hover pada objek layer layer.on('mouseover', function (e) { this.setStyle({ weight: 2, color: '#72152b', dashArray: '', fillOpacity: 0.8 }); if (!L.Browser.ie && !L.Browser.opera) { layer.bringToFront(); } info.update(layer.feature.properties); }); layer.on('mouseout', function (e) { layer_hsa.resetStyle(e.target); // isi dengan nama variabel dari layer info.update(); }); } }); //LAYER-HGU //LAYER KAWASAN HUTAN //LAYER CONTROL var baseLayers = { 'Esri WorldImagery': L.tileLayer.provider('Esri.WorldImagery').addTo(map) }; // membuat pilihan untuk menampilkan layer var overlays = { "Perizinan": { "HSA": layer_hsa, "Masyarakat Adat": layer_MADAT } }; var options = { exclusiveGroups: [null] }; L.control.groupedLayers(null, overlays, options).addTo(map); loadingControl: true