Answer the question
In order to leave comments, you need to log in
Offset for initial coordinates?
How can I make the length and width count from the center of the map, and not from the top left corner?
var map = L.map('mapElement', {
crs: L.CRS.Simple,
minZoom: 0,
maxZoom: 0,
continuousWorld: false,
});
map.setView([-128, 128], 0);
L.tileLayer('/img/map/{z}/{x}/{y}.jpg', {
attribution: 'no attribution',
}).addTo(map);
map.on('click', (e) => {
new L.marker({lat: 0, lng: 0}).addTo(map); // ставит в верхнем левом краю
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question