UNPKG

cesium

Version:

CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin.

1 lines 207 kB
window.cesiumGoogleEarthDbRootParser=function(e){"use strict";var r,t,o=e.Reader,a=(e.Writer,e.util),n=[],i=e.roots.default||(e.roots.default={});return i.keyhole=((t={}).dbroot=((r={}).StringEntryProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}return r.prototype.stringId=0,r.prototype.stringValue="",r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var t=void 0===r?e.len:e.pos+r,a=new i.keyhole.dbroot.StringEntryProto;e.pos<t;){var n=e.uint32();switch(n>>>3){case 1:a.stringId=e.fixed32();break;case 2:a.stringValue=e.string();break;default:e.skipType(7&n)}}return a},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":a.isInteger(e.stringId)?a.isString(e.stringValue)?null:"stringValue: string expected":"stringId: integer expected"},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.StringEntryProto)return e;var r=new i.keyhole.dbroot.StringEntryProto;return void 0!==e.stringId&&null!==e.stringId&&(r.stringId=e.stringId>>>0),void 0!==e.stringValue&&null!==e.stringValue&&(r.stringValue=String(e.stringValue)),r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var t={};return r.defaults&&(t.stringId=0,t.stringValue=""),void 0!==e.stringId&&null!==e.stringId&&e.hasOwnProperty("stringId")&&(t.stringId=e.stringId),void 0!==e.stringValue&&null!==e.stringValue&&e.hasOwnProperty("stringValue")&&(t.stringValue=e.stringValue),t},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),r.StringIdOrValueProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}return r.prototype.stringId=0,r.prototype.value="",r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var t=void 0===r?e.len:e.pos+r,a=new i.keyhole.dbroot.StringIdOrValueProto;e.pos<t;){var n=e.uint32();switch(n>>>3){case 1:a.stringId=e.fixed32();break;case 2:a.value=e.string();break;default:e.skipType(7&n)}}return a},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.stringId||a.isInteger(e.stringId)?void 0===e.value||a.isString(e.value)?null:"value: string expected":"stringId: integer expected"},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.StringIdOrValueProto)return e;var r=new i.keyhole.dbroot.StringIdOrValueProto;return void 0!==e.stringId&&null!==e.stringId&&(r.stringId=e.stringId>>>0),void 0!==e.value&&null!==e.value&&(r.value=String(e.value)),r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var t={};return r.defaults&&(t.stringId=0,t.value=""),void 0!==e.stringId&&null!==e.stringId&&e.hasOwnProperty("stringId")&&(t.stringId=e.stringId),void 0!==e.value&&null!==e.value&&e.hasOwnProperty("value")&&(t.value=e.value),t},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),r.PlanetModelProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}return r.prototype.radius=6378.137,r.prototype.flattening=.00335281066474748,r.prototype.elevationBias=0,r.prototype.negativeAltitudeExponentBias=0,r.prototype.compressedNegativeAltitudeThreshold=0,r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var t=void 0===r?e.len:e.pos+r,a=new i.keyhole.dbroot.PlanetModelProto;e.pos<t;){var n=e.uint32();switch(n>>>3){case 1:a.radius=e.double();break;case 2:a.flattening=e.double();break;case 4:a.elevationBias=e.double();break;case 5:a.negativeAltitudeExponentBias=e.int32();break;case 6:a.compressedNegativeAltitudeThreshold=e.double();break;default:e.skipType(7&n)}}return a},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.radius&&"number"!=typeof e.radius?"radius: number expected":void 0!==e.flattening&&"number"!=typeof e.flattening?"flattening: number expected":void 0!==e.elevationBias&&"number"!=typeof e.elevationBias?"elevationBias: number expected":void 0===e.negativeAltitudeExponentBias||a.isInteger(e.negativeAltitudeExponentBias)?void 0!==e.compressedNegativeAltitudeThreshold&&"number"!=typeof e.compressedNegativeAltitudeThreshold?"compressedNegativeAltitudeThreshold: number expected":null:"negativeAltitudeExponentBias: integer expected"},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.PlanetModelProto)return e;var r=new i.keyhole.dbroot.PlanetModelProto;return void 0!==e.radius&&null!==e.radius&&(r.radius=Number(e.radius)),void 0!==e.flattening&&null!==e.flattening&&(r.flattening=Number(e.flattening)),void 0!==e.elevationBias&&null!==e.elevationBias&&(r.elevationBias=Number(e.elevationBias)),void 0!==e.negativeAltitudeExponentBias&&null!==e.negativeAltitudeExponentBias&&(r.negativeAltitudeExponentBias=0|e.negativeAltitudeExponentBias),void 0!==e.compressedNegativeAltitudeThreshold&&null!==e.compressedNegativeAltitudeThreshold&&(r.compressedNegativeAltitudeThreshold=Number(e.compressedNegativeAltitudeThreshold)),r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var t={};return r.defaults&&(t.radius=6378.137,t.flattening=.00335281066474748,t.elevationBias=0,t.negativeAltitudeExponentBias=0,t.compressedNegativeAltitudeThreshold=0),void 0!==e.radius&&null!==e.radius&&e.hasOwnProperty("radius")&&(t.radius=e.radius),void 0!==e.flattening&&null!==e.flattening&&e.hasOwnProperty("flattening")&&(t.flattening=e.flattening),void 0!==e.elevationBias&&null!==e.elevationBias&&e.hasOwnProperty("elevationBias")&&(t.elevationBias=e.elevationBias),void 0!==e.negativeAltitudeExponentBias&&null!==e.negativeAltitudeExponentBias&&e.hasOwnProperty("negativeAltitudeExponentBias")&&(t.negativeAltitudeExponentBias=e.negativeAltitudeExponentBias),void 0!==e.compressedNegativeAltitudeThreshold&&null!==e.compressedNegativeAltitudeThreshold&&e.hasOwnProperty("compressedNegativeAltitudeThreshold")&&(t.compressedNegativeAltitudeThreshold=e.compressedNegativeAltitudeThreshold),t},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),r.ProviderInfoProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}r.prototype.providerId=0,r.prototype.copyrightString=null,r.prototype.verticalPixelOffset=-1;var t={1:"keyhole.dbroot.StringIdOrValueProto"};return n.push(t),r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var a=void 0===r?e.len:e.pos+r,n=new i.keyhole.dbroot.ProviderInfoProto;e.pos<a;){var l=e.uint32();switch(l>>>3){case 1:n.providerId=e.int32();break;case 2:n.copyrightString=t[1].decode(e,e.uint32());break;case 3:n.verticalPixelOffset=e.int32();break;default:e.skipType(7&l)}}return n},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!a.isInteger(e.providerId))return"providerId: integer expected";if(void 0!==e.copyrightString&&null!==e.copyrightString){var r=t[1].verify(e.copyrightString);if(r)return"copyrightString."+r}return void 0===e.verticalPixelOffset||a.isInteger(e.verticalPixelOffset)?null:"verticalPixelOffset: integer expected"},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.ProviderInfoProto)return e;var r=new i.keyhole.dbroot.ProviderInfoProto;if(void 0!==e.providerId&&null!==e.providerId&&(r.providerId=0|e.providerId),void 0!==e.copyrightString&&null!==e.copyrightString){if("object"!=typeof e.copyrightString)throw TypeError(".keyhole.dbroot.ProviderInfoProto.copyrightString: object expected");r.copyrightString=t[1].fromObject(e.copyrightString)}return void 0!==e.verticalPixelOffset&&null!==e.verticalPixelOffset&&(r.verticalPixelOffset=0|e.verticalPixelOffset),r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var o={};return r.defaults&&(o.providerId=0,o.copyrightString=null,o.verticalPixelOffset=-1),void 0!==e.providerId&&null!==e.providerId&&e.hasOwnProperty("providerId")&&(o.providerId=e.providerId),void 0!==e.copyrightString&&null!==e.copyrightString&&e.hasOwnProperty("copyrightString")&&(o.copyrightString=t[1].toObject(e.copyrightString,r)),void 0!==e.verticalPixelOffset&&null!==e.verticalPixelOffset&&e.hasOwnProperty("verticalPixelOffset")&&(o.verticalPixelOffset=e.verticalPixelOffset),o},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),r.PopUpProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}r.prototype.isBalloonStyle=!1,r.prototype.text=null,r.prototype.backgroundColorAbgr=4294967295,r.prototype.textColorAbgr=4278190080;var t={1:"keyhole.dbroot.StringIdOrValueProto"};return n.push(t),r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var a=void 0===r?e.len:e.pos+r,n=new i.keyhole.dbroot.PopUpProto;e.pos<a;){var l=e.uint32();switch(l>>>3){case 1:n.isBalloonStyle=e.bool();break;case 2:n.text=t[1].decode(e,e.uint32());break;case 3:n.backgroundColorAbgr=e.fixed32();break;case 4:n.textColorAbgr=e.fixed32();break;default:e.skipType(7&l)}}return n},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.isBalloonStyle&&"boolean"!=typeof e.isBalloonStyle)return"isBalloonStyle: boolean expected";if(void 0!==e.text&&null!==e.text){var r=t[1].verify(e.text);if(r)return"text."+r}return void 0===e.backgroundColorAbgr||a.isInteger(e.backgroundColorAbgr)?void 0===e.textColorAbgr||a.isInteger(e.textColorAbgr)?null:"textColorAbgr: integer expected":"backgroundColorAbgr: integer expected"},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.PopUpProto)return e;var r=new i.keyhole.dbroot.PopUpProto;if(void 0!==e.isBalloonStyle&&null!==e.isBalloonStyle&&(r.isBalloonStyle=Boolean(e.isBalloonStyle)),void 0!==e.text&&null!==e.text){if("object"!=typeof e.text)throw TypeError(".keyhole.dbroot.PopUpProto.text: object expected");r.text=t[1].fromObject(e.text)}return void 0!==e.backgroundColorAbgr&&null!==e.backgroundColorAbgr&&(r.backgroundColorAbgr=e.backgroundColorAbgr>>>0),void 0!==e.textColorAbgr&&null!==e.textColorAbgr&&(r.textColorAbgr=e.textColorAbgr>>>0),r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var o={};return r.defaults&&(o.isBalloonStyle=!1,o.text=null,o.backgroundColorAbgr=4294967295,o.textColorAbgr=4278190080),void 0!==e.isBalloonStyle&&null!==e.isBalloonStyle&&e.hasOwnProperty("isBalloonStyle")&&(o.isBalloonStyle=e.isBalloonStyle),void 0!==e.text&&null!==e.text&&e.hasOwnProperty("text")&&(o.text=t[1].toObject(e.text,r)),void 0!==e.backgroundColorAbgr&&null!==e.backgroundColorAbgr&&e.hasOwnProperty("backgroundColorAbgr")&&(o.backgroundColorAbgr=e.backgroundColorAbgr),void 0!==e.textColorAbgr&&null!==e.textColorAbgr&&e.hasOwnProperty("textColorAbgr")&&(o.textColorAbgr=e.textColorAbgr),o},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),r.StyleAttributeProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}r.prototype.styleId="",r.prototype.providerId=0,r.prototype.polyColorAbgr=4294967295,r.prototype.lineColorAbgr=4294967295,r.prototype.lineWidth=1,r.prototype.labelColorAbgr=4294967295,r.prototype.labelScale=1,r.prototype.placemarkIconColorAbgr=4294967295,r.prototype.placemarkIconScale=1,r.prototype.placemarkIconPath=null,r.prototype.placemarkIconX=0,r.prototype.placemarkIconY=0,r.prototype.placemarkIconWidth=32,r.prototype.placemarkIconHeight=32,r.prototype.popUp=null,r.prototype.drawFlag=a.emptyArray;var t={9:"keyhole.dbroot.StringIdOrValueProto",14:"keyhole.dbroot.PopUpProto",15:"keyhole.dbroot.DrawFlagProto"};return n.push(t),r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var a=void 0===r?e.len:e.pos+r,n=new i.keyhole.dbroot.StyleAttributeProto;e.pos<a;){var l=e.uint32();switch(l>>>3){case 1:n.styleId=e.string();break;case 3:n.providerId=e.int32();break;case 4:n.polyColorAbgr=e.fixed32();break;case 5:n.lineColorAbgr=e.fixed32();break;case 6:n.lineWidth=e.float();break;case 7:n.labelColorAbgr=e.fixed32();break;case 8:n.labelScale=e.float();break;case 9:n.placemarkIconColorAbgr=e.fixed32();break;case 10:n.placemarkIconScale=e.float();break;case 11:n.placemarkIconPath=t[9].decode(e,e.uint32());break;case 12:n.placemarkIconX=e.int32();break;case 13:n.placemarkIconY=e.int32();break;case 14:n.placemarkIconWidth=e.int32();break;case 15:n.placemarkIconHeight=e.int32();break;case 16:n.popUp=t[14].decode(e,e.uint32());break;case 17:n.drawFlag&&n.drawFlag.length||(n.drawFlag=[]),n.drawFlag.push(t[15].decode(e,e.uint32()));break;default:e.skipType(7&l)}}return n},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!a.isString(e.styleId))return"styleId: string expected";if(void 0!==e.providerId&&!a.isInteger(e.providerId))return"providerId: integer expected";if(void 0!==e.polyColorAbgr&&!a.isInteger(e.polyColorAbgr))return"polyColorAbgr: integer expected";if(void 0!==e.lineColorAbgr&&!a.isInteger(e.lineColorAbgr))return"lineColorAbgr: integer expected";if(void 0!==e.lineWidth&&"number"!=typeof e.lineWidth)return"lineWidth: number expected";if(void 0!==e.labelColorAbgr&&!a.isInteger(e.labelColorAbgr))return"labelColorAbgr: integer expected";if(void 0!==e.labelScale&&"number"!=typeof e.labelScale)return"labelScale: number expected";if(void 0!==e.placemarkIconColorAbgr&&!a.isInteger(e.placemarkIconColorAbgr))return"placemarkIconColorAbgr: integer expected";if(void 0!==e.placemarkIconScale&&"number"!=typeof e.placemarkIconScale)return"placemarkIconScale: number expected";if(void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath&&(o=t[9].verify(e.placemarkIconPath)))return"placemarkIconPath."+o;if(void 0!==e.placemarkIconX&&!a.isInteger(e.placemarkIconX))return"placemarkIconX: integer expected";if(void 0!==e.placemarkIconY&&!a.isInteger(e.placemarkIconY))return"placemarkIconY: integer expected";if(void 0!==e.placemarkIconWidth&&!a.isInteger(e.placemarkIconWidth))return"placemarkIconWidth: integer expected";if(void 0!==e.placemarkIconHeight&&!a.isInteger(e.placemarkIconHeight))return"placemarkIconHeight: integer expected";if(void 0!==e.popUp&&null!==e.popUp&&(o=t[14].verify(e.popUp)))return"popUp."+o;if(void 0!==e.drawFlag){if(!Array.isArray(e.drawFlag))return"drawFlag: array expected";for(var r=0;r<e.drawFlag.length;++r){var o;if(o=t[15].verify(e.drawFlag[r]))return"drawFlag."+o}}return null},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.StyleAttributeProto)return e;var r=new i.keyhole.dbroot.StyleAttributeProto;if(void 0!==e.styleId&&null!==e.styleId&&(r.styleId=String(e.styleId)),void 0!==e.providerId&&null!==e.providerId&&(r.providerId=0|e.providerId),void 0!==e.polyColorAbgr&&null!==e.polyColorAbgr&&(r.polyColorAbgr=e.polyColorAbgr>>>0),void 0!==e.lineColorAbgr&&null!==e.lineColorAbgr&&(r.lineColorAbgr=e.lineColorAbgr>>>0),void 0!==e.lineWidth&&null!==e.lineWidth&&(r.lineWidth=Number(e.lineWidth)),void 0!==e.labelColorAbgr&&null!==e.labelColorAbgr&&(r.labelColorAbgr=e.labelColorAbgr>>>0),void 0!==e.labelScale&&null!==e.labelScale&&(r.labelScale=Number(e.labelScale)),void 0!==e.placemarkIconColorAbgr&&null!==e.placemarkIconColorAbgr&&(r.placemarkIconColorAbgr=e.placemarkIconColorAbgr>>>0),void 0!==e.placemarkIconScale&&null!==e.placemarkIconScale&&(r.placemarkIconScale=Number(e.placemarkIconScale)),void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath){if("object"!=typeof e.placemarkIconPath)throw TypeError(".keyhole.dbroot.StyleAttributeProto.placemarkIconPath: object expected");r.placemarkIconPath=t[9].fromObject(e.placemarkIconPath)}if(void 0!==e.placemarkIconX&&null!==e.placemarkIconX&&(r.placemarkIconX=0|e.placemarkIconX),void 0!==e.placemarkIconY&&null!==e.placemarkIconY&&(r.placemarkIconY=0|e.placemarkIconY),void 0!==e.placemarkIconWidth&&null!==e.placemarkIconWidth&&(r.placemarkIconWidth=0|e.placemarkIconWidth),void 0!==e.placemarkIconHeight&&null!==e.placemarkIconHeight&&(r.placemarkIconHeight=0|e.placemarkIconHeight),void 0!==e.popUp&&null!==e.popUp){if("object"!=typeof e.popUp)throw TypeError(".keyhole.dbroot.StyleAttributeProto.popUp: object expected");r.popUp=t[14].fromObject(e.popUp)}if(e.drawFlag){if(!Array.isArray(e.drawFlag))throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: array expected");r.drawFlag=[];for(var o=0;o<e.drawFlag.length;++o){if("object"!=typeof e.drawFlag[o])throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: object expected");r.drawFlag[o]=t[15].fromObject(e.drawFlag[o])}}return r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var o={};if((r.arrays||r.defaults)&&(o.drawFlag=[]),r.defaults&&(o.styleId="",o.providerId=0,o.polyColorAbgr=4294967295,o.lineColorAbgr=4294967295,o.lineWidth=1,o.labelColorAbgr=4294967295,o.labelScale=1,o.placemarkIconColorAbgr=4294967295,o.placemarkIconScale=1,o.placemarkIconPath=null,o.placemarkIconX=0,o.placemarkIconY=0,o.placemarkIconWidth=32,o.placemarkIconHeight=32,o.popUp=null),void 0!==e.styleId&&null!==e.styleId&&e.hasOwnProperty("styleId")&&(o.styleId=e.styleId),void 0!==e.providerId&&null!==e.providerId&&e.hasOwnProperty("providerId")&&(o.providerId=e.providerId),void 0!==e.polyColorAbgr&&null!==e.polyColorAbgr&&e.hasOwnProperty("polyColorAbgr")&&(o.polyColorAbgr=e.polyColorAbgr),void 0!==e.lineColorAbgr&&null!==e.lineColorAbgr&&e.hasOwnProperty("lineColorAbgr")&&(o.lineColorAbgr=e.lineColorAbgr),void 0!==e.lineWidth&&null!==e.lineWidth&&e.hasOwnProperty("lineWidth")&&(o.lineWidth=e.lineWidth),void 0!==e.labelColorAbgr&&null!==e.labelColorAbgr&&e.hasOwnProperty("labelColorAbgr")&&(o.labelColorAbgr=e.labelColorAbgr),void 0!==e.labelScale&&null!==e.labelScale&&e.hasOwnProperty("labelScale")&&(o.labelScale=e.labelScale),void 0!==e.placemarkIconColorAbgr&&null!==e.placemarkIconColorAbgr&&e.hasOwnProperty("placemarkIconColorAbgr")&&(o.placemarkIconColorAbgr=e.placemarkIconColorAbgr),void 0!==e.placemarkIconScale&&null!==e.placemarkIconScale&&e.hasOwnProperty("placemarkIconScale")&&(o.placemarkIconScale=e.placemarkIconScale),void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath&&e.hasOwnProperty("placemarkIconPath")&&(o.placemarkIconPath=t[9].toObject(e.placemarkIconPath,r)),void 0!==e.placemarkIconX&&null!==e.placemarkIconX&&e.hasOwnProperty("placemarkIconX")&&(o.placemarkIconX=e.placemarkIconX),void 0!==e.placemarkIconY&&null!==e.placemarkIconY&&e.hasOwnProperty("placemarkIconY")&&(o.placemarkIconY=e.placemarkIconY),void 0!==e.placemarkIconWidth&&null!==e.placemarkIconWidth&&e.hasOwnProperty("placemarkIconWidth")&&(o.placemarkIconWidth=e.placemarkIconWidth),void 0!==e.placemarkIconHeight&&null!==e.placemarkIconHeight&&e.hasOwnProperty("placemarkIconHeight")&&(o.placemarkIconHeight=e.placemarkIconHeight),void 0!==e.popUp&&null!==e.popUp&&e.hasOwnProperty("popUp")&&(o.popUp=t[14].toObject(e.popUp,r)),void 0!==e.drawFlag&&null!==e.drawFlag&&e.hasOwnProperty("drawFlag")){o.drawFlag=[];for(var a=0;a<e.drawFlag.length;++a)o.drawFlag[a]=t[15].toObject(e.drawFlag[a],r)}return o},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),r.StyleMapProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}return r.prototype.styleMapId=0,r.prototype.channelId=a.emptyArray,r.prototype.normalStyleAttribute=0,r.prototype.highlightStyleAttribute=0,r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var t=void 0===r?e.len:e.pos+r,a=new i.keyhole.dbroot.StyleMapProto;e.pos<t;){var n=e.uint32();switch(n>>>3){case 1:a.styleMapId=e.int32();break;case 2:if(a.channelId&&a.channelId.length||(a.channelId=[]),2==(7&n))for(var l=e.uint32()+e.pos;e.pos<l;)a.channelId.push(e.int32());else a.channelId.push(e.int32());break;case 3:a.normalStyleAttribute=e.int32();break;case 4:a.highlightStyleAttribute=e.int32();break;default:e.skipType(7&n)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!a.isInteger(e.styleMapId))return"styleMapId: integer expected";if(void 0!==e.channelId){if(!Array.isArray(e.channelId))return"channelId: array expected";for(var r=0;r<e.channelId.length;++r)if(!a.isInteger(e.channelId[r]))return"channelId: integer[] expected"}return void 0===e.normalStyleAttribute||a.isInteger(e.normalStyleAttribute)?void 0===e.highlightStyleAttribute||a.isInteger(e.highlightStyleAttribute)?null:"highlightStyleAttribute: integer expected":"normalStyleAttribute: integer expected"},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.StyleMapProto)return e;var r=new i.keyhole.dbroot.StyleMapProto;if(void 0!==e.styleMapId&&null!==e.styleMapId&&(r.styleMapId=0|e.styleMapId),e.channelId){if(!Array.isArray(e.channelId))throw TypeError(".keyhole.dbroot.StyleMapProto.channelId: array expected");r.channelId=[];for(var t=0;t<e.channelId.length;++t)r.channelId[t]=0|e.channelId[t]}return void 0!==e.normalStyleAttribute&&null!==e.normalStyleAttribute&&(r.normalStyleAttribute=0|e.normalStyleAttribute),void 0!==e.highlightStyleAttribute&&null!==e.highlightStyleAttribute&&(r.highlightStyleAttribute=0|e.highlightStyleAttribute),r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var t={};if((r.arrays||r.defaults)&&(t.channelId=[]),r.defaults&&(t.styleMapId=0,t.normalStyleAttribute=0,t.highlightStyleAttribute=0),void 0!==e.styleMapId&&null!==e.styleMapId&&e.hasOwnProperty("styleMapId")&&(t.styleMapId=e.styleMapId),void 0!==e.channelId&&null!==e.channelId&&e.hasOwnProperty("channelId")){t.channelId=[];for(var o=0;o<e.channelId.length;++o)t.channelId[o]=e.channelId[o]}return void 0!==e.normalStyleAttribute&&null!==e.normalStyleAttribute&&e.hasOwnProperty("normalStyleAttribute")&&(t.normalStyleAttribute=e.normalStyleAttribute),void 0!==e.highlightStyleAttribute&&null!==e.highlightStyleAttribute&&e.hasOwnProperty("highlightStyleAttribute")&&(t.highlightStyleAttribute=e.highlightStyleAttribute),t},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),r.ZoomRangeProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}return r.prototype.minZoom=0,r.prototype.maxZoom=0,r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var t=void 0===r?e.len:e.pos+r,a=new i.keyhole.dbroot.ZoomRangeProto;e.pos<t;){var n=e.uint32();switch(n>>>3){case 1:a.minZoom=e.int32();break;case 2:a.maxZoom=e.int32();break;default:e.skipType(7&n)}}return a},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":a.isInteger(e.minZoom)?a.isInteger(e.maxZoom)?null:"maxZoom: integer expected":"minZoom: integer expected"},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.ZoomRangeProto)return e;var r=new i.keyhole.dbroot.ZoomRangeProto;return void 0!==e.minZoom&&null!==e.minZoom&&(r.minZoom=0|e.minZoom),void 0!==e.maxZoom&&null!==e.maxZoom&&(r.maxZoom=0|e.maxZoom),r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var t={};return r.defaults&&(t.minZoom=0,t.maxZoom=0),void 0!==e.minZoom&&null!==e.minZoom&&e.hasOwnProperty("minZoom")&&(t.minZoom=e.minZoom),void 0!==e.maxZoom&&null!==e.maxZoom&&e.hasOwnProperty("maxZoom")&&(t.maxZoom=e.maxZoom),t},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),r.DrawFlagProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}r.prototype.drawFlagType=1;var t,a={0:"keyhole.dbroot.DrawFlagProto.DrawFlagType"};return n.push(a),r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var t=void 0===r?e.len:e.pos+r,a=new i.keyhole.dbroot.DrawFlagProto;e.pos<t;){var n=e.uint32();n>>>3==1?a.drawFlagType=e.uint32():e.skipType(7&n)}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";switch(e.drawFlagType){default:return"drawFlagType: enum value expected";case 1:case 2:case 3:case 4:case 5:}return null},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.DrawFlagProto)return e;var r=new i.keyhole.dbroot.DrawFlagProto;switch(e.drawFlagType){case"TYPE_FILL_ONLY":case 1:r.drawFlagType=1;break;case"TYPE_OUTLINE_ONLY":case 2:r.drawFlagType=2;break;case"TYPE_FILL_AND_OUTLINE":case 3:r.drawFlagType=3;break;case"TYPE_ANTIALIASING":case 4:r.drawFlagType=4;break;case"TYPE_CENTER_LABEL":case 5:r.drawFlagType=5}return r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var t={};return r.defaults&&(t.drawFlagType=r.enums===String?"TYPE_FILL_ONLY":1),void 0!==e.drawFlagType&&null!==e.drawFlagType&&e.hasOwnProperty("drawFlagType")&&(t.drawFlagType=r.enums===String?a[0][e.drawFlagType]:e.drawFlagType),t},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r.DrawFlagType=((t=Object.create({})).TYPE_FILL_ONLY=1,t.TYPE_OUTLINE_ONLY=2,t.TYPE_FILL_AND_OUTLINE=3,t.TYPE_ANTIALIASING=4,t.TYPE_CENTER_LABEL=5,t),r}(),r.LayerProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}r.prototype.zoomRange=a.emptyArray,r.prototype.preserveTextLevel=30,r.prototype.lodBeginTransition=!1,r.prototype.lodEndTransition=!1;var t={0:"keyhole.dbroot.ZoomRangeProto"};return n.push(t),r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var a=void 0===r?e.len:e.pos+r,n=new i.keyhole.dbroot.LayerProto;e.pos<a;){var l=e.uint32();switch(l>>>3){case 1:n.zoomRange&&n.zoomRange.length||(n.zoomRange=[]),n.zoomRange.push(t[0].decode(e,e.uint32()));break;case 2:n.preserveTextLevel=e.int32();break;case 4:n.lodBeginTransition=e.bool();break;case 5:n.lodEndTransition=e.bool();break;default:e.skipType(7&l)}}return n},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.zoomRange){if(!Array.isArray(e.zoomRange))return"zoomRange: array expected";for(var r=0;r<e.zoomRange.length;++r){var o=t[0].verify(e.zoomRange[r]);if(o)return"zoomRange."+o}}return void 0===e.preserveTextLevel||a.isInteger(e.preserveTextLevel)?void 0!==e.lodBeginTransition&&"boolean"!=typeof e.lodBeginTransition?"lodBeginTransition: boolean expected":void 0!==e.lodEndTransition&&"boolean"!=typeof e.lodEndTransition?"lodEndTransition: boolean expected":null:"preserveTextLevel: integer expected"},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.LayerProto)return e;var r=new i.keyhole.dbroot.LayerProto;if(e.zoomRange){if(!Array.isArray(e.zoomRange))throw TypeError(".keyhole.dbroot.LayerProto.zoomRange: array expected");r.zoomRange=[];for(var o=0;o<e.zoomRange.length;++o){if("object"!=typeof e.zoomRange[o])throw TypeError(".keyhole.dbroot.LayerProto.zoomRange: object expected");r.zoomRange[o]=t[0].fromObject(e.zoomRange[o])}}return void 0!==e.preserveTextLevel&&null!==e.preserveTextLevel&&(r.preserveTextLevel=0|e.preserveTextLevel),void 0!==e.lodBeginTransition&&null!==e.lodBeginTransition&&(r.lodBeginTransition=Boolean(e.lodBeginTransition)),void 0!==e.lodEndTransition&&null!==e.lodEndTransition&&(r.lodEndTransition=Boolean(e.lodEndTransition)),r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var o={};if((r.arrays||r.defaults)&&(o.zoomRange=[]),r.defaults&&(o.preserveTextLevel=30,o.lodBeginTransition=!1,o.lodEndTransition=!1),void 0!==e.zoomRange&&null!==e.zoomRange&&e.hasOwnProperty("zoomRange")){o.zoomRange=[];for(var a=0;a<e.zoomRange.length;++a)o.zoomRange[a]=t[0].toObject(e.zoomRange[a],r)}return void 0!==e.preserveTextLevel&&null!==e.preserveTextLevel&&e.hasOwnProperty("preserveTextLevel")&&(o.preserveTextLevel=e.preserveTextLevel),void 0!==e.lodBeginTransition&&null!==e.lodBeginTransition&&e.hasOwnProperty("lodBeginTransition")&&(o.lodBeginTransition=e.lodBeginTransition),void 0!==e.lodEndTransition&&null!==e.lodEndTransition&&e.hasOwnProperty("lodEndTransition")&&(o.lodEndTransition=e.lodEndTransition),o},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),r.FolderProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}return r.prototype.isExpandable=!0,r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var t=void 0===r?e.len:e.pos+r,a=new i.keyhole.dbroot.FolderProto;e.pos<t;){var n=e.uint32();n>>>3==1?a.isExpandable=e.bool():e.skipType(7&n)}return a},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.isExpandable&&"boolean"!=typeof e.isExpandable?"isExpandable: boolean expected":null},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.FolderProto)return e;var r=new i.keyhole.dbroot.FolderProto;return void 0!==e.isExpandable&&null!==e.isExpandable&&(r.isExpandable=Boolean(e.isExpandable)),r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var t={};return r.defaults&&(t.isExpandable=!0),void 0!==e.isExpandable&&null!==e.isExpandable&&e.hasOwnProperty("isExpandable")&&(t.isExpandable=e.isExpandable),t},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),r.RequirementProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}return r.prototype.requiredVram="",r.prototype.requiredClientVer="",r.prototype.probability="",r.prototype.requiredUserAgent="",r.prototype.requiredClientCapabilities="",r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var t=void 0===r?e.len:e.pos+r,a=new i.keyhole.dbroot.RequirementProto;e.pos<t;){var n=e.uint32();switch(n>>>3){case 3:a.requiredVram=e.string();break;case 4:a.requiredClientVer=e.string();break;case 5:a.probability=e.string();break;case 6:a.requiredUserAgent=e.string();break;case 7:a.requiredClientCapabilities=e.string();break;default:e.skipType(7&n)}}return a},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.requiredVram||a.isString(e.requiredVram)?void 0===e.requiredClientVer||a.isString(e.requiredClientVer)?void 0===e.probability||a.isString(e.probability)?void 0===e.requiredUserAgent||a.isString(e.requiredUserAgent)?void 0===e.requiredClientCapabilities||a.isString(e.requiredClientCapabilities)?null:"requiredClientCapabilities: string expected":"requiredUserAgent: string expected":"probability: string expected":"requiredClientVer: string expected":"requiredVram: string expected"},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.RequirementProto)return e;var r=new i.keyhole.dbroot.RequirementProto;return void 0!==e.requiredVram&&null!==e.requiredVram&&(r.requiredVram=String(e.requiredVram)),void 0!==e.requiredClientVer&&null!==e.requiredClientVer&&(r.requiredClientVer=String(e.requiredClientVer)),void 0!==e.probability&&null!==e.probability&&(r.probability=String(e.probability)),void 0!==e.requiredUserAgent&&null!==e.requiredUserAgent&&(r.requiredUserAgent=String(e.requiredUserAgent)),void 0!==e.requiredClientCapabilities&&null!==e.requiredClientCapabilities&&(r.requiredClientCapabilities=String(e.requiredClientCapabilities)),r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var t={};return r.defaults&&(t.requiredVram="",t.requiredClientVer="",t.probability="",t.requiredUserAgent="",t.requiredClientCapabilities=""),void 0!==e.requiredVram&&null!==e.requiredVram&&e.hasOwnProperty("requiredVram")&&(t.requiredVram=e.requiredVram),void 0!==e.requiredClientVer&&null!==e.requiredClientVer&&e.hasOwnProperty("requiredClientVer")&&(t.requiredClientVer=e.requiredClientVer),void 0!==e.probability&&null!==e.probability&&e.hasOwnProperty("probability")&&(t.probability=e.probability),void 0!==e.requiredUserAgent&&null!==e.requiredUserAgent&&e.hasOwnProperty("requiredUserAgent")&&(t.requiredUserAgent=e.requiredUserAgent),void 0!==e.requiredClientCapabilities&&null!==e.requiredClientCapabilities&&e.hasOwnProperty("requiredClientCapabilities")&&(t.requiredClientCapabilities=e.requiredClientCapabilities),t},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),r.LookAtProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}return r.prototype.longitude=0,r.prototype.latitude=0,r.prototype.range=0,r.prototype.tilt=0,r.prototype.heading=0,r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var t=void 0===r?e.len:e.pos+r,a=new i.keyhole.dbroot.LookAtProto;e.pos<t;){var n=e.uint32();switch(n>>>3){case 1:a.longitude=e.float();break;case 2:a.latitude=e.float();break;case 3:a.range=e.float();break;case 4:a.tilt=e.float();break;case 5:a.heading=e.float();break;default:e.skipType(7&n)}}return a},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":"number"!=typeof e.longitude?"longitude: number expected":"number"!=typeof e.latitude?"latitude: number expected":void 0!==e.range&&"number"!=typeof e.range?"range: number expected":void 0!==e.tilt&&"number"!=typeof e.tilt?"tilt: number expected":void 0!==e.heading&&"number"!=typeof e.heading?"heading: number expected":null},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.LookAtProto)return e;var r=new i.keyhole.dbroot.LookAtProto;return void 0!==e.longitude&&null!==e.longitude&&(r.longitude=Number(e.longitude)),void 0!==e.latitude&&null!==e.latitude&&(r.latitude=Number(e.latitude)),void 0!==e.range&&null!==e.range&&(r.range=Number(e.range)),void 0!==e.tilt&&null!==e.tilt&&(r.tilt=Number(e.tilt)),void 0!==e.heading&&null!==e.heading&&(r.heading=Number(e.heading)),r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var t={};return r.defaults&&(t.longitude=0,t.latitude=0,t.range=0,t.tilt=0,t.heading=0),void 0!==e.longitude&&null!==e.longitude&&e.hasOwnProperty("longitude")&&(t.longitude=e.longitude),void 0!==e.latitude&&null!==e.latitude&&e.hasOwnProperty("latitude")&&(t.latitude=e.latitude),void 0!==e.range&&null!==e.range&&e.hasOwnProperty("range")&&(t.range=e.range),void 0!==e.tilt&&null!==e.tilt&&e.hasOwnProperty("tilt")&&(t.tilt=e.tilt),void 0!==e.heading&&null!==e.heading&&e.hasOwnProperty("heading")&&(t.heading=e.heading),t},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),r.NestedFeatureProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}r.prototype.featureType=1,r.prototype.kmlUrl=null,r.prototype.databaseUrl="",r.prototype.layer=null,r.prototype.folder=null,r.prototype.requirement=null,r.prototype.channelId=0,r.prototype.displayName=null,r.prototype.isVisible=!0,r.prototype.isEnabled=!0,r.prototype.isChecked=!1,r.prototype.layerMenuIconPath="icons/773_l.png",r.prototype.description=null,r.prototype.lookAt=null,r.prototype.assetUuid="",r.prototype.isSaveLocked=!0,r.prototype.children=a.emptyArray,r.prototype.clientConfigScriptName="",r.prototype.dioramaDataChannelBase=-1,r.prototype.replicaDataChannelBase=-1;var t,l={0:"keyhole.dbroot.NestedFeatureProto.FeatureType",1:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.LayerProto",4:"keyhole.dbroot.FolderProto",5:"keyhole.dbroot.RequirementProto",7:"keyhole.dbroot.StringIdOrValueProto",12:"keyhole.dbroot.StringIdOrValueProto",13:"keyhole.dbroot.LookAtProto",16:"keyhole.dbroot.NestedFeatureProto"};return n.push(l),r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var t=void 0===r?e.len:e.pos+r,a=new i.keyhole.dbroot.NestedFeatureProto;e.pos<t;){var n=e.uint32();switch(n>>>3){case 1:a.featureType=e.uint32();break;case 2:a.kmlUrl=l[1].decode(e,e.uint32());break;case 21:a.databaseUrl=e.string();break;case 3:a.layer=l[3].decode(e,e.uint32());break;case 4:a.folder=l[4].decode(e,e.uint32());break;case 5:a.requirement=l[5].decode(e,e.uint32());break;case 6:a.channelId=e.int32();break;case 7:a.displayName=l[7].decode(e,e.uint32());break;case 8:a.isVisible=e.bool();break;case 9:a.isEnabled=e.bool();break;case 10:a.isChecked=e.bool();break;case 11:a.layerMenuIconPath=e.string();break;case 12:a.description=l[12].decode(e,e.uint32());break;case 13:a.lookAt=l[13].decode(e,e.uint32());break;case 15:a.assetUuid=e.string();break;case 16:a.isSaveLocked=e.bool();break;case 17:a.children&&a.children.length||(a.children=[]),a.children.push(l[16].decode(e,e.uint32()));break;case 18:a.clientConfigScriptName=e.string();break;case 19:a.dioramaDataChannelBase=e.int32();break;case 20:a.replicaDataChannelBase=e.int32();break;default:e.skipType(7&n)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.featureType)switch(e.featureType){default:return"featureType: enum value expected";case 1:case 2:case 3:case 4:}if(void 0!==e.kmlUrl&&null!==e.kmlUrl&&(t=l[1].verify(e.kmlUrl)))return"kmlUrl."+t;if(void 0!==e.databaseUrl&&!a.isString(e.databaseUrl))return"databaseUrl: string expected";if(void 0!==e.layer&&null!==e.layer&&(t=l[3].verify(e.layer)))return"layer."+t;if(void 0!==e.folder&&null!==e.folder&&(t=l[4].verify(e.folder)))return"folder."+t;if(void 0!==e.requirement&&null!==e.requirement&&(t=l[5].verify(e.requirement)))return"requirement."+t;if(!a.isInteger(e.channelId))return"channelId: integer expected";if(void 0!==e.displayName&&null!==e.displayName&&(t=l[7].verify(e.displayName)))return"displayName."+t;if(void 0!==e.isVisible&&"boolean"!=typeof e.isVisible)return"isVisible: boolean expected";if(void 0!==e.isEnabled&&"boolean"!=typeof e.isEnabled)return"isEnabled: boolean expected";if(void 0!==e.isChecked&&"boolean"!=typeof e.isChecked)return"isChecked: boolean expected";if(void 0!==e.layerMenuIconPath&&!a.isString(e.layerMenuIconPath))return"layerMenuIconPath: string expected";if(void 0!==e.description&&null!==e.description&&(t=l[12].verify(e.description)))return"description."+t;if(void 0!==e.lookAt&&null!==e.lookAt&&(t=l[13].verify(e.lookAt)))return"lookAt."+t;if(void 0!==e.assetUuid&&!a.isString(e.assetUuid))return"assetUuid: string expected";if(void 0!==e.isSaveLocked&&"boolean"!=typeof e.isSaveLocked)return"isSaveLocked: boolean expected";if(void 0!==e.children){if(!Array.isArray(e.children))return"children: array expected";for(var r=0;r<e.children.length;++r){var t;if(t=l[16].verify(e.children[r]))return"children."+t}}return void 0===e.clientConfigScriptName||a.isString(e.clientConfigScriptName)?void 0===e.dioramaDataChannelBase||a.isInteger(e.dioramaDataChannelBase)?void 0===e.replicaDataChannelBase||a.isInteger(e.replicaDataChannelBase)?null:"replicaDataChannelBase: integer expected":"dioramaDataChannelBase: integer expected":"clientConfigScriptName: string expected"},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.NestedFeatureProto)return e;var r=new i.keyhole.dbroot.NestedFeatureProto;switch(e.featureType){case"TYPE_POINT_Z":case 1:r.featureType=1;break;case"TYPE_POLYGON_Z":case 2:r.featureType=2;break;case"TYPE_LINE_Z":case 3:r.featureType=3;break;case"TYPE_TERRAIN":case 4:r.featureType=4}if(void 0!==e.kmlUrl&&null!==e.kmlUrl){if("object"!=typeof e.kmlUrl)throw TypeError(".keyhole.dbroot.NestedFeatureProto.kmlUrl: object expected");r.kmlUrl=l[1].fromObject(e.kmlUrl)}if(void 0!==e.databaseUrl&&null!==e.databaseUrl&&(r.databaseUrl=String(e.databaseUrl)),void 0!==e.layer&&null!==e.layer){if("object"!=typeof e.layer)throw TypeError(".keyhole.dbroot.NestedFeatureProto.layer: object expected");r.layer=l[3].fromObject(e.layer)}if(void 0!==e.folder&&null!==e.folder){if("object"!=typeof e.folder)throw TypeError(".keyhole.dbroot.NestedFeatureProto.folder: object expected");r.folder=l[4].fromObject(e.folder)}if(void 0!==e.requirement&&null!==e.requirement){if("object"!=typeof e.requirement)throw TypeError(".keyhole.dbroot.NestedFeatureProto.requirement: object expected");r.requirement=l[5].fromObject(e.requirement)}if(void 0!==e.channelId&&null!==e.channelId&&(r.channelId=0|e.channelId),void 0!==e.displayName&&null!==e.displayName){if("object"!=typeof e.displayName)throw TypeError(".keyhole.dbroot.NestedFeatureProto.displayName: object expected");r.displayName=l[7].fromObject(e.displayName)}if(void 0!==e.isVisible&&null!==e.isVisible&&(r.isVisible=Boolean(e.isVisible)),void 0!==e.isEnabled&&null!==e.isEnabled&&(r.isEnabled=Boolean(e.isEnabled)),void 0!==e.isChecked&&null!==e.isChecked&&(r.isChecked=Boolean(e.isChecked)),void 0!==e.layerMenuIconPath&&null!==e.layerMenuIconPath&&(r.layerMenuIconPath=String(e.layerMenuIconPath)),void 0!==e.description&&null!==e.description){if("object"!=typeof e.description)throw TypeError(".keyhole.dbroot.NestedFeatureProto.description: object expected");r.description=l[12].fromObject(e.description)}if(void 0!==e.lookAt&&null!==e.lookAt){if("object"!=typeof e.lookAt)throw TypeError(".keyhole.dbroot.NestedFeatureProto.lookAt: object expected");r.lookAt=l[13].fromObject(e.lookAt)}if(void 0!==e.assetUuid&&null!==e.assetUuid&&(r.assetUuid=String(e.assetUuid)),void 0!==e.isSaveLocked&&null!==e.isSaveLocked&&(r.isSaveLocked=Boolean(e.isSaveLocked)),e.children){if(!Array.isArray(e.children))throw TypeError(".keyhole.dbroot.NestedFeatureProto.children: array expected");r.children=[];for(var t=0;t<e.children.length;++t){if("object"!=typeof e.children[t])throw TypeError(".keyhole.dbroot.NestedFeatureProto.children: object expected");r.children[t]=l[16].fromObject(e.children[t])}}return void 0!==e.clientConfigScriptName&&null!==e.clientConfigScriptName&&(r.clientConfigScriptName=String(e.clientConfigScriptName)),void 0!==e.dioramaDataChannelBase&&null!==e.dioramaDataChannelBase&&(r.dioramaDataChannelBase=0|e.dioramaDataChannelBase),void 0!==e.replicaDataChannelBase&&null!==e.replicaDataChannelBase&&(r.replicaDataChannelBase=0|e.replicaDataChannelBase),r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var t={};if((r.arrays||r.defaults)&&(t.children=[]),r.defaults&&(t.featureType=r.enums===String?"TYPE_POINT_Z":1,t.kmlUrl=null,t.databaseUrl="",t.layer=null,t.folder=null,t.requirement=null,t.channelId=0,t.displayName=null,t.isVisible=!0,t.isEnabled=!0,t.isChecked=!1,t.layerMenuIconPath="icons/773_l.png",t.description=null,t.lookAt=null,t.assetUuid="",t.isSaveLocked=!0,t.clientConfigScriptName="",t.dioramaDataChannelBase=-1,t.replicaDataChannelBase=-1),void 0!==e.featureType&&null!==e.featureType&&e.hasOwnProperty("featureType")&&(t.featureType=r.enums===String?l[0][e.featureType]:e.featureType),void 0!==e.kmlUrl&&null!==e.kmlUrl&&e.hasOwnProperty("kmlUrl")&&(t.kmlUrl=l[1].toObject(e.kmlUrl,r)),void 0!==e.databaseUrl&&null!==e.databaseUrl&&e.hasOwnProperty("databaseUrl")&&(t.databaseUrl=e.databaseUrl),void 0!==e.layer&&null!==e.layer&&e.hasOwnProperty("layer")&&(t.layer=l[3].toObject(e.layer,r)),void 0!==e.folder&&null!==e.folder&&e.hasOwnProperty("folder")&&(t.folder=l[4].toObject(e.folder,r)),void 0!==e.requirement&&null!==e.requirement&&e.hasOwnProperty("requirement")&&(t.requirement=l[5].toObject(e.requirement,r)),void 0!==e.channelId&&null!==e.channelId&&e.hasOwnProperty("channelId")&&(t.channelId=e.channelId),void 0!==e.displayName&&null!==e.displayName&&e.hasOwnProperty("displayName")&&(t.displayName=l[7].toObject(e.displayName,r)),void 0!==e.isVisible&&null!==e.isVisible&&e.hasOwnProperty("isVisible")&&(t.isVisible=e.isVisible),void 0!==e.isEnabled&&null!==e.isEnabled&&e.hasOwnProperty("isEnabled")&&(t.isEnabled=e.isEnabled),void 0!==e.isChecked&&null!==e.isChecked&&e.hasOwnProperty("isChecked")&&(t.isChecked=e.isChecked),void 0!==e.layerMenuIconPath&&null!==e.layerMenuIconPath&&e.hasOwnProperty("layerMenuIconPath")&&(t.layerMenuIconPath=e.layerMenuIconPath),void 0!==e.description&&null!==e.description&&e.hasOwnProperty("description")&&(t.description=l[12].toObject(e.description,r)),void 0!==e.lookAt&&null!==e.lookAt&&e.hasOwnProperty("lookAt")&&(t.lookAt=l[13].toObject(e.lookAt,r)),void 0!==e.assetUuid&&null!==e.assetUuid&&e.hasOwnProperty("assetUuid")&&(t.assetUuid=e.assetUuid),void 0!==e.isSaveLocked&&null!==e.isSaveLocked&&e.hasOwnProperty("isSaveLocked")&&(t.isSaveLocked=e.isSaveLocked),void 0!==e.children&&null!==e.children&&e.hasOwnProperty("children")){t.children=[];for(var o=0;o<e.children.length;++o)t.children[o]=l[16].toObject(e.children[o],r)}return void 0!==e.clientConfigScriptName&&null!==e.clientConfigScriptName&&e.hasOwnProperty("clientConfigScriptName")&&(t.clientConfigScriptName=e.clientConfigScriptName),void 0!==e.dioramaDataChannelBase&&null!==e.dioramaDataChannelBase&&e.hasOwnProperty("dioramaDataChannelBase")&&(t.dioramaDataChannelBase=e.dioramaDataChannelBase),void 0!==e.replicaDataChannelBase&&null!==e.replicaDataChannelBase&&e.hasOwnProperty("replicaDataChannelBase")&&(t.replicaDataChannelBase=e.replicaDataChannelBase),t},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r.FeatureType=((t=Object.create({})).TYPE_POINT_Z=1,t.TYPE_POLYGON_Z=2,t.TYPE_LINE_Z=3,t.TYPE_TERRAIN=4,t),r}(),r.MfeDomainFeaturesProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}r.prototype.countryCode="",r.prototype.domainName="",r.prototype.supportedFeatures=a.emptyArray;var t,l={2:"keyhole.dbroot.MfeDomainFeaturesProto.SupportedFeature"};return n.push(l),r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var t=void 0===r?e.len:e.pos+r,a=new i.keyhole.dbroot.MfeDomainFeaturesProto;e.pos<t;){var n=e.uint32();switch(n>>>3){case 1:a.countryCode=e.string();break;case 2:a.domainName=e.string();break;case 3:if(a.supportedFeatures&&a.supportedFeatures.length||(a.supportedFeatures=[]),2==(7&n))for(var l=e.uint32()+e.pos;e.pos<l;)a.supportedFeatures.push(e.uint32());else a.supportedFeatures.push(e.uint32());break;default:e.skipType(7&n)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!a.isString(e.countryCode))return"countryCode: string expected";if(!a.isString(e.domainName))return"domainName: string expected";if(void 0!==e.supportedFeatures){if(!Array.isArray(e.supportedFeatures))return"supportedFeatures: array expected";for(var r=0;r<e.supportedFeatures.length;++r)switch(e.supportedFeatures[r]){default:return"supportedFeatures: enum value[] expected";case 0:case 1:case 2:}}return null},r.fromObject=function(e){if(e instanceof i.keyhole.dbroot.MfeDomainFeaturesProto)return e;var r=new i.keyhole.dbroot.MfeDomainFeaturesProto;if(void 0!==e.countryCode&&null!==e.countryCode&&(r.countryCode=String(e.countryCode)),void 0!==e.domainName&&null!==e.domainName&&(r.domainName=String(e.domainName)),e.supportedFeatures){if(!Array.isArray(e.supportedFeatures))throw TypeError(".keyhole.dbroot.MfeDomainFeaturesProto.supportedFeatures: array expected");r.supportedFeatures=[];for(var t=0;t<e.supportedFeatures.length;++t)switch(e.supportedFeatures[t]){default:case"GEOCODING":case 0:r.supportedFeatures[t]=0;break;case"LOCAL_SEARCH":case 1:r.supportedFeatures[t]=1;break;case"DRIVING_DIRECTIONS":case 2:r.supportedFeatures[t]=2}}return r},r.from=r.fromObject,r.toObject=function(e,r){r||(r={});var t={};if((r.arrays||r.defaults)&&(t.supportedFeatures=[]),r.defaults&&(t.countryCode="",t.domainName=""),void 0!==e.countryCode&&null!==e.countryCode&&e.hasOwnProperty("countryCode")&&(t.countryCode=e.countryCode),void 0!==e.domainName&&null!==e.domainName&&e.hasOwnProperty("domainName")&&(t.domainName=e.domainName),void 0!==e.supportedFeatures&&null!==e.supportedFeatures&&e.hasOwnProperty("supportedFeatures")){t.supportedFeatures=[];for(var o=0;o<e.supportedFeatures.length;++o)t.supportedFeatures[o]=r.enums===String?l[2][e.supportedFeatures[o]]:e.supportedFeatures[o]}return t},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r.SupportedFeature=((t=Object.create({})).GEOCODING=0,t.LOCAL_SEARCH=1,t.DRIVING_DIRECTIONS=2,t),r}(),r.ClientOptionsProto=function(){function r(e){if(e)for(var r=Object.keys(e),t=0;t<r.length;++t)this[r[t]]=e[r[t]]}r.prototype.disableDiskCache=!1,r.prototype.disableEmbeddedBrowserVista=!1,r.prototype.drawAtmosphere=!0,r.prototype.drawStars=!0,r.prototype.shaderFilePrefix="",r.prototype.useProtobufQuadtreePackets=!1,r.prototype.useExtendedCopyrightIds=!0,r.prototype.precipitationsOptions=null,r.prototype.captureOptions=null,r.prototype.show_2dMapsIcon=!0,r.prototype.disableInternalBrowser=!1,r.prototype.internalBrowserBlacklist="",r.prototype.internalBrowserOriginWhitelist="*",r.prototype.polarTileMergingLevel=0,r.prototype.jsBridgeRequestWhitelist="http://*.google.com/*",r.prototype.mapsOptions=null;var t={7:"keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions",8:"keyhole.dbroot.ClientOptionsProto.CaptureOptions",15:"keyhole.dbroot.ClientOptionsProto.MapsOptions"};return n.push(t),r.decode=function(e,r){e instanceof o||(e=o.create(e));for(var a=void 0===r?e.len:e.pos+r,n=new i.keyhole.dbroot.ClientOptionsProto;e.pos<a;){var l=e.uint32();switch(l>>>3){case 1:n.disableDiskCache=e.bool();break;case 2:n.disableEmbeddedBrowserVista=e.bool();break;case 3:n.drawAtmosphere=e.bool();break;case 4:n.drawStars=e.bool();break;case 5:n.shaderFilePrefix=e.string();break;case 6:n.useProtobufQuadtreePackets=e.bool();break;case 7:n.useExtendedCopyrightIds=e.bool();break;case 8:n.precipitationsOptions=t[7].decode(e,e.uint32());break;case 9:n.captureOptions=t[8].decode(e,e.uint32());break;case 10:n.show_2dMapsIcon=e.bool();break;case 11:n.disableInternalBrowser=e.bool();break;case 12:n.internalBrowserBlacklist=e.string();break;case 13:n.internalBrowserOriginWhitelist=e.string();break;case 14:n.polarTileMergingLevel=e.int32();break;case 15:n.jsBridgeRequestWhitelist=e.string();break;case 16