function VectorTile(e,t){this.layers=e.readFields(readTile,{},t)}function readTile(e,t,r){if(3===e){var a=new VectorTileLayer(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}function VectorTileLayer(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(readLayer,this,t),this.length=this._features.length}function readLayer(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(readValueMessage(r))}function readValueMessage(e){for(var t=null,r=e.readVarint()+e.pos;e.pos>3;t=1===a?e.readString():2===a?e.readFloat():3===a?e.readDouble():4===a?e.readVarint64():5===a?e.readVarint():6===a?e.readSVarint():7===a?e.readBoolean():null}return t}function VectorTileFeature(e,t,r,a,i){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=a,this._values=i,e.readFields(readFeature,this,t)}function readFeature(e,t,r){1==e?t.id=r.readVarint():2==e?readTag(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function readTag(e,t){for(var r=e.readVarint()+e.pos;e.pos=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new VectorTileFeature(this._pbf,t,this.extent,this._keys,this._values)},VectorTileFeature.types=["Unknown","Point","LineString","Polygon"],VectorTileFeature.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,a=1,i=0,n=0,s=0,o=[];e.pos>3}if(i--,1===a||2===a)n+=e.readSVarint(),s+=e.readSVarint(),1===a&&(t&&o.push(t),t=[]),t.push(new Point(n,s));else{if(7!==a)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&o.push(t),o},VectorTileFeature.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,a=0,i=0,n=0,s=1/0,o=-1/0,h=1/0,u=-1/0;e.pos>3}if(a--,1===r||2===r)(i+=e.readSVarint())o&&(o=i),(n+=e.readSVarint())u&&(u=n);else if(7!==r)throw new Error("unknown command "+r)}return[s,h,o,u]},VectorTileFeature.prototype.toGeoJSON=function(e,t,r){var a,i,n=this.extent*Math.pow(2,r),s=this.extent*e,o=this.extent*t,h=this.loadGeometry(),u=VectorTileFeature.types[this.type];function p(e){for(var t=0;t