-
Notifications
You must be signed in to change notification settings - Fork 0
/
leaflet.ajax.min.js
1 lines (1 loc) · 7.88 KB
/
leaflet.ajax.min.js
1
!function e(t,n,r){function a(i,s){if(!n[i]){if(!t[i]){var l="function"==typeof require&&require;if(!s&&l)return l(i,!0);if(o)return o(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[i]={exports:{}};t[i][0].call(c.exports,function(e){var n=t[i][1][e];return a(n?n:e)},c,c.exports,e,t,n,r)}return n[i].exports}for(var o="function"==typeof require&&require,i=0;i<r.length;i++)a(r[i]);return a}({1:[function(e,t,n){"use strict";function r(){}function a(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=j,this.queue=[],this.outcome=void 0,e!==r&&l(this,e)}function o(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function i(e,t,n){p(function(){var r;try{r=t(n)}catch(a){return v.reject(e,a)}r===e?v.reject(e,new TypeError("Cannot resolve promise with itself")):v.resolve(e,r)})}function s(e){var t=e&&e.then;return e&&"object"==typeof e&&"function"==typeof t?function(){t.apply(e,arguments)}:void 0}function l(e,t){function n(t){o||(o=!0,v.reject(e,t))}function r(t){o||(o=!0,v.resolve(e,t))}function a(){t(r,n)}var o=!1,i=u(a);"error"===i.status&&n(i.value)}function u(e,t){var n={};try{n.value=e(t),n.status="success"}catch(r){n.status="error",n.value=r}return n}function c(e){return e instanceof this?e:v.resolve(new this(r),e)}function f(e){var t=new this(r);return v.reject(t,e)}function d(e){function t(e,t){function r(e){i[t]=e,++s!==a||o||(o=!0,v.resolve(u,i))}n.resolve(e).then(r,function(e){o||(o=!0,v.reject(u,e))})}var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var a=e.length,o=!1;if(!a)return this.resolve([]);for(var i=new Array(a),s=0,l=-1,u=new this(r);++l<a;)t(e[l],l);return u}function h(e){function t(e){n.resolve(e).then(function(e){o||(o=!0,v.resolve(s,e))},function(e){o||(o=!0,v.reject(s,e))})}var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var a=e.length,o=!1;if(!a)return this.resolve([]);for(var i=-1,s=new this(r);++i<a;)t(e[i]);return s}var p=e("immediate"),v={},y=["REJECTED"],m=["FULFILLED"],j=["PENDING"];t.exports=n=a,a.prototype["catch"]=function(e){return this.then(null,e)},a.prototype.then=function(e,t){if("function"!=typeof e&&this.state===m||"function"!=typeof t&&this.state===y)return this;var n=new this.constructor(r);if(this.state!==j){var a=this.state===m?e:t;i(n,a,this.outcome)}else this.queue.push(new o(n,e,t));return n},o.prototype.callFulfilled=function(e){v.resolve(this.promise,e)},o.prototype.otherCallFulfilled=function(e){i(this.promise,this.onFulfilled,e)},o.prototype.callRejected=function(e){v.reject(this.promise,e)},o.prototype.otherCallRejected=function(e){i(this.promise,this.onRejected,e)},v.resolve=function(e,t){var n=u(s,t);if("error"===n.status)return v.reject(e,n.value);var r=n.value;if(r)l(e,r);else{e.state=m,e.outcome=t;for(var a=-1,o=e.queue.length;++a<o;)e.queue[a].callFulfilled(t)}return e},v.reject=function(e,t){e.state=y,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},n.resolve=c,n.reject=f,n.all=d,n.race=h},{immediate:2}],2:[function(e,t,n){(function(e){"use strict";function n(){c=!0;for(var e,t,n=f.length;n;){for(t=f,f=[],e=-1;++e<n;)t[e]();n=f.length}c=!1}function r(e){1!==f.push(e)||c||a()}var a,o=e.MutationObserver||e.WebKitMutationObserver;if(o){var i=0,s=new o(n),l=e.document.createTextNode("");s.observe(l,{characterData:!0}),a=function(){l.data=i=++i%2}}else if(e.setImmediate||"undefined"==typeof e.MessageChannel)a="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){n(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(n,0)};else{var u=new e.MessageChannel;u.port1.onmessage=n,a=function(){u.port2.postMessage(0)}}var c,f=[];t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,t,n){(function(n){"use strict";var r=e("./jsonp"),a=e("lie");t.exports=function(e,t){if(t=t||{},t.jsonp)return r(e,t);var o,i,s=new a(function(r,a){i=a,void 0===n.XMLHttpRequest&&a("XMLHttpRequest is not supported");var s;o=new n.XMLHttpRequest,o.open("GET",e),o.onreadystatechange=function(){4===o.readyState&&(o.status<400&&t.local||200===o.status?(n.JSON?s=JSON.parse(o.responseText):a(new Error("JSON is not supported")),r(s)):a(o.status?o.statusText:"Attempted cross origin request without CORS enabled"))},o.send()});return s["catch"](function(e){return o.abort(),e}),s.abort=i,s}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./jsonp":5,lie:1}],4:[function(e,t,n){(function(t){"use strict";var n=t.L||e("leaflet"),r=e("lie"),a=e("./ajax");n.GeoJSON.AJAX=n.GeoJSON.extend({defaultAJAXparams:{dataType:"json",callbackParam:"callback",local:!1,middleware:function(e){return e}},initialize:function(e,t){this.urls=[],e&&("string"==typeof e?this.urls.push(e):"function"==typeof e.pop?this.urls=this.urls.concat(e):(t=e,e=void 0));var a=n.Util.extend({},this.defaultAJAXparams);for(var o in t)this.defaultAJAXparams.hasOwnProperty(o)&&(a[o]=t[o]);this.ajaxParams=a,this._layers={},n.Util.setOptions(this,t),this.on("data:loaded",function(){this.filter&&this.refilter(this.filter)},this);var i=this;this.urls.length>0&&new r(function(e){e()}).then(function(){i.addUrl()})},clearLayers:function(){return this.urls=[],n.GeoJSON.prototype.clearLayers.call(this),this},addUrl:function(e){var t=this;e&&("string"==typeof e?t.urls.push(e):"function"==typeof e.pop&&(t.urls=t.urls.concat(e)));var r=t.urls.length,o=0;t.fire("data:loading"),t.urls.forEach(function(e){"json"===t.ajaxParams.dataType.toLowerCase()?a(e,t.ajaxParams).then(function(e){var n=t.ajaxParams.middleware(e);t.addData(n),t.fire("data:progress",n)},function(e){t.fire("data:progress",{error:e})}):"jsonp"===t.ajaxParams.dataType.toLowerCase()&&n.Util.jsonp(e,t.ajaxParams).then(function(e){var n=t.ajaxParams.middleware(e);t.addData(n),t.fire("data:progress",n)},function(e){t.fire("data:progress",{error:e})})}),t.on("data:progress",function(){++o===r&&t.fire("data:loaded")})},refresh:function(e){e=e||this.urls,this.clearLayers(),this.addUrl(e)},refilter:function(e){"function"!=typeof e?(this.filter=!1,this.eachLayer(function(e){e.setStyle({stroke:!0,clickable:!0})})):(this.filter=e,this.eachLayer(function(t){e(t.feature)?t.setStyle({stroke:!0,clickable:!0}):t.setStyle({stroke:!1,clickable:!1})}))}}),n.Util.Promise=r,n.Util.ajax=a,n.Util.jsonp=e("./jsonp"),n.geoJson.ajax=function(e,t){return new n.GeoJSON.AJAX(e,t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./ajax":3,"./jsonp":5,leaflet:void 0,lie:1}],5:[function(e,t,n){(function(n){"use strict";var r=n.L||e("leaflet"),a=e("lie");t.exports=function(e,t){t=t||{};var o,i,s,l,u=document.getElementsByTagName("head")[0],c=r.DomUtil.create("script","",u),f=new a(function(r,a){l=a;var f=t.cbParam||"callback";t.callbackName?o=t.callbackName:(s="_"+(""+Math.random()).slice(2),o="_leafletJSONPcallbacks."+s),c.type="text/javascript",s&&(n._leafletJSONPcallbacks||(n._leafletJSONPcallbacks={length:0}),n._leafletJSONPcallbacks.length++,n._leafletJSONPcallbacks[s]=function(e){u.removeChild(c),delete n._leafletJSONPcallbacks[s],n._leafletJSONPcallbacks.length--,n._leafletJSONPcallbacks.length||delete n._leafletJSONPcallbacks,r(e)}),i=-1===e.indexOf("?")?e+"?"+f+"="+o:e+"&"+f+"="+o,c.src=i}).then(null,function(e){return u.removeChild(c),delete r.Util.ajax.cb[s],e});return f.abort=l,f}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{leaflet:void 0,lie:1}]},{},[4]);