react-leaflet-vectorgrid
Version:
React wrapper of Leaflet.VectorGrid. Display gridded vector data (sliced GeoJSON, TopoJSON or protobuf vector tiles).
1 lines • 83.7 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-leaflet"),require("leaflet")):"function"==typeof define&&define.amd?define([,],e):"object"==typeof exports?exports["react-leaflet-vectorgrid"]=e(require("react-leaflet"),require("leaflet")):t.ReactLeafletVectorGrid=e(t.ReactLeaflet,t.L)}(window,function(t,e){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=67)}([function(t,e){var r=Array.isArray;t.exports=r},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,r){var n=r(38),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,r){var n=r(8),o=r(73),i=r(74),a="[object Null]",s="[object Undefined]",u=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?s:a:u&&u in Object(t)?o(t):i(t)}},function(t,e,r){var n=r(79),o=r(82);t.exports=function(t,e){var r=o(t,e);return n(r)?r:void 0}},function(t,e,r){var n=r(14),o=r(26);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},function(t,e,r){var n=r(43),o=r(31);t.exports=function(t,e,r,i){var a=!r;r||(r={});for(var s=-1,u=e.length;++s<u;){var c=e[s],f=i?i(r[c],t[c],c,r,t):void 0;void 0===f&&(f=t[c]),a?o(r,c,f):n(r,c,f)}return r}},function(t,e,r){var n=r(2).Symbol;t.exports=n},function(t,e,r){var n=r(78),o=r(25),i=r(83),a=r(84),s=r(85),u=r(4),c=r(41),f=c(n),l=c(o),p=c(i),h=c(a),d=c(s),v=u;(n&&"[object DataView]"!=v(new n(new ArrayBuffer(1)))||o&&"[object Map]"!=v(new o)||i&&"[object Promise]"!=v(i.resolve())||a&&"[object Set]"!=v(new a)||s&&"[object WeakMap]"!=v(new s))&&(v=function(t){var e=u(t),r="[object Object]"==e?t.constructor:void 0,n=r?c(r):"";if(n)switch(n){case f:return"[object DataView]";case l:return"[object Map]";case p:return"[object Promise]";case h:return"[object Set]";case d:return"[object WeakMap]"}return e}),t.exports=v},function(t,e,r){(function(t){var n=r(2),o=r(87),i=e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===i?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;t.exports=u}).call(this,r(27)(t))},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,r){var n=r(45),o=r(39),i=r(6);t.exports=function(t){return i(t)?n(t):o(t)}},function(t,e,r){var n=r(45),o=r(116),i=r(6);t.exports=function(t){return i(t)?n(t,!0):o(t)}},function(t,e,r){var n=r(4),o=r(1),i="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";t.exports=function(t){if(!o(t))return!1;var e=n(t);return e==a||e==s||e==i||e==u}},function(t,e){var r=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}},function(t,e,r){var n=r(86),o=r(3),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(t){return o(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},function(t,e,r){var n=r(88),o=r(28),i=r(29),a=i&&i.isTypedArray,s=a?o(a):n;t.exports=s},function(t,e,r){var n=r(19),o=r(95),i=r(96),a=r(97),s=r(98),u=r(99);function c(t){var e=this.__data__=new n(t);this.size=e.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,t.exports=c},function(t,e,r){var n=r(90),o=r(91),i=r(92),a=r(93),s=r(94);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e,r){var n=r(11);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},function(t,e,r){var n=r(5)(Object,"create");t.exports=n},function(t,e,r){var n=r(108);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},function(t,e,r){var n=r(4),o=r(3),i="[object Symbol]";t.exports=function(t){return"symbol"==typeof t||o(t)&&n(t)==i}},function(t,e,r){var n=r(23),o=1/0;t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}},function(t,e,r){var n=r(5)(r(2),"Map");t.exports=n},function(t,e){var r=9007199254740991;t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,r){(function(t){var n=r(38),o=e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o&&n.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s}).call(this,r(27)(t))},function(t,e,r){var n=r(100),o=r(107),i=r(109),a=r(110),s=r(111);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e,r){var n=r(44);t.exports=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},function(t,e){var r=9007199254740991,n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var o=typeof t;return!!(e=null==e?r:e)&&("number"==o||"symbol"!=o&&n.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e,r){var n=r(119),o=r(48),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),n(a(t),function(e){return i.call(t,e)}))}:o;t.exports=s},function(t,e,r){var n=r(40)(Object.getPrototypeOf,Object);t.exports=n},function(t,e,r){var n=r(53);t.exports=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}},function(t,e){t.exports=function(t){return t}},function(t,e,r){var n=r(0),o=r(23),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!o(t))||a.test(t)||!i.test(t)||null!=e&&t in Object(e)}},function(t,e,r){(function(e){var r="object"==typeof e&&e&&e.Object===Object&&e;t.exports=r}).call(this,r(72))},function(t,e,r){var n=r(15),o=r(77),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return o(t);var e=[];for(var r in Object(t))i.call(t,r)&&"constructor"!=r&&e.push(r);return e}},function(t,e){t.exports=function(t,e){return function(r){return t(e(r))}}},function(t,e){var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,r){var n=r(18),o=r(112),i=r(43),a=r(113),s=r(115),u=r(46),c=r(47),f=r(118),l=r(120),p=r(51),h=r(121),d=r(9),v=r(122),y=r(123),b=r(55),g=r(0),x=r(10),m=r(128),_=r(1),w=r(130),j=r(12),S=1,F=2,P=4,O="[object Arguments]",M="[object Function]",L="[object GeneratorFunction]",A="[object Object]",T={};T[O]=T["[object Array]"]=T["[object ArrayBuffer]"]=T["[object DataView]"]=T["[object Boolean]"]=T["[object Date]"]=T["[object Float32Array]"]=T["[object Float64Array]"]=T["[object Int8Array]"]=T["[object Int16Array]"]=T["[object Int32Array]"]=T["[object Map]"]=T["[object Number]"]=T[A]=T["[object RegExp]"]=T["[object Set]"]=T["[object String]"]=T["[object Symbol]"]=T["[object Uint8Array]"]=T["[object Uint8ClampedArray]"]=T["[object Uint16Array]"]=T["[object Uint32Array]"]=!0,T["[object Error]"]=T[M]=T["[object WeakMap]"]=!1,t.exports=function t(e,r,k,B,E,V){var C,z=r&S,I=r&F,U=r&P;if(k&&(C=E?k(e,B,E,V):k(e)),void 0!==C)return C;if(!_(e))return e;var D=g(e);if(D){if(C=v(e),!z)return c(e,C)}else{var G=d(e),N=G==M||G==L;if(x(e))return u(e,z);if(G==A||G==O||N&&!E){if(C=I||N?{}:b(e),!z)return I?l(e,s(C,e)):f(e,a(C,e))}else{if(!T[G])return E?e:{};C=y(e,G,z)}}V||(V=new n);var $=V.get(e);if($)return $;if(V.set(e,C),w(e))return e.forEach(function(n){C.add(t(n,r,k,n,e,V))}),C;if(m(e))return e.forEach(function(n,o){C.set(o,t(n,r,k,o,e,V))}),C;var R=U?I?h:p:I?keysIn:j,Z=D?void 0:R(e);return o(Z||e,function(n,o){Z&&(n=e[o=n]),i(C,o,t(n,r,k,o,e,V))}),C}},function(t,e,r){var n=r(31),o=r(11),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var a=t[e];i.call(t,e)&&o(a,r)&&(void 0!==r||e in t)||n(t,e,r)}},function(t,e,r){var n=r(5),o=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,r){var n=r(114),o=r(16),i=r(0),a=r(10),s=r(32),u=r(17),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=i(t),f=!r&&o(t),l=!r&&!f&&a(t),p=!r&&!f&&!l&&u(t),h=r||f||l||p,d=h?n(t.length,String):[],v=d.length;for(var y in t)!e&&!c.call(t,y)||h&&("length"==y||l&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||s(y,v))||d.push(y);return d}},function(t,e,r){(function(t){var n=r(2),o=e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o?n.Buffer:void 0,s=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=s?s(r):new t.constructor(r);return t.copy(n),n}}).call(this,r(27)(t))},function(t,e){t.exports=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}},function(t,e){t.exports=function(){return[]}},function(t,e,r){var n=r(50),o=r(34),i=r(33),a=r(48),s=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)n(e,i(t)),t=o(t);return e}:a;t.exports=s},function(t,e){t.exports=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}},function(t,e,r){var n=r(52),o=r(33),i=r(12);t.exports=function(t){return n(t,i,o)}},function(t,e,r){var n=r(50),o=r(0);t.exports=function(t,e,r){var i=e(t);return o(t)?i:n(i,r(t))}},function(t,e,r){var n=r(2).Uint8Array;t.exports=n},function(t,e,r){var n=r(35);t.exports=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}},function(t,e,r){var n=r(127),o=r(34),i=r(15);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:n(o(t))}},function(t,e,r){var n=r(135),o=r(142);t.exports=function(t){return n(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var u=r[n];u&&t(e,u,n,a)}return e})}},function(t,e,r){var n=r(31),o=r(11);t.exports=function(t,e,r){(void 0===r||o(t[e],r))&&(void 0!==r||e in t)||n(t,e,r)}},function(t,e){t.exports=function(t,e){if("__proto__"!=e)return t[e]}},function(t,e,r){var n=r(60),o=r(16),i=r(0),a=r(32),s=r(26),u=r(24);t.exports=function(t,e,r){for(var c=-1,f=(e=n(e,t)).length,l=!1;++c<f;){var p=u(e[c]);if(!(l=null!=t&&r(t,p)))break;t=t[p]}return l||++c!=f?l:!!(f=null==t?0:t.length)&&s(f)&&a(p,f)&&(i(t)||o(t))}},function(t,e,r){var n=r(0),o=r(37),i=r(153),a=r(156);t.exports=function(t,e){return n(t)?t:o(t,e)?[t]:i(a(t))}},function(t,e,r){var n=r(161),o=r(174),i=r(36),a=r(0),s=r(178);t.exports=function(t){return"function"==typeof t?t:null==t?i:"object"==typeof t?a(t)?o(t[0],t[1]):n(t):s(t)}},function(t,e,r){var n=r(163),o=r(3);t.exports=function t(e,r,i,a,s){return e===r||(null==e||null==r||!o(e)&&!o(r)?e!=e&&r!=r:n(e,r,i,a,t,s))}},function(t,e,r){var n=r(164),o=r(167),i=r(168),a=1,s=2;t.exports=function(t,e,r,u,c,f){var l=r&a,p=t.length,h=e.length;if(p!=h&&!(l&&h>p))return!1;var d=f.get(t);if(d&&f.get(e))return d==e;var v=-1,y=!0,b=r&s?new n:void 0;for(f.set(t,e),f.set(e,t);++v<p;){var g=t[v],x=e[v];if(u)var m=l?u(x,g,v,e,t,f):u(g,x,v,t,e,f);if(void 0!==m){if(m)continue;y=!1;break}if(b){if(!o(e,function(t,e){if(!i(b,e)&&(g===t||c(g,t,r,u,f)))return b.push(e)})){y=!1;break}}else if(g!==x&&!c(g,x,r,u,f)){y=!1;break}}return f.delete(t),f.delete(e),y}},function(t,e,r){var n=r(1);t.exports=function(t){return t==t&&!n(t)}},function(t,e){t.exports=function(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}}},function(t,e,r){var n=r(60),o=r(24);t.exports=function(t,e){for(var r=0,i=(e=n(e,t)).length;null!=t&&r<i;)t=t[o(e[r++])];return r&&r==i?t:void 0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,o=r(68),i=(n=o)&&n.__esModule?n:{default:n};e.default=i.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=r(69),a=y(r(70));r(71);var s=y(r(1)),u=y(r(14)),c=y(r(75)),f=y(r(76)),l=(y(r(89)),y(r(132))),p=y(r(133)),h=y(r(143)),d=y(r(151)),v=y(r(159));function y(t){return t&&t.__esModule?t:{default:t}}var b=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.MapLayer),o(e,[{key:"createLeafletElement",value:function(t){var e=this,r=t.leaflet||this.context,o=r.map,i=r.pane,c=r.layerContainer,h=t.data,d=t.zIndex,v=t.style,y=t.hoverStyle,b=t.activeStyle,g=t.onClick,x=t.onMouseover,m=t.onMouseout,_=t.onDblclick,w=t.onContextmenu,j=t.vectorTileLayerStyles,S=t.url,F=t.maxNativeZoom,P=t.maxZoom,O=t.minZoom,M=t.subdomains,L=t.accessKey,A=t.accessToken,T=t.type,k=void 0===T?"slicer":T,B=t.interactive,E=void 0===B||B,V=function(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}(t,["data","zIndex","style","hoverStyle","activeStyle","onClick","onMouseover","onMouseout","onDblclick","onContextmenu","vectorTileLayerStyles","url","maxNativeZoom","maxZoom","minZoom","subdomains","accessKey","accessToken","type","interactive"]);delete V.leaflet;var C=function(t,e){return(0,u.default)(v)?v(t):(0,s.default)(v)?v:{weight:.5,opacity:1,color:"#ccc",fillColor:"#390870",fillOpacity:.6,fill:!0,stroke:!0}};this.highlight=null,this.active=null;var z,I=void 0;return I="protobuf"===k?a.default.vectorGrid.protobuf(S,n({vectorTileLayerStyles:j,interactive:E,url:S,maxNativeZoom:F,subdomains:M,key:L,token:A,zIndex:d||Number(c._panes[i]&&c._panes[i].style.zIndex),getFeatureId:function(t){return e._getFeatureId(t)},rendererFactory:a.default.svg.tile,maxZoom:P||o.getMaxZoom(),minZoom:O||o.getMinZoom()},V)):a.default.vectorGrid.slicer(h,n({interactive:E,zIndex:d||Number(c._panes[i]&&c._panes[i].style.zIndex),getFeatureId:function(t){return e._getFeatureId(t)},rendererFactory:a.default.svg.tile,maxZoom:P||o.getMaxZoom(),minZoom:O||o.getMinZoom(),vectorTileLayerStyles:j||{sliced:function(t,e){var r=C(t);return r.fill=!0,r.stroke=!0,r}}},V)),(z=I,z._createLayer_orig=z._createLayer,z._createLayer=function(t,e,r){var n=this._createLayer_orig(t,e,r);return 1===t.type&&(n.getLatLng=null),n},z).on("mouseover",function(t){var r=t.layer.properties;e._propagateEvent(x,t);var n=void 0,o=e._getFeatureId(t.layer);if((0,u.default)(y)?n=y(r):(0,s.default)(y)&&(n=(0,l.default)(y)),!(0,f.default)(n)&&o){e.clearHighlight(),e.highlight=o;var i=(0,l.default)(C(r)),a=(0,p.default)(i,n);e.setFeatureStyle(o,a)}}).on("mouseout",function(t){e._propagateEvent(m,t),e.clearHighlight()}).on("click",function(t){var r=t.layer.properties,n=e._getFeatureId(t.layer);e._propagateEvent(g,t);var o=void 0;if((0,u.default)(b)?o=b(r):(0,s.default)(b)&&(o=(0,l.default)(b)),!(0,f.default)(o)&&n){e.clearActive(),e.active=n;var i=(0,l.default)(C(r)),a=(0,p.default)(i,o);e.setFeatureStyle(n,a)}}).on("dblclick",function(t){e._propagateEvent(_,t),e.clearActive()}).on("contextmenu",function(t){e._propagateEvent(w,t),e.clearActive()})}},{key:"componentDidMount",value:function(){var t=(this.props.leaflet||this.context).layerContainer,e=this.props,r=e.tooltipClassName,n=void 0===r?"":r,o=e.tooltip,i=void 0===o?null:o,a=e.popup,s=void 0===a?null:a;this.leafletElement.addTo(t),i&&this.leafletElement.bindTooltip(function(t){return(0,u.default)(i)?i(t):(0,c.default)(i)&&(0,d.default)(t.properties,i)?String(t.properties[i]):(0,c.default)(i)?i:""},{sticky:!0,direction:"auto",className:n}),s&&this.leafletElement.bindPopup(s)}},{key:"_getFeatureId",value:function(t){var e=this.props.idField;return(0,u.default)(e)?e(t):(0,c.default)(e)?t.properties[e]:void 0}},{key:"_propagateEvent",value:function(t,e){if((0,u.default)(t)){var r=this._getFeatureId(e.layer),n=this.getFeature(r),o=(0,l.default)(e);(0,h.default)(o.target,{feature:n});t(o)}}},{key:"setFeatureStyle",value:function(t,e){this.leafletElement.setFeatureStyle(t,e)}},{key:"resetFeatureStyle",value:function(t){this.leafletElement.resetFeatureStyle(t)}},{key:"clearHighlight",value:function(){this.highlight&&this.highlight!==this.active&&this.resetFeatureStyle(this.highlight),this.highlight=null}},{key:"clearActive",value:function(){this.active&&this.resetFeatureStyle(this.active),this.active=null}},{key:"getFeature",value:function(t){var e=this.props,r=e.data,n=e.idField;if((0,f.default)(r)||(0,f.default)(r.features))return{};var o=(0,v.default)(r.features,function(e){return e.properties[n]===t});return(0,l.default)(o)}}]),e}();e.default=b},function(e,r){e.exports=t},function(t,r){t.exports=e},function(t,e,r){"use strict";function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function o(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function i(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function a(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var o=r.pos-1;o>=t;o--)r.buf[o+n]=r.buf[o]}function s(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function u(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function c(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function l(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function v(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function y(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function b(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function g(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function x(t,e){this.x=t,this.y=e}function m(t,e,r,n,o){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=o,t.readFields(_,this,e)}function _(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],o=e._values[t.readVarint()];e.properties[n]=o}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function w(t){for(var e,r,n=0,o=0,i=t.length,a=i-1;o<i;a=o++)e=t[o],n+=((r=t[a]).x-e.x)*(e.y+r.y);return n}function j(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(S,this,e),this.length=this._features.length}function S(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function F(t,e,r){if(3===t){var n=new E(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}!function(t){function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function n(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return d.iterable&&(e[Symbol.iterator]=function(){return e}),e}function o(t){this.map={},t instanceof o?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function i(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function a(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function s(t){var e=new FileReader,r=a(e);return e.readAsArrayBuffer(t),r}function u(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function c(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(d.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(d.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(d.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(d.arrayBuffer&&d.blob&&y(t))this._bodyArrayBuffer=u(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!d.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!b(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=u(t)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):d.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},d.blob&&(this.blob=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=a(e);return e.readAsText(t),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},d.formData&&(this.formData=function(){return this.text().then(l)}),this.json=function(){return this.text().then(JSON.parse)},this}function f(t,e){var r=(e=e||{}).body;if(t instanceof f){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new o(t.headers)),this.method=t.method,this.mode=t.mode,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new o(e.headers)),this.method=function(t){var e=t.toUpperCase();return g.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function l(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}}),e}function p(t){var e=new o;return t.split(/\r?\n/).forEach(function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();e.append(n,o)}}),e}function h(t,e){e||(e={}),this.type="default",this.status="status"in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new o(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var d={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(d.arrayBuffer)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],y=function(t){return t&&DataView.prototype.isPrototypeOf(t)},b=ArrayBuffer.isView||function(t){return t&&v.indexOf(Object.prototype.toString.call(t))>-1};o.prototype.append=function(t,n){t=e(t),n=r(n);var o=this.map[t];this.map[t]=o?o+","+n:n},o.prototype.delete=function(t){delete this.map[e(t)]},o.prototype.get=function(t){return t=e(t),this.has(t)?this.map[t]:null},o.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},o.prototype.set=function(t,n){this.map[e(t)]=r(n)},o.prototype.forEach=function(t,e){var r=this;for(var n in this.map)r.map.hasOwnProperty(n)&&t.call(e,r.map[n],n,r)},o.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),n(t)},o.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),n(t)},o.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),n(t)},d.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];f.prototype.clone=function(){return new f(this,{body:this._bodyInit})},c.call(f.prototype),c.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},h.error=function(){var t=new h(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];h.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new h(null,{status:e,headers:{location:t}})},t.Headers=o,t.Request=f,t.Response=h,t.fetch=function(t,e){return new Promise(function(r,n){var o=new f(t,e),i=new XMLHttpRequest;i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:p(i.getAllResponseHeaders()||"")};t.url="responseURL"in i?i.responseURL:t.headers.get("X-Request-URL");var e="response"in i?i.response:i.responseText;r(new h(e,t))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&d.blob&&(i.responseType="blob"),o.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0);var P=n,O={read:function(t,e,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,f=-7,l=r?o-1:0,p=r?-1:1,h=t[e+l];for(l+=p,i=h&(1<<-f)-1,h>>=-f,f+=s;f>0;i=256*i+t[e+l],l+=p,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=256*a+t[e+l],l+=p,f-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},write:function(t,e,r,n,o,i){var a,s,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+l>=1?p/u:p*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*u-1)*Math.pow(2,o),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[r+h]=255&s,h+=d,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;t[r+h]=255&a,h+=d,a/=256,c-=8);t[r+h-d]|=128*v}};n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){var n=this;for(r=r||this.length;this.pos<r;){var o=n.readVarint(),i=o>>3,a=n.pos;n.type=7&o,t(i,e,n),n.pos===a&&n.skip(o)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=y(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=g(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=y(this.buf,this.pos)+4294967296*y(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=y(this.buf,this.pos)+4294967296*g(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=O.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=O.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,o,a=r.buf;if(n=(112&(o=a[r.pos++]))>>4,o<128)return i(t,n,e);if(n|=(127&(o=a[r.pos++]))<<3,o<128)return i(t,n,e);if(n|=(127&(o=a[r.pos++]))<<10,o<128)return i(t,n,e);if(n|=(127&(o=a[r.pos++]))<<17,o<128)return i(t,n,e);if(n|=(127&(o=a[r.pos++]))<<24,o<128)return i(t,n,e);if(n|=(1&(o=a[r.pos++]))<<31,o<128)return i(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,r){for(var n="",o=e;o<r;){var i,a,s,u=t[o],c=null,f=u>239?4:u>223?3:u>191?2:1;if(o+f>r)break;1===f?u<128&&(c=u):2===f?128==(192&(i=t[o+1]))&&(c=(31&u)<<6|63&i)<=127&&(c=null):3===f?(i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&((c=(15&u)<<12|(63&i)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===f&&(i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,f=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),o+=f}return n}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var r=o(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),b(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),b(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),b(this.buf,-1&t,this.pos),b(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),b(this.buf,-1&t,this.pos),b(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,o,i=0;i<e.length;i++){if((n=e.charCodeAt(i))>55295&&n<57344){if(!o){n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=n;continue}n=o-55296<<10|n-56320|65536,o=null}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&a(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),O.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),O.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&a(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){this.writeMessage(t,l,e)},writePackedFloat:function(t,e){this.writeMessage(t,c,e)},writePackedDouble:function(t,e){this.writeMessage(t,f,e)},writePackedFixed32:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,h,e)},writePackedFixed64:function(t,e){this.writeMessage(t,d,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,v,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var M=x;x.prototype={clone:function(){return new x(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,o=r*this.x+e*this.y;return this.x=n,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},x.convert=function(t){return t instanceof x?t:Array.isArray(t)?new x(t[0],t[1]):t};var A=M,T=m;m.types=["Unknown","Point","LineString","Polygon"],m.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,o=0,i=0,a=0,s=[];t.pos<r;){if(!o){var u=t.readVarint();n=7&u,o=u>>3}if(o--,1===n||2===n)i+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new A(i,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},m.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,o=0,i=0,a=1/0,s=-1/0,u=1/0,c=-1/0;t.pos<e;){if(!n){var f=t.readVarint();r=7&f,n=f>>3}if(n--,1===r||2===r)(o+=t.readSVarint())<a&&(a=o),o>s&&(s=o),(i+=t.readSVarint())<u&&(u=i),i>c&&(c=i);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,c]},m.prototype.toGeoJSON=function(t,e,r){function n(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+u)/a;t[e]=[360*(r.x+s)/a-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}var o,i,a=this.extent*Math.pow(2,r),s=this.extent*t,u=this.extent*e,c=this.loadGeometry(),f=m.types[this.type];switch(this.type){case 1:var l=[];for(o=0;o<c.length;o++)l[o]=c[o][0];n(c=l);break;case 2:for(o=0;o<c.length;o++)n(c[o]);break;case 3:for(c=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,o=[],i=0;i<e;i++){var a=w(t[i]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&o.push(r),r=[t[i]]):r.push(t[i]))}return r&&o.push(r),o}(c),o=0;o<c.length;o++)for(i=0;i<c[o].length;i++)n(c[o][i])}1===c.length?c=c[0]:f="Multi"+f;var p={type:"Feature",geometry:{type:f,coordinates:c},properties:this.properties};return"id"in this&&(p.id=this.id),p};var k=T,B=j;j.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new k(this._pbf,e,this.extent,this._keys,this._values)};var E=B,V=function(t,e){this.layers=t.readFields(F,{},e)};L.SVG.Tile=L.SVG.extend({initialize:function(t,e,r){L.SVG.prototype.initialize.call(this,r),this._tileCoord=t,this._size=e,this._initContainer(),this._container.setAttribute("width",this._size.x),this._container.setAttribute("height",this._size.y),this._container.setAttribute("viewBox",[0,0,this._size.x,this._size.y].join(" ")),this._layers={}},getCoord:function(){return this._tileCoord},getContainer:function(){return this._container},onAdd:L.Util.falseFn,addTo:function(t){if(this._map=t,this.options.interactive)for(var e in this._layers){var r=this._layers[e];r._path.style.pointerEvents="auto",this._map._targets[L.stamp(r._path)]=r}},removeFrom:function(t){if(this.options.interactive)for(var e in this._layers){var r=this._layers[e];delete this._map._targets[L.stamp(r._path)]}delete this._map},_initContainer:function(){L.SVG.prototype._initContainer.call(this),L.SVG.create("rect")},_addPath:function(t){this._rootGroup.appendChild(t._path),this._layers[L.stamp(t)]=t},_updateIcon:function(t){var e=t._path=L.SVG.create("image"),r=t.options.icon.options,n=L.point(r.iconSize),o=r.iconAnchor||n&&n.divideBy(2,!0),i=t._point.subtract(o);e.setAttribute("x",i.x),e.setAttribute("y",i.y),e.setAttribute("width",n.x+"px"),e.setAttribute("height",n.y+"px"),e.setAttribute("href",r.iconUrl)}}),L.svg.tile=function(t,e,r){return new L.SVG.Tile(t,e,r)};var C=L.Class.extend({render:function(t,e){this._renderer=t,this.options=e,t._initPath(this),t._updateStyle(this)},updateStyle:function(t,e){this.options=e,t._updateStyle(this)},_getPixelBounds:function(){for(var t=this._parts,e=L.bounds([]),r=0;r<t.length;r++)for(var n=t[r],o=0;o<n.length;o++)e.extend(n[o]);var i=this._clickTolerance(),a=new L.Point(i,i);return e.min._subtract(a),e.max._add(a),e},_clickTolerance:L.Path.prototype._clickTolerance}),z={_makeFeatureParts:function(t,e){var r,n=t.geometry;this._parts=[];for(var o=0;o<n.length;o++){for(var i=n[o],a=[],s=0;s<i.length;s++)r=i[s],a.push(L.point(r).scaleBy(e));this._parts.push(a)}},makeInteractive:function(){this._pxBounds=this._getPixelBounds()}},I=L.CircleMarker.extend({includes:C.prototype,statics:{iconCache:{}},initialize:function(t,e){this.properties=t.properties,this._makeFeatureParts(t,e)},render:function(t,e){C.prototype.render.call(this,t,e),this._radius=e.radius||L.CircleMarker.prototype.options.radius,this._updatePath()},_makeFeatureParts:function(t,e){var r=t.geometry[0];"object"==typeof r[0]&&"x"in r[0]?(this._point=L.point(r[0]).scaleBy(e),this._empty=L.Util.falseFn):(this._point=L.point(r).scaleBy(e),this._empty=L.Util.falseFn)},makeInteractive:function(){this._updateBounds()},updateStyle:function(t,e){return this._radius=e.radius||this._radius,this._updateBounds(),C.prototype.updateStyle.call(this,t,e)},_updateBounds:function(){var t=this.options.icon;if(t){var e=L.point(t.options.iconSize),r=t.options.iconAnchor||e&&e.divideBy(2,!0),n=this._point.subtract(r);this._pxBounds=new L.Bounds(n,n.add(t.options.iconSize))}else L.CircleMarker.prototype._updateBounds.call(this)},_updatePath:function(){this.options.icon?this._renderer._updateIcon(this):L.CircleMarker.prototype._updatePath.call(this)},_getImage:function(){if(this.options.icon){var t=this.options.icon.options.iconUrl,e=I.iconCache[t];if(!e){var r=this.options.icon;e=I.iconCache[t]=r.createIcon()}return e}return null},_containsPoint:function(t){return this.options.icon?this._pxBounds.contains(t):L.CircleMarker.prototype._containsPoint.call(this,t)}}),U=L.Polyline.extend({includes:[C.prototype,z],initialize:function(t,e){this.properties=t.properties,this._makeFeatureParts(t,e)},render:function(t,e){e.fill=!1,C.prototype.render.call(this,t,e),this._updatePath()},updateStyle:function(t,e){e.fill=!1,C.prototype.updateStyle.call(this,t,e)}}),D=L.Polygon.extend({includes:[C.prototype,z],initialize:function(t,e){this.properties=t.properties,this._makeFeatureParts(t,e)},render:function(t,e){C.prototype.render.call(this,t,e),this._updatePath()}});L.VectorGrid=L.GridLayer.extend({options:{rendererFactory:L.svg.tile,vectorTileLayerStyles:{},interactive:!1},initialize:function(t){L.setOptions(this,t),L.GridLayer.prototype.initialize.apply(this,arguments),this.options.getFeatureId&&(this._vectorTiles={},this._overriddenStyles={},this.on("tileunload",function(t){var e=this._tileCoordsToKey(t.coords),r=this._vectorTiles[e];r&&this._map&&r.removeFrom(this._map),delete this._vectorTiles[e]},this)),this._dataLayerNames={}},createTile:function(t,e){var r=this.options.getFeatureId,n=this.getTileSize(),o=this.options.rendererFactory(t,n,this.options),i=this._getVectorTilePromise(t);return r&&(this._vectorTiles[this._tileCoordsToKey(t)]=o,o._features={}),i.then(function(n){for(var i in n.layers){this._dataLayerNames[i]=!0;for(var a=n.layers[i],s=this.getTileSize().divideBy(a.extent),u=this.options.vectorTileLayerStyles[i]||L.Path.prototype.options,c=0;c<a.features.length;c++){var f,l=a.features[c],p=u;if(r){f=this.options.getFeatureId(l);var h=this._overriddenStyles[f];h&&(p=h[i]?h[i]:h)}if(p instanceof Function&&(p=p(l.properties,t.z)),p instanceof Array||(p=[p]),p.length){for(var d=this._createLayer(l,s),v=0;v<p.length;v++){var y=L.extend({},L.Path.prototype.options,p[v]);d.render(o,y),o._addPath(d)}this.options.interactive&&d.makeInteractive(),r&&(o._features[f]={layerName:i,feature:d})}}}null!=this._map&&o.addTo(this._map),L.Util.requestAnimFrame(e.bind(t,null,null))}.bind(this)),o.getContainer()},setFeatureStyle:function(t,e){for(var r in this._overriddenStyles[t]=e,this._vectorTiles){var n=this._vectorTiles[r],o=n._features[t];if(o){var i=o.feature,a=e;e[o.layerName]&&(a=e[o.layerName]),this._updateStyles(i,n,a)}}return this},resetFeatureStyle:function(t){for(var e in delete this._overriddenStyles[t],this._vectorTiles){var r=this._vectorTiles[e],n=r._features[t];if(n){var o=n.feature,i=this.options.vectorTileLayerStyles[n.layerName]||L.Path.prototype.options;this._updateStyles(o,r,i)}}return this},getDataLayerNames:function(){return Object.keys(this._dataLayerNames)},_updateStyles:function(t,e,r){(r=r instanceof Function?r(t.properties,e.getCoord().z):r)instanceof Array||(r=[r]);for(var n=0;n<r.length;n++){var o=L.extend({},L.Path.prototype.options,r[n]);t.updateStyle(e,o)}},_createLayer:function(t,e,r){var n;switch(t.type){case 1:n=new I(t,e);break;case 2:n=new U(t,e);break;case 3:n=new D(t,e)}return this.options.interactive&&n.addEventParent(this),n}}),L.vectorGrid=function(t){return new L.VectorGrid(t)},L.VectorGrid.Protobuf=L.VectorGrid.extend({options:{subdomains:"abc",fetchOptions:{}},initialize:function(t,e){this._url=t,L.VectorGrid.prototype.initialize.call(this,e)},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},_getSubdomain:L.TileLayer.prototype._getSubdomain,_getVectorTilePromise:function(t){var e={s:this._getSubdomain(t),x:t.x,y:t.y,z:t.z};if(this._map&&!this._map.options.crs.infinite){var r=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=r),e["-y"]=r}var n=L.Util.template(this._url,L.extend(e,this.options));return fetch(n,this.options.fetchOptions).then(function(t){return t.ok?t.blob().then(function(t){var e=new FileReader;return new Promise(function(r){e.addEventListener("loadend",function(){var t=new P(e.result);return r(new V(t))}),e.readAsArrayBuffer(t)})}):{layers:[]}}).then(function(t){for(var e in t.layers){for(var r=[],n=0;n<t.layers[e].length;n++){var o=t.layers[e].feature(n);o.geometry=o.loadGeometry(),r.push(o)}t.layers[e].features=r}return t})}}),L.vectorGrid.protobuf=function(t,e){return new L.VectorGrid.Protobuf(t,e)};var G=function(t,e,r){try{return window.URL.createObjectURL(new Blob([Uint8Array.from(t.split("").map(function(t){return t.charCodeAt(0)}))],{type:e}))}catch(n){return"data:"+e+(r?";base64,":",")+t}}('"use strict";function simplify$1(e,t){var r,n,o,i,a=t*t,s=e.length,l=0,u=s-1,c=[];for(e[l][2]=1,e[u][2]=1;u;){for(n=0,r=l+1;r<u;r++)(o=getSqSegDist(e[r],e[l],e[u]))>n&&(i=r,n=o);n>a?(e[i][2]=n,c.push(l),c.push(i),l=i):(u=c.pop(),l=c.pop())}}function getSqSegDist(e,t,r){var n=t[0],o=t[1],i=r[0],a=r[1],s=e[0],l=e[1],u=i-n,c=a-o;if(0!==u||0!==c){var f=((s-n)*u+(l-o)*c)/(u*u+c*c);f>1?(n=i,o=a):f>0&&(n+=u*f,o+=c*f)}return u=s-n,c=l-o,u*u+c*c}function convert$1(e,t){var r=[];if("FeatureCollection"===e.type)for(var n=0;n<e.features.length;n++)convertFeature(r,e.features[n],t);else"Feature"===e.type?convertFeature(r,e,t):convertFeature(r,{geometry:e},t);return r}function convertFeature(e,t,r){if(null!==t.geometry){var n,o,i,a,s=t.geometry,l=s.type,u=s.coordinates,c=t.properties;if("Point"===l)e.push(create(c,1,[projectPoint(u)]));else if("MultiPoint"===l)e.push(create(c,1,project(u)));else if("LineString"===l)e.push(create(c,2,[project(u,r)]));else if("MultiLineString"===l||"Polygon"===l){for(i=[],n=0;n<u.length;n++)a=project(u[n],r),"Polygon"===l&&(a.outer=0===n),i.push(a);e.push(create(c,"Polygon"===l?3:2,i