Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leaflet-spin

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-spin

Show a spinner on a Leaflet map using Spin.js

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
decreased by-24.36%
Maintainers
5
Weekly downloads
 
Created
Source

Leaflet.Spin

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

This plugin requires Spin.js.

Install

NPM

npm install leaflet-spin

Bower

bower 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);
});

With Leaflet.AJAX

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.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

Keywords

FAQs

Package last updated on 11 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc