Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let map = L.map('map').setView([-6.888185, 107.610022 ], 18);
- let xhr = new XMLHttpRequest();
- xhr.open('GET', 'data.geojson'); //sementara gini dulu karena cors mu msh error, ntar si data.geojson ganti make url api mu
- xhr.setRequestHeader('Content-Type', 'application/json');
- xhr.onload = function() {
- if (xhr.status === 200) {
- L.geoJSON(JSON.parse(xhr.responseText), {
- style: {
- "color": "#ff7800",
- "weight": 5,
- "opacity": 0.65
- },
- }).addTo(map);
- }
- };
- xhr.send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement