https://github.com/stefanocudini/leaflet-loader
Simple control to show a gif loader to the center of the map
https://github.com/stefanocudini/leaflet-loader
Last synced: 13 days ago
JSON representation
Simple control to show a gif loader to the center of the map
- Host: GitHub
- URL: https://github.com/stefanocudini/leaflet-loader
- Owner: stefanocudini
- Created: 2014-05-01T18:09:37.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2023-04-25T01:14:15.000Z (about 2 years ago)
- Last Synced: 2025-03-28T17:47:39.700Z (about 1 month ago)
- Language: HTML
- Homepage: https://opengeo.tech/maps/leaflet-loader/
- Size: 79.1 KB
- Stars: 17
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Leaflet Control Loader
==============Simple control to show a gif loader to the center of the map
**demo:**
[opengeo.tech/maps/leaflet-loader](https://opengeo.tech/maps/leaflet-loader/)

## example of usage with jquery ajax
```javascript
...
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);
});
```