makinacorpus/Leaflet.Spin

Name: Leaflet.Spin

Owner: Makina Corpus

Description: Show a spinner on the map using Spin.js

Created: 2013-03-04 14:49:38.0

Updated: 2017-12-29 12:10:45.0

Pushed: 2016-11-30 13:19:38.0

Homepage: http://makinacorpus.github.io/Leaflet.Spin/

Size: 855

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Leaflet.Spin

Shows a nice spin cursor on the map. See online demo.

This plugin requires Spin.js.

Install
NPM
install leaflet-spin
Bower
r install leaflet-spin
Manually

Download the latest release and include it in your app

Usage

This plugin can be loaded with AMD/CommonJS.

spin(true);  // on

spin(false);  // off
Spin.js options

You can control apparence of wheel by passing options on first spin() call.

spin(true, {lines: 13, length: 40});

More details on available options

With AJAX / JQuery
spin(true);
ax({url: 'http://server/api/'})
e(function() {
p.spin(false);

or(function () {
p.spin(false);

Using events:

layer = L.geoJson(null).addTo(map);

r.fire('data:loading');
tJSON('http://server/path.geojson', function (data) {
layer.fire('data:loaded');
layer.addData(data);

With Leaflet.AJAX
layer = L.geoJson.ajax();
r.addUrl('http://server/path.geojson');
Development

You can use example folder for testing.

run release   # minify js and copy leaflet.spin.min.js in example folder
run deploy    # deploy to gh-pages
Changelog
1.1.0

Update export and extend system

1.0.0

Update structure with official Leaflet plugin rules

0.1.1

Update bower dependencies

0.1.0

Initial version

Authors

Makina Corpus


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.