var map;
var s_speed = 50;
var map_done = 0;

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("leaflet")):"function"==typeof define&&define.amd?define(["leaflet"],e):"object"==typeof exports?exports["leaflet-ant-path"]=e(require("leaflet")):t["leaflet-ant-path"]=e(t.L)}(window,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=59)}([function(t,e){t.exports="object"==typeof window&&window&&window.Math==Math?window:"object"==typeof self&&self&&self.Math==Math?self:Function("return this")()},function(e,n){e.exports=t},function(t,e,n){var r=n(4);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){var r=n(0),o=n(11).f,i=n(16),a=n(33),u=n(30),c=n(52),s=n(69);t.exports=function(t,e){var n,f,l,p,h,y=t.target,v=t.global,d=t.stat;if(n=v?r:d?r[y]||u(y,{}):(r[y]||{}).prototype)for(f in e){if(p=e[f],l=t.noTargetGet?(h=o(n,f))&&h.value:n[f],!s(v?f:y+(d?".":"#")+f,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;c(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),a(n,f,p,t)}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(20),o=n(7),i=n(55),a=n(8).f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});o(e,t)||a(e,t,{value:i.f(t)})}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(9),o=n(46),i=n(2),a=n(13),u=Object.defineProperty;e.f=r?u:function(t,e,n){if(i(t),e=a(e,!0),i(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(5)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(15)("wks"),o=n(31),i=n(0).Symbol,a=n(49);t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))}},function(t,e,n){var r=n(9),o=n(32),i=n(14),a=n(17),u=n(13),c=n(7),s=n(46),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=u(e,!0),s)try{return f(t,e)}catch(t){}if(c(t,e))return i(!o.f.call(t,e),t[e])}},function(t,e,n){t.exports=n(21)},function(t,e,n){var r=n(4);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(0),o=n(30),i=r["__core-js_shared__"]||o("__core-js_shared__",{});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.0.1",mode:n(48)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var r=n(8),o=n(14);t.exports=n(9)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(65),o=n(43);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(15)("keys"),o=n(31);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e){t.exports={}},function(t,e,n){t.exports=n(0)},function(t,e,n){var r=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(22),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";var n,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag",s="object"==typeof t,f=e.regeneratorRuntime;if(f)s&&(t.exports=f);else{(f=e.regeneratorRuntime=s?t.exports:{}).wrap=w;var l="suspendedStart",p="suspendedYield",h="executing",y="completed",v={},d={};d[a]=function(){return this};var m=Object.getPrototypeOf,g=m&&m(m(R([])));g&&g!==r&&o.call(g,a)&&(d=g);var b=j.prototype=x.prototype=Object.create(d);S.prototype=b.constructor=j,j.constructor=S,j[c]=S.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===S||"GeneratorFunction"===(e.displayName||e.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,j):(t.__proto__=j,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(b),t},f.awrap=function(t){return{__await:t}},_(L.prototype),L.prototype[u]=function(){return this},f.AsyncIterator=L,f.async=function(t,e,n,r){var o=new L(w(t,e,n,r));return f.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},_(b),b[c]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},f.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},f.values=R,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return u.type="throw",u.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:R(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function w(t,e,n,r){var o=e&&e.prototype instanceof x?e:x,i=Object.create(o.prototype),a=new A(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===h)throw new Error("Generator is already running");if(r===y){if("throw"===o)throw i;return T()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=P(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var c=O(t,e,n);if("normal"===c.type){if(r=n.done?y:p,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=y,n.method="throw",n.arg=c.arg)}}}(t,n,a),i}function O(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function x(){}function S(){}function j(){}function _(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(n,r){function i(){return new Promise(function(e,i){!function e(n,r,i,a){var u=O(t[n],t,r);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==typeof s&&o.call(s,"__await")?Promise.resolve(s.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(s).then(function(t){c.value=t,i(c)},function(t){return e("throw",t,i,a)})}a(u.arg)}(n,r,e,i)})}return e=e?e.then(i,i):i()}}function P(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,P(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=O(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function R(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=n,e.done=!0,e};return i.next=i}}return{next:T}}function T(){return{value:n,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},function(t,e,n){var r=n(24);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(26)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(25)(!1)).push([t.i,"@-webkit-keyframes leaflet-ant-path-animation {\n  from {\n    stroke-dashoffset: 100%; }\n  to {\n    stroke-dashoffset: 0%; } }\n\n@-moz-keyframes leaflet-ant-path-animation {\n  from {\n    stroke-dashoffset: 100%; }\n  to {\n    stroke-dashoffset: 0%; } }\n\n@-ms-keyframes leaflet-ant-path-animation {\n  from {\n    stroke-dashoffset: 100%; }\n  to {\n    stroke-dashoffset: 0%; } }\n\n@-o-keyframes leaflet-ant-path-animation {\n  from {\n    stroke-dashoffset: 100%; }\n  to {\n    stroke-dashoffset: 0%; } }\n\n@keyframes leaflet-ant-path-animation {\n  from {\n    stroke-dashoffset: 100%; }\n  to {\n    stroke-dashoffset: 0%; } }\n\npath.leaflet-ant-path {\n  fill: none;\n  -webkit-animation: linear infinite leaflet-ant-path-animation;\n  -moz-animation: linear infinite leaflet-ant-path-animation;\n  -ms-animation: linear infinite leaflet-ant-path-animation;\n  -o-animation: linear infinite leaflet-ant-path-animation;\n  animation: linear infinite leaflet-ant-path-animation; }\n  path.leaflet-ant-path__hardware-acceleration {\n    -webkit-transform: translateZ(0);\n    -moz-transform: translateZ(0);\n    -ms-transform: translateZ(0);\n    -o-transform: translateZ(0);\n    transform: translateZ(0); }\n  path.leaflet-ant-path__reverse {\n    -webkit-animation-direction: reverse;\n    -moz-animation-direction: reverse;\n    -ms-animation-direction: reverse;\n    -o-animation-direction: reverse;\n    animation-direction: reverse; }\n",""])},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(i).concat([o]).join("\n")}var a;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];null!=i&&(r[i]=!0)}for(o=0;o<t.length;o++){var a=t[o];null!=a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(t,e,n){var r,o,i={},a=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),u=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var r=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}}(),c=null,s=0,f=[],l=n(27);function p(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=i[r.id];if(o){o.refs++;for(var a=0;a<o.parts.length;a++)o.parts[a](r.parts[a]);for(;a<r.parts.length;a++)o.parts.push(g(r.parts[a],e))}else{var u=[];for(a=0;a<r.parts.length;a++)u.push(g(r.parts[a],e));i[r.id]={id:r.id,refs:1,parts:u}}}}function h(t,e){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],a=e.base?i[0]+e.base:i[0],u={css:i[1],media:i[2],sourceMap:i[3]};r[a]?r[a].parts.push(u):n.push(r[a]={id:a,parts:[u]})}return n}function y(t,e){var n=u(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=f[f.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),f.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=u(t.insertAt.before,n);n.insertBefore(e,o)}}function v(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=f.indexOf(t);e>=0&&f.splice(e,1)}function d(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return n.nc}();r&&(t.attrs.nonce=r)}return m(e,t.attrs),y(t,e),e}function m(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function g(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var a=s++;n=c||(c=d(e)),r=O.bind(null,n,a,!1),o=O.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",m(e,t.attrs),y(t,e),e}(e),r=function(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=l(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),u=t.href;t.href=URL.createObjectURL(a),u&&URL.revokeObjectURL(u)}.bind(null,n,e),o=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=d(e),r=function(t,e){var n=e.css,r=e.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){v(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return p(n,e),function(t){for(var r=[],o=0;o<n.length;o++){var a=n[o];(u=i[a.id]).refs--,r.push(u)}t&&p(h(t,e),e);for(o=0;o<r.length;o++){var u;if(0===(u=r[o]).refs){for(var c=0;c<u.parts.length;c++)u.parts[c]();delete i[u.id]}}}};var b,w=(b=[],function(t,e){return b[t]=e,b.filter(Boolean).join("\n")});function O(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=w(e,o);else{var i=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var o,i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},function(t,e,n){var r=n(29);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(0),o=n(16);t.exports=function(t,e){try{o(r,t,e)}catch(n){r[t]=e}return e}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},function(t,e,n){var r=n(0),o=n(16),i=n(7),a=n(30),u=n(50),c=n(51),s=c.get,f=c.enforce,l=String(u).split("toString");n(15)("inspectSource",function(t){return u.call(t)}),(t.exports=function(t,e,n,u){var c=!!u&&!!u.unsafe,s=!!u&&!!u.enumerable,p=!!u&&!!u.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),f(n).source=l.join("string"==typeof e?e:"")),t!==r?(c?!p&&t[e]&&(s=!0):delete t[e],s?t[e]=n:o(t,e,n)):s?t[e]=n:a(e,n)})(Function.prototype,"toString",function(){return"function"==typeof this&&s(this).source||u.call(this)})},function(t,e,n){var r=n(54),o=n(35).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(8).f,o=n(7),i=n(10)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){var r=n(54),o=n(35);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var r=n(7),o=n(42),i=n(18)("IE_PROTO"),a=n(57),u=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){"use strict";n.r(e);var r=n(1),o=n(12),i=n.n(o);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){h(t,e,n[e])})}return t}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var y={main:Symbol("main"),pulse:Symbol("pulse")},v=y.main,d=y.pulse,m=Symbol.species,g=Symbol.toStringTag,b=Symbol.iterator,w=function(t){function e(t){var n,o,i,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o=this,n=!(i=f(e).call(this))||"object"!==a(i)&&"function"!=typeof i?p(o):i,h(p(p(n)),v,null),h(p(p(n)),d,null),h(p(p(n)),"_map",null),h(p(p(n)),"_path",null),h(p(p(n)),"_animatedPathId",null),h(p(p(n)),"_animatedPathClass","leaflet-ant-path"),h(p(p(n)),"_reversePathClass","".concat(n._animatedPathClass,"__reverse")),h(p(p(n)),"_hardwareAccClass","hardware-acceleration"),h(p(p(n)),"_defaultOptions",{use:r.polyline,paused:!1,reverse:!1,hardwareAcceleration:!1,renderer:Object(r.svg)({pane:"overlayPane"}),delay:400,dashArray:[10,20],weight:5,opacity:.5,color:"#0000FF",pulseColor:"#FFFFFF"}),r.Util.setOptions(p(p(n)),c({},n._defaultOptions,u)),n._path=t,n._animatedPathId="ant-path-".concat((new Date).getTime()),n._mount(),n}var n,o,w;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(e,r["FeatureGroup"]),n=e,w=[{key:m,get:function(){return this}}],(o=[{key:"map",value:function(t){return new(0,this.constructor[Symbol.species])(this._path.map(t),c({},this.options))}},{key:b,value:i.a.mark(function t(){return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this._path,"t0",1);case 1:case"end":return t.stop()}},t,this)})},{key:"_processOptions",value:function(){var t=this.options,e=this._animatedPathClass,n=this._reversePathClass,r=this._hardwareAccClass,o=this._animatedPathId,i=t.reverse,a=t.hardwareAcceleration,u=c({},t),s=c({},t);return s.color=s.pulseColor||t.pulseColor,s.className=[e,o,i?n:"",a?"".concat(e,"__").concat(r):""].join(" "),delete u.dashArray,Array.isArray(s.dashArray)&&(s.dashArray=String(s.dashArray)),{pathOpts:u,pulseOpts:s}}},{key:"_mount",value:function(){var t=this._processOptions(),e=t.pathOpts,n=t.pulseOpts,r=this.options.use;this.addLayer(this[y.main]=r(this._path,e)),this.addLayer(this[y.pulse]=r(this._path,n))}},{key:"_calculateAnimationSpeed",value:function(){var t=this.options,e=this._map,n=this._animatedPathId;if(!t.paused&&e){var r=e.getZoom(),o=document.getElementsByClassName(n),i=1+t.delay/3/r+"s",a=["-webkit-","-moz-","-ms-","-o-",""].map(function(t){return"".concat(t,"animation-duration: ").concat(i)}).join(";");Array.from(o,function(t){t.style.cssText=a,t.setAttribute("data-animated","true")})}}},{key:"_pureReverse",value:function(){var t=this[y.pulse].getElement();t&&(this.options.reverse?t.classList.remove(this._reversePathClass):t.classList.add(this._reversePathClass))}},{key:"onAdd",value:function(t){return this._map=t,this._map.on("zoomend",this._calculateAnimationSpeed,this),this._mount(),this._calculateAnimationSpeed(),this}},{key:"onRemove",value:function(t){return this._map&&(this._map.off("zoomend",this._calculateAnimationSpeed,this),this._map=null),t&&t.removeLayer(this[y.main]).removeLayer(this[y.pulse]),this}},{key:"pause",value:function(){if(!this.options.paused){var t=this[y.pulse].getElement();return this.options.paused=!0,t&&(t.removeAttribute("style"),t.setAttribute("data-animated","true")),!0}return!1}},{key:"resume",value:function(){var t=this.options;return!!t.paused&&(t.paused=!1,this._calculateAnimationSpeed(),!0)}},{key:"bringToFront",value:function(){return this[y.main].bringToFront(),this[y.pulse].bringToFront(),this}},{key:"bringToBack",value:function(){return this[y.pulse].bringToBack(),this[y.main].bringToBack(),this}},{key:"removeFrom",value:function(t){return t&&t.hasLayer(this)&&t.removeLayer(this),this}},{key:"setStyle",value:function(t){var e=c({},this.options,t),n=e.paused,r=e.delay,o=e.reverse;n?this.pause():this.resume(),r!==this.options.delay&&(this.options.delay=r||this._defaultOptions.delay,this._calculateAnimationSpeed()),void 0!==o&&o!==this.options.reverse&&this._pureReverse(),this.options=c({},this.options,t);var i=this._processOptions(),a=i.pathOpts,u=i.pulseOpts;return this[y.main].setStyle(a),this[y.pulse].setStyle(u),this}},{key:"reverse",value:function(){return this._pureReverse(),this.options.reverse=!this.options.reverse,this}},{key:"redraw",value:function(){return this[y.main].redraw(),this[y.pulse].redraw(),this}},{key:"addLatLng",value:function(){for(var t,e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this._path=[].concat(u(this._path),[r]),(t=this[y.main]).addLatLng.apply(t,r),(e=this[y.pulse]).addLatLng.apply(e,r),this}},{key:"setLatLngs",value:function(){for(var t,e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this._path=r,(t=this[y.main]).setLatLngs.apply(t,r),(e=this[y.pulse]).setLatLngs.apply(e,r),this}},{key:"getLatLngs",value:function(){return this[y.main].getLatLngs()}},{key:"spliceLatLngs",value:function(){var t,e,n=(t=this[y.main]).spliceLatLngs.apply(t,arguments);return(e=this[y.pulse]).spliceLatLngs.apply(e,arguments),n}},{key:"getBounds",value:function(){return this[y.main].getBounds()}},{key:"toGeoJSON",value:function(){return this[y.main].toGeoJSON()}},{key:g,get:function(){return"L.Polyline.AntPath"}}])&&s(n.prototype,o),w&&s(n,w),e}(),O=function(t,e){return Reflect.construct(w,[t,e])};n(23);n.d(e,"AntPath",function(){return x}),n.d(e,"antPath",function(){return S}),r.Polyline.AntPath=w,r.polyline.antPath=O;var x=w,S=O;e.default={AntPath:x,antPath:S}},function(t,e,n){var r=n(43);t.exports=function(t){return Object(r(t))}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(45),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){t.exports=!n(9)&&!n(5)(function(){return 7!=Object.defineProperty(n(47)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(4),o=n(0).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e){t.exports=!1},function(t,e,n){t.exports=!n(5)(function(){return!String(Symbol())})},function(t,e,n){t.exports=n(15)("native-function-to-string",Function.toString)},function(t,e,n){var r,o,i,a=n(66),u=n(4),c=n(16),s=n(7),f=n(18),l=n(19),p=n(0).WeakMap;if(a){var h=new p,y=h.get,v=h.has,d=h.set;r=function(t,e){return d.call(h,t,e),e},o=function(t){return y.call(h,t)||{}},i=function(t){return v.call(h,t)}}else{var m=f("state");l[m]=!0,r=function(t,e){return c(t,m,e),e},o=function(t){return s(t,m)?t[m]:{}},i=function(t){return s(t,m)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var r=n(7),o=n(53),i=n(11),a=n(8);t.exports=function(t,e){for(var n=o(e),u=a.f,c=i.f,s=0;s<n.length;s++){var f=n[s];r(t,f)||u(t,f,c(e,f))}}},function(t,e,n){var r=n(34),o=n(36),i=n(2),a=n(0).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(i(t)),n=o.f;return n?e.concat(n(t)):e}},function(t,e,n){var r=n(7),o=n(17),i=n(67)(!1),a=n(19);t.exports=function(t,e){var n,u=o(t),c=0,s=[];for(n in u)!r(a,n)&&r(u,n)&&s.push(n);for(;e.length>c;)r(u,n=e[c++])&&(~i(s,n)||s.push(n));return s}},function(t,e,n){e.f=n(10)},function(t,e,n){var r=n(2),o=n(75),i=n(35),a=n(76),u=n(47),c=n(18)("IE_PROTO"),s=function(){},f=function(){var t,e=u("iframe"),n=i.length;for(e.style.display="none",a.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),f=t.F;n--;)delete f.prototype[i[n]];return f()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[c]=t):n=f(),void 0===e?n:o(n,e)},n(19)[c]=!0},function(t,e,n){t.exports=!n(5)(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},function(t,e,n){var r=n(4),o=n(2);t.exports=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}},function(t,e,n){n(60),n(93),t.exports=n(41)},function(t,e,n){n(61),n(70),n(73),n(78),n(79),n(80),n(81),n(82),n(83),n(84),n(85),n(86),n(87),n(88),n(89),n(90),n(91),n(92),t.exports=n(20).Symbol},function(t,e,n){"use strict";var r=n(28),o=n(4),i=n(42),a=n(44),u=n(62),c=n(63),s=n(10)("isConcatSpreadable"),f=!n(5)(function(){var t=[];return t[s]=!1,t.concat()[0]!==t}),l=n(64)("concat"),p=function(t){if(!o(t))return!1;var e=t[s];return void 0!==e?!!e:r(t)},h=!f||!l;n(3)({target:"Array",proto:!0,forced:h},{concat:function(t){var e,n,r,o,s,f=i(this),l=c(f,0),h=0;for(e=-1,r=arguments.length;e<r;e++)if(s=-1===e?f:arguments[e],p(s)){if(h+(o=a(s.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,h++)n in s&&u(l,h,s[n])}else{if(h>=9007199254740991)throw TypeError("Maximum allowed index exceeded");u(l,h++,s)}return l.length=h,l}})},function(t,e,n){"use strict";var r=n(13),o=n(8),i=n(14);t.exports=function(t,e,n){var a=r(e);a in t?o.f(t,a,i(0,n)):t[a]=n}},function(t,e,n){var r=n(4),o=n(28),i=n(10)("species");t.exports=function(t,e){var n;return o(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!o(n.prototype)?r(n)&&null===(n=n[i])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},function(t,e,n){var r=n(5),o=n(10)("species");t.exports=function(t){return!r(function(){var e=[];return(e.constructor={})[o]=function(){return{foo:1}},1!==e[t](Boolean).foo})}},function(t,e,n){var r=n(5),o=n(29),i="".split;t.exports=r(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,e,n){var r=n(50),o=n(0).WeakMap;t.exports="function"==typeof o&&/native code/.test(r.call(o))},function(t,e,n){var r=n(17),o=n(44),i=n(68);t.exports=function(t){return function(e,n,a){var u,c=r(e),s=o(c.length),f=i(a,s);if(t&&n!=n){for(;s>f;)if((u=c[f++])!=u)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(45),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},function(t,e,n){var r=n(5),o=/#|\.prototype\./,i=function(t,e){var n=u[a(t)];return n==s||n!=c&&("function"==typeof e?r(e):!!e)},a=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=i.data={},c=i.NATIVE="N",s=i.POLYFILL="P";t.exports=i},function(t,e,n){var r=n(71),o=Object.prototype;r!==o.toString&&n(33)(o,"toString",r,{unsafe:!0})},function(t,e,n){"use strict";var r=n(72),o={};o[n(10)("toStringTag")]="z",t.exports="[object z]"!==String(o)?function(){return"[object "+r(this)+"]"}:o.toString},function(t,e,n){var r=n(29),o=n(10)("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:i?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){"use strict";var r=n(0),o=n(7),i=n(9),a=n(48),u=n(3),c=n(33),s=n(19),f=n(5),l=n(15),p=n(37),h=n(31),y=n(10),v=n(55),d=n(6),m=n(74),g=n(28),b=n(2),w=n(4),O=n(17),x=n(13),S=n(14),j=n(56),_=n(77),L=n(11),P=n(8),k=n(32),E=n(16),A=n(38),R=n(18)("hidden"),T=n(51),C=T.set,F=T.getterFor("Symbol"),N=L.f,M=P.f,I=_.f,U=r.Symbol,B=r.JSON,G=B&&B.stringify,z=y("toPrimitive"),D=k.f,J=l("symbol-registry"),q=l("symbols"),Z=l("op-symbols"),$=l("wks"),W=Object.prototype,Y=r.QObject,H=n(49),K=!Y||!Y.prototype||!Y.prototype.findChild,Q=i&&f(function(){return 7!=j(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=N(W,e);r&&delete W[e],M(t,e,n),r&&t!==W&&M(W,e,r)}:M,V=function(t,e){var n=q[t]=j(U.prototype);return C(n,{type:"Symbol",tag:t,description:e}),i||(n.description=e),n},X=H&&"symbol"==typeof U.iterator?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof U},tt=function(t,e,n){return t===W&&tt(Z,e,n),b(t),e=x(e,!0),b(n),o(q,e)?(n.enumerable?(o(t,R)&&t[R][e]&&(t[R][e]=!1),n=j(n,{enumerable:S(0,!1)})):(o(t,R)||M(t,R,S(1,{})),t[R][e]=!0),Q(t,e,n)):M(t,e,n)},et=function(t,e){b(t);for(var n,r=m(e=O(e)),o=0,i=r.length;i>o;)tt(t,n=r[o++],e[n]);return t},nt=function(t){var e=D.call(this,t=x(t,!0));return!(this===W&&o(q,t)&&!o(Z,t))&&(!(e||!o(this,t)||!o(q,t)||o(this,R)&&this[R][t])||e)},rt=function(t,e){if(t=O(t),e=x(e,!0),t!==W||!o(q,e)||o(Z,e)){var n=N(t,e);return!n||!o(q,e)||o(t,R)&&t[R][e]||(n.enumerable=!0),n}},ot=function(t){for(var e,n=I(O(t)),r=[],i=0;n.length>i;)o(q,e=n[i++])||o(s,e)||r.push(e);return r},it=function(t){for(var e,n=t===W,r=I(n?Z:O(t)),i=[],a=0;r.length>a;)!o(q,e=r[a++])||n&&!o(W,e)||i.push(q[e]);return i};H||(c((U=function(){if(this instanceof U)throw TypeError("Symbol is not a constructor");var t=void 0===arguments[0]?void 0:String(arguments[0]),e=h(t),n=function(t){this===W&&n.call(Z,t),o(this,R)&&o(this[R],e)&&(this[R][e]=!1),Q(this,e,S(1,t))};return i&&K&&Q(W,e,{configurable:!0,set:n}),V(e,t)}).prototype,"toString",function(){return F(this).tag}),k.f=nt,P.f=tt,L.f=rt,n(34).f=_.f=ot,n(36).f=it,i&&(M(U.prototype,"description",{configurable:!0,get:function(){return F(this).description}}),a||c(W,"propertyIsEnumerable",nt,{unsafe:!0})),v.f=function(t){return V(y(t),t)}),u({global:!0,wrap:!0,forced:!H,sham:!H},{Symbol:U});for(var at=A($),ut=0;at.length>ut;)d(at[ut++]);u({target:"Symbol",stat:!0,forced:!H},{for:function(t){return o(J,t+="")?J[t]:J[t]=U(t)},keyFor:function(t){if(!X(t))throw TypeError(t+" is not a symbol");for(var e in J)if(J[e]===t)return e},useSetter:function(){K=!0},useSimple:function(){K=!1}}),u({target:"Object",stat:!0,forced:!H,sham:!i},{create:function(t,e){return void 0===e?j(t):et(j(t),e)},defineProperty:tt,defineProperties:et,getOwnPropertyDescriptor:rt}),u({target:"Object",stat:!0,forced:!H},{getOwnPropertyNames:ot,getOwnPropertySymbols:it}),B&&u({target:"JSON",stat:!0,forced:!H||f(function(){var t=U();return"[null]"!=G([t])||"{}"!=G({a:t})||"{}"!=G(Object(t))})},{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(w(e)||void 0!==t)&&!X(t))return g(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!X(e))return e}),r[1]=e,G.apply(B,r)}}),U.prototype[z]||E(U.prototype,z,U.prototype.valueOf),p(U,"Symbol"),s[R]=!0},function(t,e,n){var r=n(38),o=n(36),i=n(32);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var a,u=n(t),c=i.f,s=0;u.length>s;)c.call(t,a=u[s++])&&e.push(a);return e}},function(t,e,n){var r=n(9),o=n(8),i=n(2),a=n(38);t.exports=r?Object.defineProperties:function(t,e){i(t);for(var n,r=a(e),u=r.length,c=0;u>c;)o.f(t,n=r[c++],e[n]);return t}},function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(17),o=n(34).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return a.slice()}}(t):o(r(t))}},function(t,e,n){n(6)("asyncIterator")},function(t,e,n){"use strict";var r=n(9),o=n(7),i=n(4),a=n(8).f,u=n(52),c=n(0).Symbol;if(r&&"function"==typeof c&&(!("description"in c.prototype)||void 0!==c().description)){var s={},f=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof f?new c(t):void 0===t?c():c(t);return""===t&&(s[e]=!0),e};u(f,c);var l=f.prototype=c.prototype;l.constructor=f;var p=l.toString,h="Symbol(test)"==String(c("test")),y=/^Symbol\((.*)\)[^)]+$/;a(l,"description",{configurable:!0,get:function(){var t=i(this)?this.valueOf():this,e=p.call(t);if(o(s,t))return"";var n=h?e.slice(7,-1):e.replace(y,"$1");return""===n?void 0:n}}),n(3)({global:!0,forced:!0},{Symbol:f})}},function(t,e,n){n(6)("hasInstance")},function(t,e,n){n(6)("isConcatSpreadable")},function(t,e,n){n(6)("iterator")},function(t,e,n){n(6)("match")},function(t,e,n){n(6)("replace")},function(t,e,n){n(6)("search")},function(t,e,n){n(6)("species")},function(t,e,n){n(6)("split")},function(t,e,n){n(6)("toPrimitive")},function(t,e,n){n(6)("toStringTag")},function(t,e,n){n(6)("unscopables")},function(t,e,n){n(37)(Math,"Math",!0)},function(t,e,n){n(37)(n(0).JSON,"JSON",!0)},function(t,e,n){n(94),n(95),n(97),n(98),n(99),n(100),n(101),n(102),n(103),n(104),n(105),n(108),n(109),t.exports=n(20).Reflect},function(t,e,n){var r=n(39),o=n(2),i=(n(0).Reflect||{}).apply,a=Function.apply,u=!n(5)(function(){i(function(){})});n(3)({target:"Reflect",stat:!0,forced:u},{apply:function(t,e,n){return r(t),o(n),i?i(t,e,n):a.call(t,e,n)}})},function(t,e,n){var r=n(56),o=n(39),i=n(2),a=n(4),u=n(5),c=n(96),s=(n(0).Reflect||{}).construct,f=u(function(){function t(){}return!(s(function(){},[],t)instanceof t)}),l=!u(function(){s(function(){})}),p=f||l;n(3)({target:"Reflect",stat:!0,forced:p,sham:p},{construct:function(t,e){o(t),i(e);var n=arguments.length<3?t:o(arguments[2]);if(l&&!f)return s(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var u=[null];return u.push.apply(u,e),new(c.apply(t,u))}var p=n.prototype,h=r(a(p)?p:Object.prototype),y=Function.apply.call(t,h,e);return a(y)?y:h}})},function(t,e,n){"use strict";var r=n(39),o=n(4),i=[].slice,a={};t.exports=Function.bind||function(t){var e=r(this),n=i.call(arguments,1),u=function(){var r=n.concat(i.call(arguments));return this instanceof u?function(t,e,n){if(!(e in a)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";a[e]=Function("C,a","return new C("+r.join(",")+")")}return a[e](t,n)}(e,r.length,r):e.apply(t,r)};return o(e.prototype)&&(u.prototype=e.prototype),u}},function(t,e,n){var r=n(8),o=n(2),i=n(13),a=n(9),u=n(5)(function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})});n(3)({target:"Reflect",stat:!0,forced:u,sham:!a},{defineProperty:function(t,e,n){o(t),e=i(e,!0),o(n);try{return r.f(t,e,n),!0}catch(t){return!1}}})},function(t,e,n){var r=n(11).f,o=n(2);n(3)({target:"Reflect",stat:!0},{deleteProperty:function(t,e){var n=r(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},function(t,e,n){var r=n(11),o=n(40),i=n(7),a=n(4),u=n(2);n(3)({target:"Reflect",stat:!0},{get:function t(e,n){var c,s,f=arguments.length<3?e:arguments[2];return u(e)===f?e[n]:(c=r.f(e,n))?i(c,"value")?c.value:void 0===c.get?void 0:c.get.call(f):a(s=o(e))?t(s,n,f):void 0}})},function(t,e,n){var r=n(11),o=n(2),i=n(9);n(3)({target:"Reflect",stat:!0,sham:!i},{getOwnPropertyDescriptor:function(t,e){return r.f(o(t),e)}})},function(t,e,n){var r=n(40),o=n(2),i=n(57);n(3)({target:"Reflect",stat:!0,sham:!i},{getPrototypeOf:function(t){return r(o(t))}})},function(t,e,n){n(3)({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},function(t,e,n){var r=n(2),o=Object.isExtensible;n(3)({target:"Reflect",stat:!0},{isExtensible:function(t){return r(t),!o||o(t)}})},function(t,e,n){n(3)({target:"Reflect",stat:!0},{ownKeys:n(53)})},function(t,e,n){var r=n(106),o=n(2),i=n(107);n(3)({target:"Reflect",stat:!0,sham:!i},{preventExtensions:function(t){o(t);try{var e=r("Object","preventExtensions");return e&&e(t),!0}catch(t){return!1}}})},function(t,e,n){var r=n(20),o=n(0),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][e]||o[t]&&o[t][e]}},function(t,e,n){t.exports=!n(5)(function(){return Object.isExtensible(Object.preventExtensions({}))})},function(t,e,n){var r=n(8),o=n(11),i=n(40),a=n(7),u=n(14),c=n(2),s=n(4);n(3)({target:"Reflect",stat:!0},{set:function t(e,n,f){var l,p,h=arguments.length<4?e:arguments[3],y=o.f(c(e),n);if(!y){if(s(p=i(e)))return t(p,n,f,h);y=u(0)}if(a(y,"value")){if(!1===y.writable||!s(h))return!1;if(l=o.f(h,n)){if(l.get||l.set||!1===l.writable)return!1;l.value=f,r.f(h,n,l)}else r.f(h,n,u(0,f));return!0}return void 0!==y.set&&(y.set.call(h,f),!0)}})},function(t,e,n){var r=n(110),o=n(58);r&&n(3)({target:"Reflect",stat:!0},{setPrototypeOf:function(t,e){o(t,e);try{return r(t,e),!0}catch(t){return!1}}})},function(t,e,n){var r=n(58);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,o){return r(n,o),e?t.call(n,o):n.__proto__=o,n}}():void 0)}])});

$(document).ready(function(){
    var next = 1;
    $(".add-more").click(function(e){
        e.preventDefault();
        next = next + 1;
        var newIn = '<div class="input-field col s4"><input placeholder="Source" id="src'+next+'" type="number" class="validate"></div><div class="input-field col s4"><input placeholder="Destination" id="dest'+next+'" type="number" class="validate"></div><div class="input-field col s2"><label><input type="checkbox" class="check" id="spec'+next+'" value='+next+'><span></span></label></div><div class="input-field col s2"><a class="btn-floating white black-text remove-me" id="remove' + (next) + '"><i class="material-icons black-text">close</i></a></div>';
        var newdiv = document.createElement('div');
        newdiv.className = "row";
        newdiv.setAttribute("id", "field"+next);
        newdiv.innerHTML  = newIn;
        document.getElementById('form-fields').appendChild(newdiv);
            $('.remove-me').click(function(e){
                e.preventDefault();
                var fieldNum = this.id.charAt(this.id.length-1);
                console.log(fieldNum)
                document.getElementById('field'+fieldNum).remove();
            });
    });
});

function map_load() { 
 	var curLocation = [0, 0];
  if (curLocation[0] == 0 && curLocation[1] == 0) {
    curLocation = [40.6868, -73.9405];
  }

  map = L.map('MapLocation').setView(curLocation, 16);

  L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
      interactive:false,
    attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
  }).addTo(map);

  map.attributionControl.setPrefix(false);

	L.Polyline.include({

	// Hi-res timestamp indicating when the last calculations for vertices and
	// distance took place.
	_snakingTimestamp: 0,

	// How many rings and vertices we've already visited
	// Yeah, yeah, "rings" semantically only apply to polygons, but L.Polyline
	// internally uses that nomenclature.
	_snakingRings: 0,
	_snakingVertices: 0,

	// Distance to draw (in screen pixels) since the last vertex
	_snakingDistance: 0,

	// Flag
	_snaking: false,


	/// TODO: accept a 'map' parameter, fall back to addTo() in case
	/// performance.now is not available.
	snakeIn: function(){

		if (this._snaking) { return; }

		if ( !('performance' in window) ||
		     !('now' in window.performance) ||
		     !this._map) {
			return;
		}

		this._snaking = true;
		this._snakingTime = performance.now();
		this._snakingVertices = this._snakingRings = this._snakingDistance = 0;

		if (!this._snakeLatLngs) {
			this._snakeLatLngs = L.LineUtil.isFlat(this._latlngs) ?
				[ this._latlngs ] :
				this._latlngs ;
		}

		// Init with just the first (0th) vertex in a new ring
		// Twice because the first thing that this._snake is is chop the head.
		this._latlngs = [[ this._snakeLatLngs[0][0], this._snakeLatLngs[0][0] ]];

		this._update();
		this._snake();
		this.fire('snakestart');
		return this;
	},


	_snake: function(){

		var now = performance.now();
		var diff = now - this._snakingTime;	// In milliseconds
		var forward = diff * this.options.snakingSpeed / 1000;	// In pixels
		this._snakingTime = now;

		// Chop the head from the previous frame
		this._latlngs[ this._snakingRings ].pop();

		return this._snakeForward(forward);
	},

	_snakeForward: function(forward) {

		// If polyline has been removed from the map stop _snakeForward
		if (!this._map) return;
		// Calculate distance from current vertex to next vertex
		var currPoint = this._map.latLngToContainerPoint(
			this._snakeLatLngs[ this._snakingRings ][ this._snakingVertices ]);
		var nextPoint = this._map.latLngToContainerPoint(
			this._snakeLatLngs[ this._snakingRings ][ this._snakingVertices + 1 ]);

		var distance = currPoint.distanceTo(nextPoint);

// 		console.log('Distance to next point:', distance, '; Now at: ', this._snakingDistance, '; Must travel forward:', forward);
// 		console.log('Vertices: ', this._latlngs);

		if (this._snakingDistance + forward > distance) {
			// Jump to next vertex
			this._snakingVertices++;
			this._latlngs[ this._snakingRings ].push( this._snakeLatLngs[ this._snakingRings ][ this._snakingVertices ] );

			if (this._snakingVertices >= this._snakeLatLngs[ this._snakingRings ].length - 1 ) {
				if (this._snakingRings >= this._snakeLatLngs.length - 1 ) {
					return this._snakeEnd();
				} else {
					this._snakingVertices = 0;
					this._snakingRings++;
					this._latlngs[ this._snakingRings ] = [
						this._snakeLatLngs[ this._snakingRings ][ this._snakingVertices ]
					];
				}
			}

			this._snakingDistance -= distance;
			return this._snakeForward(forward);
		}

		this._snakingDistance += forward;

		var percent = this._snakingDistance / distance;

		var headPoint = nextPoint.multiplyBy(percent).add(
			currPoint.multiplyBy( 1 - percent )
		);

		// Put a new head in place.
		var headLatLng = this._map.containerPointToLatLng(headPoint);
		this._latlngs[ this._snakingRings ].push(headLatLng);

		this.setLatLngs(this._latlngs);
		this.fire('snake');
		L.Util.requestAnimFrame(this._snake, this);
	},

	_snakeEnd: function() {

		this.setLatLngs(this._snakeLatLngs);
		this._snaking = false;
		this.fire('snakeend');

	}

});


L.Polyline.mergeOptions({
	snakingSpeed: 200	// In pixels/sec
});

L.LayerGroup.include({

	_snakingLayers: [],
	_snakingLayersDone: 0,

	snakeIn: function() {

		if ( !('performance' in window) ||
		     !('now' in window.performance) ||
		     !this._map ||
		     this._snaking) {
			return;
		}


		this._snaking = true;
		this._snakingLayers = [];
		this._snakingLayersDone = 0;
		var keys = Object.keys(this._layers);
		for (var i in keys) {
			var key = keys[i];
			this._snakingLayers.push(this._layers[key]);
		}
		this.clearLayers();

		this.fire('snakestart');
		return this._snakeNext();
	},


	_snakeNext: function() {


		if (this._snakingLayersDone >= this._snakingLayers.length) {
			this.fire('snakeend');
			this._snaking = false;
			return;
		}

		var currentLayer = this._snakingLayers[this._snakingLayersDone];

		this._snakingLayersDone++;

		this.addLayer(currentLayer);
		if ('snakeIn' in currentLayer) {
			currentLayer.once('snakeend', function(){
				setTimeout(this._snakeNext.bind(this), this.options.snakingPause);
			}, this);
			currentLayer.snakeIn();
		} else {
			setTimeout(this._snakeNext.bind(this), this.options.snakingPause);
		}


		this.fire('snake');
		return this;
	}

	});


	L.LayerGroup.mergeOptions({
		snakingPause: 200
	});

  map.dragging.disable();
  map.keyboard.disable();
  //map.zoomControl.disable();
  map.touchZoom.disable();
  map.doubleClickZoom.disable();
  map.scrollWheelZoom.disable();

    var redmark = L.icon({
    iconUrl: '/static/redmark.png',

    // iconSize:     [38, 95], // size of the icon
    iconAnchor:   [8, 10] // point of the icon which will correspond to marker's location
    // popupAnchor:  [-3, -76] // point from which the popup should open relative to the iconAnchor

    });

    var lat = [40.685080276663726 ,40.68434805779277, 40.68905039003287, 40.68833448542927, 40.68761857313474, 40.68690265314925, 40.68618672547289, 40.68542197605053, 40.68464094630648, 40.68942460983294,40.68865989756615,40.6879439887675,40.6872280722779,40.68649587700388, 40.68576367368543, 40.68499891940862, 40.68900157859967, 40.688253132146784, 40.68752094813503, 40.686805027100796, 40.685975199914836, 40.68532434783307, 40.684608403201835,40.68929444666259, 40.68859481526591,40.68786263500829, 40.68716298857928, 40.686398250359545, 40.68569858855671, 40.684950105007914];
    var long = [ -73.947172164917,  -73.94700050354005, -73.94509077072145, -73.94494056701662, -73.94476890563966, -73.94464015960695, -73.94451141357423, -73.9443612098694, -73.94421100616456,-73.9422369003296,-73.94208669662477,-73.94195795059206, -73.94180774688722, -73.9416790008545, -73.94152879714967, -73.94140005111696, -73.93925428390504, -73.93912553787233, -73.93899679183961, -73.93880367279054, -73.93863201141359, -73.93852472305299, -73.93837451934816,-73.93635749816896,-73.936185836792 ,-73.93605709075929 ,-73.93592834472658,-73.93575668334962 , -73.93562793731691 ,-73.93545627593996];

    for (var i = 1; i <= 30; i++)
    {
        var mark = L.marker([lat[i-1],long[i-1]], {icon: redmark});
       mark.addTo(map).bindPopup(i.toString());
       mark.on('mouseover', function (e) {
            this.openPopup();
        });
        mark.on('mouseout', function (e) {
            this.closePopup();
        });
    }

    var smark = L.icon({
    iconUrl: '/static/source/1.png',

    // iconSize:     [38, 95], // size of the icon
    iconSize:     [20, 40],
                    // shadowSize:   [50, 64],
    iconAnchor:   [10, 40] // point of the icon which will correspond to marker's location
    // popupAnchor:  [-3, -76] // point from which the popup should open relative to the iconAnchor

    });
    var dmark = L.icon({
    iconUrl: '/static/destination/1.png',

    // iconSize:     [38, 95], // size of the icon
    iconSize:     [20, 40],
    iconAnchor:   [0, 35]// point of the icon which will correspond to marker's location
    // popupAnchor:  [-3, -76] // point from which the popup should open relative to the iconAnchor

    });
    init_path1 = [[40.68434805779277, -73.94700050354005],[40.685080276663726, -73.947172164917],[40.68542197605053, -73.9443612098694],[40.68618672547289, -73.94451141357423],[40.68690265314925, -73.94464015960695],[40.68761857313474, -73.94476890563966]]
    init_path2 = [[40.68761857313474, -73.94476890563966],[40.6879439887675, -73.94195795059206],[40.688253132146784, -73.93912553787233],[40.68859481526591, -73.936185836792]]
    if(!map_done)
    {
    	setTimeout(() => {  
	    L.polyline(init_path1,{color:'#4e79a5' ,weight:2, pulseColor:'#000000', snakingSpeed: s_speed}).addTo(map);
	    L.polyline(init_path2,{color:'#4e79a5' ,weight:2, pulseColor:'#000000', snakingSpeed: s_speed}).addTo(map);
	    L.polyline(init_path1,{color:'#4e79a5' ,weight:7, pulseColor:'#000000', snakingSpeed: s_speed}).addTo(map).snakeIn();
    	L.marker(init_path1[0], {icon: smark}).addTo(map);
        L.marker(init_path2[3], {icon: dmark}).addTo(map);

    	map_done = 1;
		}, 2000);
    }
    else
    {
    	L.polyline(init_path1,{color:'#4e79a5' ,weight:7, pulseColor:'#000000', snakingSpeed: s_speed}).addTo(map);
    	L.marker(init_path1[0], {icon: smark}).addTo(map);
    }          
};

$(function() {
	map_load();
	});

$(function(){
    $('#subform').on('click', function(e){

    e.preventDefault();
    var favorite = [];
    $.each($("input[class='check']:checked"), function(){
      favorite.push($(this).val());
    });

    $.ajax({
        type:'POST',
        url:'/dat_inp/',
        data:{
            src1:$('#src1').val(),
            dest1:$('#dest1').val(),
            src2:$('#src2').val(),
            dest2:$('#dest2').val(),
            src3:$('#src3').val(),
            dest3:$('#dest3').val(),
            src4:$('#src4').val(),
            dest4:$('#dest4').val(),
            src5:$('#src5').val(),
            dest5:$('#dest5').val(),
            src6:$('#src6').val(),
            dest6:$('#dest6').val(),
            src7:$('#src7').val(),
            dest7:$('#dest7').val(),
            src8:$('#src8').val(),
            dest8:$('#dest8').val(),
            src9:$('#src9').val(),
            dest9:$('#dest9').val(),
            src10:$('#src10').val(),
            dest10:$('#dest10').val(),
            src11:$('#src11').val(),
            dest11:$('#dest11').val(),
            src12:$('#src12').val(),
            dest12:$('#dest12').val(),
            src13:$('#src13').val(),
            dest13:$('#dest13').val(),
            src14:$('#src14').val(),
            dest14:$('#dest14').val(),
            src15:$('#src15').val(),
            dest15:$('#dest15').val(),
            src16:$('#src16').val(),
            dest16:$('#dest16').val(),
            src17:$('#src17').val(),
            dest17:$('#dest17').val(),
            src18:$('#src18').val(),
            dest18:$('#dest18').val(),
            src19:$('#src19').val(),
            dest19:$('#dest19').val(),
            src20:$('#src20').val(),
            dest20:$('#dest20').val(),
            spec:favorite,
            csrfmiddlewaretoken:$('input[name=csrfmiddlewaretoken]').val(),
            action: 'post'
        },
        dataType: 'JSON',
        beforeSend: function () {
        //     // ... your initialization code here (so show loader) ...
        //     // $('#MapLocation').loadingOverlay();
        //     $('#target').loadingOverlay();

        //css
        	//document.getElementById("MapLocation").style.opacity=0.3;
        	$("#MapLocation").css("opacity", "0.3");
        	//document.getElementById("Loader").classList.add("active");
        	$("#Loader").addClass("active");
        //css

        map.off();
		map.remove();
        map_load();
        // console.log("map relad");
          },
          complete: function () {
            // ... your finalization code here (hide loader) ...
            //   $('#MapLocation').loadingOverlay('remove');
            //  $('#target').loadingOverlay('remove');

            //css
        	//document.getElementById("MapLocation").style.opacity=0.3;
        	$("#MapLocation").css("opacity", "1");
        	//document.getElementById("Loader").classList.add("active");
        	$("#Loader").removeClass("active");
        	//css

          },
        success:function(json){
            // document.getElementById("post-form").reset();
            // console.log(json.paths);

         col_arr = ['#4e79a5','#f18f3b','#e0585b','#5aa155','#edc958','#af7aa0','#fe9ea8','#9c7561','#bab0ac','#77b7b2'];

         var sormark = L.Icon.extend({
                options: {
                    // shadowUrl: 'leaf-shadow.png',
                    iconSize:     [20, 40],
                    // shadowSize:   [50, 64],
                    iconAnchor:   [10, 40]
                    // shadowAnchor: [4, 62],
                    // popupAnchor:  [-3, -76]
                }
            });

             var destmark = L.Icon.extend({
                options: {
                    // shadowUrl: 'leaf-shadow.png',
                    iconSize:     [20, 40],
                    iconAnchor:   [0, 35]
                    // shadowAnchor: [4, 62],
                    // popupAnchor:  [-3, -76]
                }
            });

             var sorcicon = [];
             var desticon = [];
            for(var i=1;i<11;i++)
            {
                sorcicon.push(new sormark({iconUrl: '/static/source/'+i.toString()+'.png'}));
                desticon.push(new destmark({iconUrl: '/static/destination/'+i.toString()+'.png'}));
            }

            var locations = [(1, {"lat": 40.685080276663726, "long": -73.947172164917}), (2, {"lat": 40.68434805779277, "long": -73.94700050354005}), (3, {"lat": 40.68905039003287, "long": -73.94509077072145}), (4, {"lat": 40.68833448542927, "long": -73.94494056701662}), (5, {"lat": 40.68761857313474, "long": -73.94476890563966}), (6, {"lat": 40.68690265314925, "long": -73.94464015960695}), (7, {"lat": 40.68618672547289, "long": -73.94451141357423}), (8, {"lat": 40.68542197605053, "long": -73.9443612098694}), (9, {"lat": 40.68464094630648, "long": -73.94421100616456}), (10, {"lat": 40.68942460983294, "long": -73.9422369003296}), (11, {"lat": 40.68865989756615, "long": -73.94208669662477}), (12, {"lat": 40.6879439887675, "long": -73.94195795059206}), (13, {"lat": 40.6872280722779, "long": -73.94180774688722}), (14, {"lat": 40.68649587700388, "long": -73.9416790008545}), (15, {"lat": 40.68576367368543, "long": -73.94152879714967}), (16, {"lat": 40.68499891940862, "long": -73.94140005111696}), (17, {"lat": 40.68900157859967, "long": -73.93925428390504}), (18, {"lat": 40.688253132146784, "long": -73.93912553787233}), (19, {"lat": 40.68752094813503, "long": -73.93899679183961}), (20, {"lat": 40.686805027100796, "long": -73.93880367279054}), (21, {"lat": 40.686024013564754, "long":  -73.93871784210206}), (22, {"lat": 40.68532434783307, "long": -73.93852472305299}), (23, {"lat": 40.684608403201835, "long": -73.93837451934816}), (24, {"lat": 40.68929444666259, "long": -73.93635749816896}), (25, {"lat": 40.68859481526591, "long": -73.936185836792}), (26, {"lat": 40.68786263500829, "long": -73.93605709075929}), (27, {"lat": 40.68716298857928, "long": -73.93592834472658}), (28, {"lat": 40.686398250359545, "long": -73.93575668334962}), (29, {"lat": 40.68569858855671, "long": -73.93562793731691}), (30, {"lat": 40.684950105007914, "long": -73.93545627593996}) ];

            var num_cars = json.src.length;
            var sm = [];
            var polyarr = [];

            var disp = new Array(num_cars);

            for(var car=0;car<json.paths.length;car++)
            {
                disp[car] = [];
                disp[car].push(JSON.stringify([locations[json.src[car]-1]['lat'], locations[json.src[car]-1]['long']]));
                for(var path=0;path<json.paths[car].length;path++)
                {
                    if(disp[car].indexOf(JSON.stringify(json.paths[car][path][0]))==-1)
                        disp[car].push(JSON.stringify(json.paths[car][path][0]));
                    if(disp[car].indexOf(JSON.stringify(json.paths[car][path][1]))==-1)
                        disp[car].push(JSON.stringify(json.paths[car][path][1]));
                }
            }

            for(car=0;car<json.paths.length;car++)
            {
                for(path=0;path<disp[car].length;path++)
                {
                    disp[car][path] = JSON.parse(disp[car][path])
                }
            }

            console.log(disp);
            for(car=0;car<json.paths.length;car++)
            {
                sm.push('1');
                console.log(disp[car]);
                L.polyline(disp[car],{color:col_arr[car%10] ,weight:2, pulseColor:'#000000', snakingSpeed: s_speed}).addTo(map);
                var x = L.polyline(disp[car],{color:col_arr[car%10] ,weight:7, pulseColor:'#000000', snakingSpeed: s_speed});
                x.addTo(map).snakeIn();
                polyarr.push(x);
            }

            for(var k=0;k<json.src.length;k++)
            {
                L.marker([locations[json.src[k]-1]['lat'], locations[json.src[k]-1]['long']], {icon: sorcicon[k]}).addTo(map);
                L.marker([locations[json.dest[k]-1]['lat'], locations[json.dest[k]-1]['long']], {icon: desticon[k]}).addTo(map).on('click',             function(e) {
                    var find = [this.getLatLng().lat,this.getLatLng().lng];

                    var k = 0;
                    for(k;k<31;k++)
                        if(locations[k]['lat']==find[0] && locations[k]['long'] == find[1])
                            break;

                    var tmp;
                    for(tmp = 0; tmp < num_cars;tmp++ )
                    {
                        if(json.dest[tmp] == k+1)
                            break;
                    }
                    if(sm[tmp] == '1')
                    {
                        // console.log(k);
                        for(var q=0;q<num_cars;q++)
                        {
                            if(q!=tmp) {
                                map.removeLayer(polyarr[q]);
                            }
                        }
                        sm[tmp] = '0';
                    }
                    else
                    {
                        for( q=0;q<num_cars;q++)
                        {
                            if(q!=tmp) {
                                map.addLayer(polyarr[q]);
                            }
                        }
                        sm[tmp] = '1';
                    }

            });
            }

        },
        error : function(xhr,errmsg,err) {
        console.log(xhr.status + ": " + xhr.responseText); // provide a bit more info about the error to the console
    }
    });
});
});
