Skip to content

stefanocudini/leaflet-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaflet Control Loader

Simple control to show a gif loader to the center of the map

demo:

opengeo.tech/maps/leaflet-loader

Image

example of usage with jquery ajax

...
const controlLoader = L.control.loader().addTo(map);
$.ajaxSetup({
 beforeSend: e => {
    controlLoader.show()
 },
 complete: e => {
    controlLoader.hide()
 }
});
const geoLayer = L.geoJson([]).addTo(map);

$.getJSON(`mygeojson.json`, geoj => {

	geoLayer.addData(geoj);

});

About

Simple control to show a gif loader to the center of the map

Resources

Stars

Watchers

Forks

Packages

No packages published