Code Monkey home page Code Monkey logo

leaflet.spin's Introduction

Leaflet.Spin

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

This plugin requires Spin.js.

Install

NPM

npm install leaflet-spin

Manually

Download the latest release and include it in your app

Usage

This plugin can be loaded with AMD/CommonJS.

map.spin(true);  // on
...
map.spin(false);  // off

Spin.js options

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

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

More details on available options...

With AJAX / JQuery

map.spin(true);
$.ajax({url: 'http://server/api/'})
.done(function() {
  map.spin(false);
})
.error(function () {
  map.spin(false);
});

Using events:

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

layer.fire('data:loading');
$.getJSON('http://server/path.geojson', function (data) {
    layer.fire('data:loaded');
    layer.addData(data);
});
var layer = L.geoJson.ajax();
layer.addUrl('http://server/path.geojson');

Development

You can use example folder for testing.

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

Changelog

1.1.2

Should work with all 0.x and 1.x versions of leaflet

1.1.1

Add the dependency to spin.js in the module definition

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

leaflet.spin's People

Contributors

leplatrem avatar sbats avatar fredericbonifas avatar flibbertigibbet avatar lgeorget avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.