-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leaflet 1.x Support. #22
base: master
Are you sure you want to change the base?
Conversation
@@ -3,8 +3,8 @@ | |||
<head> | |||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |||
<title>Leaflet.Spin</title> | |||
<link rel="stylesheet" href="leaflet/dist/leaflet.css"> | |||
<script src="leaflet/dist/leaflet.js" charset="utf-8"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As example should be working without node_modules
available (to work in Github Page, you can't use Leaflet from dependencies.
So the solution is, for the example page, calling Leaflet from a CDN (as I've done here: makinacorpus/Leaflet.MeasureControl@fac37b2).
@@ -1,2 +1,2 @@ | |||
!function(n,i){"function"==typeof define&&define.amd?define(["leaflet"],function(i){n(i)}):"object"==typeof exports?module.exports=function(i){return void 0===i&&(i=require("leaflet")),n(i),i}:"undefined"!=typeof i&&i.L&&n(i.L)}(function(n){var i={spin:function(n,i){n?(this._spinner||(this._spinner=new Spinner(i).spin(this._container),this._spinning=0),this._spinning++):(this._spinning--,this._spinning<=0&&this._spinner&&(this._spinner.stop(),this._spinner=null))}},t=function(){this.on("layeradd",function(n){n.layer.loading&&this.spin(!0),"function"==typeof n.layer.on&&(n.layer.on("data:loading",function(){this.spin(!0)},this),n.layer.on("data:loaded",function(){this.spin(!1)},this))},this),this.on("layerremove",function(n){n.layer.loading&&this.spin(!1),"function"==typeof n.layer.on&&(n.layer.off("data:loaded"),n.layer.off("data:loading"))},this)} | |||
!function(n,i){"function"==typeof define&&define.amd?define(["leaflet"],function(i){n(i)}):"object"==typeof exports?module.exports=function(i){return void 0===i&&(i=require("leaflet")),n(i),i}:void 0!==i&&i.L&&n(i.L)}(function(n){var i={spin:function(n,i){n?(this._spinner||(this._spinner=new Spinner(i).spin(this._container),this._spinning=0),this._spinning++):--this._spinning<=0&&this._spinner&&(this._spinner.stop(),this._spinner=null)}},t=function(){this.on("layeradd",function(n){n.layer.loading&&this.spin(!0),"function"==typeof n.layer.on&&(n.layer.on("data:loading",function(){this.spin(!0)},this),n.layer.on("data:loaded",function(){this.spin(!1)},this))},this),this.on("layerremove",function(n){n.layer.loading&&this.spin(!1),"function"==typeof n.layer.on&&(n.layer.off("data:loaded"),n.layer.off("data:loading"))},this)} | |||
n.Map.include(i),n.Map.addInitHook(t)},window) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yo do not need to include leaflet.spin.min.js
twice in sources. A symlink in example
, linking the file from parent directory should make it.
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "leaflet-spin", | |||
"version": "1.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we try to follow semver recommendation, the kind of change in the PR may be at least a minor upgrade (not just a patch upgrade) because it's not just a patch of bugfix.
Updated npm dependencies to work with Leaflet 1.x. This should address #18