TIF_E41201448/assets/js/app-point.js

38 lines
964 B
JavaScript

var map = L.map("map").setView([0.854198761767967, 99.57166550126928], 12);
var basemap = L.tileLayer(
"https://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
{
maxZoom: 20,
subdomains: ["mt0", "mt1", "mt2", "mt3"],
attribution: 'Google | <a href="#">unsorry@2020</a>',
}
);
basemap.addTo(map);
var titikkecamatan = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.divIcon({
className: "leaflet-mouse-marker",
}),
interactive: false,
});
},
onEachFeature: function (feature, layer) {
var content = layer.feature.properties.kecamatan.toString();
layer.bindTooltip(content, {
direction: "center",
permanent: true,
className: "styleLabelkecamatan",
});
},
});
$.getJSON(
"http://localhost/Kmeans2/assets/data/titikkecamatan.geojson",
function (data) {
titikkecamatan.addData(data);
map.addLayer(titikkecamatan);
}
);