];
let map = L.map('map', {
minZoom: 0,
maxZoom: 18
}).setView([lat, lon], zoom);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '©
OpenStreetMap contributors'
}).addTo(map);
let markers = L.markerClusterGroup();
var redIcon = L.icon({
iconUrl: 'pin/red.png',
iconSize: [25, 44], // size of the icon
iconAnchor: [12, 50], // point of the icon which will correspond to marker's location
popupAnchor: [1, -36] // point from which the popup should open relative to the iconAnchor
});
for (let i = 0; i < busPoints.length; i++) {
let a = busPoints[i];
let title = a[2];
let napis = a[3];
let marker = L.marker(new L.LatLng(a[0], a[1]), {icon: redIcon}, {
title
});
marker.bindPopup(title);
marker.bindTooltip((napis), {permanent: true, direction: 'center', className: 'myCSSClass'});
markers.addLayer(marker);
}
map.addLayer(markers);