Answer the question
In order to leave comments, you need to log in
How to add custom controls to a map in leaflet.js?
Good afternoon everyone. The essence of the question -
how can you add your controls to the map and make them clickable?
It follows from the documentation that any controls are recommended to be added via L.control.
ok, I'm writing
// Кнопка центра
let center = L.control({
position: 'topright'
});
center.onAdd = function(map) {
let center = L.DomUtil.create('div', 'map-control-button center-button');
return center;
};
center.addTo(map);
map.setView([51.505, -0.09]);
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