@cesium/engine
Version:
CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin.
907 lines (836 loc) • 502 kB
JavaScript
window.cesiumGoogleEarthDbRootParser = function(
$protobuf) {
/* jshint curly: false, sub: true, newcap: false, shadow: true, unused: false*/
'use strict';
//
// Creates a parser for a dbroot protocol buffer
// Below code is generated using protobufjs with the following command
//
// ./pbjs --no-encode --no-create --no-comments --no-delimited -w amd -t static dbroot_v2.proto
//
// .proto file can be found here: https://github.com/google/earthenterprise/blob/master/earth_enterprise/src/keyhole/proto/dbroot/dbroot_v2.proto
var $Reader = $protobuf.Reader, $util = $protobuf.util;
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
$root.keyhole = (function() {
var keyhole = {};
keyhole.dbroot = (function() {
var dbroot = {};
dbroot.StringEntryProto = (function() {
function StringEntryProto(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
StringEntryProto.prototype.stringId = 0;
StringEntryProto.prototype.stringValue = "";
StringEntryProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.StringEntryProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.stringId = reader.fixed32();
break;
}
case 2: {
message.stringValue = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("stringId"))
throw $util.ProtocolError("missing required 'stringId'", { instance: message });
if (!message.hasOwnProperty("stringValue"))
throw $util.ProtocolError("missing required 'stringValue'", { instance: message });
return message;
};
StringEntryProto.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (!$util.isInteger(message.stringId))
return "stringId: integer expected";
if (!$util.isString(message.stringValue))
return "stringValue: string expected";
return null;
};
StringEntryProto.fromObject = function fromObject(object) {
if (object instanceof $root.keyhole.dbroot.StringEntryProto)
return object;
var message = new $root.keyhole.dbroot.StringEntryProto();
if (object.stringId != null)
message.stringId = object.stringId >>> 0;
if (object.stringValue != null)
message.stringValue = String(object.stringValue);
return message;
};
StringEntryProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.stringId = 0;
object.stringValue = "";
}
if (message.stringId != null && message.hasOwnProperty("stringId"))
object.stringId = message.stringId;
if (message.stringValue != null && message.hasOwnProperty("stringValue"))
object.stringValue = message.stringValue;
return object;
};
StringEntryProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
StringEntryProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/keyhole.dbroot.StringEntryProto";
};
return StringEntryProto;
})();
dbroot.StringIdOrValueProto = (function() {
function StringIdOrValueProto(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
StringIdOrValueProto.prototype.stringId = 0;
StringIdOrValueProto.prototype.value = "";
StringIdOrValueProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.StringIdOrValueProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.stringId = reader.fixed32();
break;
}
case 2: {
message.value = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
StringIdOrValueProto.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.stringId != null && message.hasOwnProperty("stringId"))
if (!$util.isInteger(message.stringId))
return "stringId: integer expected";
if (message.value != null && message.hasOwnProperty("value"))
if (!$util.isString(message.value))
return "value: string expected";
return null;
};
StringIdOrValueProto.fromObject = function fromObject(object) {
if (object instanceof $root.keyhole.dbroot.StringIdOrValueProto)
return object;
var message = new $root.keyhole.dbroot.StringIdOrValueProto();
if (object.stringId != null)
message.stringId = object.stringId >>> 0;
if (object.value != null)
message.value = String(object.value);
return message;
};
StringIdOrValueProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.stringId = 0;
object.value = "";
}
if (message.stringId != null && message.hasOwnProperty("stringId"))
object.stringId = message.stringId;
if (message.value != null && message.hasOwnProperty("value"))
object.value = message.value;
return object;
};
StringIdOrValueProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
StringIdOrValueProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/keyhole.dbroot.StringIdOrValueProto";
};
return StringIdOrValueProto;
})();
dbroot.PlanetModelProto = (function() {
function PlanetModelProto(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
PlanetModelProto.prototype.radius = 6378.137;
PlanetModelProto.prototype.flattening = 0.00335281066474748;
PlanetModelProto.prototype.elevationBias = 0;
PlanetModelProto.prototype.negativeAltitudeExponentBias = 0;
PlanetModelProto.prototype.compressedNegativeAltitudeThreshold = 0;
PlanetModelProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.PlanetModelProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.radius = reader.double();
break;
}
case 2: {
message.flattening = reader.double();
break;
}
case 4: {
message.elevationBias = reader.double();
break;
}
case 5: {
message.negativeAltitudeExponentBias = reader.int32();
break;
}
case 6: {
message.compressedNegativeAltitudeThreshold = reader.double();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
PlanetModelProto.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.radius != null && message.hasOwnProperty("radius"))
if (typeof message.radius !== "number")
return "radius: number expected";
if (message.flattening != null && message.hasOwnProperty("flattening"))
if (typeof message.flattening !== "number")
return "flattening: number expected";
if (message.elevationBias != null && message.hasOwnProperty("elevationBias"))
if (typeof message.elevationBias !== "number")
return "elevationBias: number expected";
if (message.negativeAltitudeExponentBias != null && message.hasOwnProperty("negativeAltitudeExponentBias"))
if (!$util.isInteger(message.negativeAltitudeExponentBias))
return "negativeAltitudeExponentBias: integer expected";
if (message.compressedNegativeAltitudeThreshold != null && message.hasOwnProperty("compressedNegativeAltitudeThreshold"))
if (typeof message.compressedNegativeAltitudeThreshold !== "number")
return "compressedNegativeAltitudeThreshold: number expected";
return null;
};
PlanetModelProto.fromObject = function fromObject(object) {
if (object instanceof $root.keyhole.dbroot.PlanetModelProto)
return object;
var message = new $root.keyhole.dbroot.PlanetModelProto();
if (object.radius != null)
message.radius = Number(object.radius);
if (object.flattening != null)
message.flattening = Number(object.flattening);
if (object.elevationBias != null)
message.elevationBias = Number(object.elevationBias);
if (object.negativeAltitudeExponentBias != null)
message.negativeAltitudeExponentBias = object.negativeAltitudeExponentBias | 0;
if (object.compressedNegativeAltitudeThreshold != null)
message.compressedNegativeAltitudeThreshold = Number(object.compressedNegativeAltitudeThreshold);
return message;
};
PlanetModelProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.radius = 6378.137;
object.flattening = 0.00335281066474748;
object.elevationBias = 0;
object.negativeAltitudeExponentBias = 0;
object.compressedNegativeAltitudeThreshold = 0;
}
if (message.radius != null && message.hasOwnProperty("radius"))
object.radius = options.json && !isFinite(message.radius) ? String(message.radius) : message.radius;
if (message.flattening != null && message.hasOwnProperty("flattening"))
object.flattening = options.json && !isFinite(message.flattening) ? String(message.flattening) : message.flattening;
if (message.elevationBias != null && message.hasOwnProperty("elevationBias"))
object.elevationBias = options.json && !isFinite(message.elevationBias) ? String(message.elevationBias) : message.elevationBias;
if (message.negativeAltitudeExponentBias != null && message.hasOwnProperty("negativeAltitudeExponentBias"))
object.negativeAltitudeExponentBias = message.negativeAltitudeExponentBias;
if (message.compressedNegativeAltitudeThreshold != null && message.hasOwnProperty("compressedNegativeAltitudeThreshold"))
object.compressedNegativeAltitudeThreshold = options.json && !isFinite(message.compressedNegativeAltitudeThreshold) ? String(message.compressedNegativeAltitudeThreshold) : message.compressedNegativeAltitudeThreshold;
return object;
};
PlanetModelProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
PlanetModelProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/keyhole.dbroot.PlanetModelProto";
};
return PlanetModelProto;
})();
dbroot.ProviderInfoProto = (function() {
function ProviderInfoProto(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
ProviderInfoProto.prototype.providerId = 0;
ProviderInfoProto.prototype.copyrightString = null;
ProviderInfoProto.prototype.verticalPixelOffset = -1;
ProviderInfoProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.ProviderInfoProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.providerId = reader.int32();
break;
}
case 2: {
message.copyrightString = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());
break;
}
case 3: {
message.verticalPixelOffset = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("providerId"))
throw $util.ProtocolError("missing required 'providerId'", { instance: message });
return message;
};
ProviderInfoProto.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (!$util.isInteger(message.providerId))
return "providerId: integer expected";
if (message.copyrightString != null && message.hasOwnProperty("copyrightString")) {
var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.copyrightString);
if (error)
return "copyrightString." + error;
}
if (message.verticalPixelOffset != null && message.hasOwnProperty("verticalPixelOffset"))
if (!$util.isInteger(message.verticalPixelOffset))
return "verticalPixelOffset: integer expected";
return null;
};
ProviderInfoProto.fromObject = function fromObject(object) {
if (object instanceof $root.keyhole.dbroot.ProviderInfoProto)
return object;
var message = new $root.keyhole.dbroot.ProviderInfoProto();
if (object.providerId != null)
message.providerId = object.providerId | 0;
if (object.copyrightString != null) {
if (typeof object.copyrightString !== "object")
throw TypeError(".keyhole.dbroot.ProviderInfoProto.copyrightString: object expected");
message.copyrightString = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.copyrightString);
}
if (object.verticalPixelOffset != null)
message.verticalPixelOffset = object.verticalPixelOffset | 0;
return message;
};
ProviderInfoProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.providerId = 0;
object.copyrightString = null;
object.verticalPixelOffset = -1;
}
if (message.providerId != null && message.hasOwnProperty("providerId"))
object.providerId = message.providerId;
if (message.copyrightString != null && message.hasOwnProperty("copyrightString"))
object.copyrightString = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.copyrightString, options);
if (message.verticalPixelOffset != null && message.hasOwnProperty("verticalPixelOffset"))
object.verticalPixelOffset = message.verticalPixelOffset;
return object;
};
ProviderInfoProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
ProviderInfoProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/keyhole.dbroot.ProviderInfoProto";
};
return ProviderInfoProto;
})();
dbroot.PopUpProto = (function() {
function PopUpProto(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
PopUpProto.prototype.isBalloonStyle = false;
PopUpProto.prototype.text = null;
PopUpProto.prototype.backgroundColorAbgr = 4294967295;
PopUpProto.prototype.textColorAbgr = 4278190080;
PopUpProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.PopUpProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.isBalloonStyle = reader.bool();
break;
}
case 2: {
message.text = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());
break;
}
case 3: {
message.backgroundColorAbgr = reader.fixed32();
break;
}
case 4: {
message.textColorAbgr = reader.fixed32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
PopUpProto.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.isBalloonStyle != null && message.hasOwnProperty("isBalloonStyle"))
if (typeof message.isBalloonStyle !== "boolean")
return "isBalloonStyle: boolean expected";
if (message.text != null && message.hasOwnProperty("text")) {
var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.text);
if (error)
return "text." + error;
}
if (message.backgroundColorAbgr != null && message.hasOwnProperty("backgroundColorAbgr"))
if (!$util.isInteger(message.backgroundColorAbgr))
return "backgroundColorAbgr: integer expected";
if (message.textColorAbgr != null && message.hasOwnProperty("textColorAbgr"))
if (!$util.isInteger(message.textColorAbgr))
return "textColorAbgr: integer expected";
return null;
};
PopUpProto.fromObject = function fromObject(object) {
if (object instanceof $root.keyhole.dbroot.PopUpProto)
return object;
var message = new $root.keyhole.dbroot.PopUpProto();
if (object.isBalloonStyle != null)
message.isBalloonStyle = Boolean(object.isBalloonStyle);
if (object.text != null) {
if (typeof object.text !== "object")
throw TypeError(".keyhole.dbroot.PopUpProto.text: object expected");
message.text = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.text);
}
if (object.backgroundColorAbgr != null)
message.backgroundColorAbgr = object.backgroundColorAbgr >>> 0;
if (object.textColorAbgr != null)
message.textColorAbgr = object.textColorAbgr >>> 0;
return message;
};
PopUpProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.isBalloonStyle = false;
object.text = null;
object.backgroundColorAbgr = 4294967295;
object.textColorAbgr = 4278190080;
}
if (message.isBalloonStyle != null && message.hasOwnProperty("isBalloonStyle"))
object.isBalloonStyle = message.isBalloonStyle;
if (message.text != null && message.hasOwnProperty("text"))
object.text = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.text, options);
if (message.backgroundColorAbgr != null && message.hasOwnProperty("backgroundColorAbgr"))
object.backgroundColorAbgr = message.backgroundColorAbgr;
if (message.textColorAbgr != null && message.hasOwnProperty("textColorAbgr"))
object.textColorAbgr = message.textColorAbgr;
return object;
};
PopUpProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
PopUpProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/keyhole.dbroot.PopUpProto";
};
return PopUpProto;
})();
dbroot.StyleAttributeProto = (function() {
function StyleAttributeProto(properties) {
this.drawFlag = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
StyleAttributeProto.prototype.styleId = "";
StyleAttributeProto.prototype.providerId = 0;
StyleAttributeProto.prototype.polyColorAbgr = 4294967295;
StyleAttributeProto.prototype.lineColorAbgr = 4294967295;
StyleAttributeProto.prototype.lineWidth = 1;
StyleAttributeProto.prototype.labelColorAbgr = 4294967295;
StyleAttributeProto.prototype.labelScale = 1;
StyleAttributeProto.prototype.placemarkIconColorAbgr = 4294967295;
StyleAttributeProto.prototype.placemarkIconScale = 1;
StyleAttributeProto.prototype.placemarkIconPath = null;
StyleAttributeProto.prototype.placemarkIconX = 0;
StyleAttributeProto.prototype.placemarkIconY = 0;
StyleAttributeProto.prototype.placemarkIconWidth = 32;
StyleAttributeProto.prototype.placemarkIconHeight = 32;
StyleAttributeProto.prototype.popUp = null;
StyleAttributeProto.prototype.drawFlag = $util.emptyArray;
StyleAttributeProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.StyleAttributeProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.styleId = reader.string();
break;
}
case 3: {
message.providerId = reader.int32();
break;
}
case 4: {
message.polyColorAbgr = reader.fixed32();
break;
}
case 5: {
message.lineColorAbgr = reader.fixed32();
break;
}
case 6: {
message.lineWidth = reader.float();
break;
}
case 7: {
message.labelColorAbgr = reader.fixed32();
break;
}
case 8: {
message.labelScale = reader.float();
break;
}
case 9: {
message.placemarkIconColorAbgr = reader.fixed32();
break;
}
case 10: {
message.placemarkIconScale = reader.float();
break;
}
case 11: {
message.placemarkIconPath = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());
break;
}
case 12: {
message.placemarkIconX = reader.int32();
break;
}
case 13: {
message.placemarkIconY = reader.int32();
break;
}
case 14: {
message.placemarkIconWidth = reader.int32();
break;
}
case 15: {
message.placemarkIconHeight = reader.int32();
break;
}
case 16: {
message.popUp = $root.keyhole.dbroot.PopUpProto.decode(reader, reader.uint32());
break;
}
case 17: {
if (!(message.drawFlag && message.drawFlag.length))
message.drawFlag = [];
message.drawFlag.push($root.keyhole.dbroot.DrawFlagProto.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("styleId"))
throw $util.ProtocolError("missing required 'styleId'", { instance: message });
return message;
};
StyleAttributeProto.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (!$util.isString(message.styleId))
return "styleId: string expected";
if (message.providerId != null && message.hasOwnProperty("providerId"))
if (!$util.isInteger(message.providerId))
return "providerId: integer expected";
if (message.polyColorAbgr != null && message.hasOwnProperty("polyColorAbgr"))
if (!$util.isInteger(message.polyColorAbgr))
return "polyColorAbgr: integer expected";
if (message.lineColorAbgr != null && message.hasOwnProperty("lineColorAbgr"))
if (!$util.isInteger(message.lineColorAbgr))
return "lineColorAbgr: integer expected";
if (message.lineWidth != null && message.hasOwnProperty("lineWidth"))
if (typeof message.lineWidth !== "number")
return "lineWidth: number expected";
if (message.labelColorAbgr != null && message.hasOwnProperty("labelColorAbgr"))
if (!$util.isInteger(message.labelColorAbgr))
return "labelColorAbgr: integer expected";
if (message.labelScale != null && message.hasOwnProperty("labelScale"))
if (typeof message.labelScale !== "number")
return "labelScale: number expected";
if (message.placemarkIconColorAbgr != null && message.hasOwnProperty("placemarkIconColorAbgr"))
if (!$util.isInteger(message.placemarkIconColorAbgr))
return "placemarkIconColorAbgr: integer expected";
if (message.placemarkIconScale != null && message.hasOwnProperty("placemarkIconScale"))
if (typeof message.placemarkIconScale !== "number")
return "placemarkIconScale: number expected";
if (message.placemarkIconPath != null && message.hasOwnProperty("placemarkIconPath")) {
var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.placemarkIconPath);
if (error)
return "placemarkIconPath." + error;
}
if (message.placemarkIconX != null && message.hasOwnProperty("placemarkIconX"))
if (!$util.isInteger(message.placemarkIconX))
return "placemarkIconX: integer expected";
if (message.placemarkIconY != null && message.hasOwnProperty("placemarkIconY"))
if (!$util.isInteger(message.placemarkIconY))
return "placemarkIconY: integer expected";
if (message.placemarkIconWidth != null && message.hasOwnProperty("placemarkIconWidth"))
if (!$util.isInteger(message.placemarkIconWidth))
return "placemarkIconWidth: integer expected";
if (message.placemarkIconHeight != null && message.hasOwnProperty("placemarkIconHeight"))
if (!$util.isInteger(message.placemarkIconHeight))
return "placemarkIconHeight: integer expected";
if (message.popUp != null && message.hasOwnProperty("popUp")) {
var error = $root.keyhole.dbroot.PopUpProto.verify(message.popUp);
if (error)
return "popUp." + error;
}
if (message.drawFlag != null && message.hasOwnProperty("drawFlag")) {
if (!Array.isArray(message.drawFlag))
return "drawFlag: array expected";
for (var i = 0; i < message.drawFlag.length; ++i) {
var error = $root.keyhole.dbroot.DrawFlagProto.verify(message.drawFlag[i]);
if (error)
return "drawFlag." + error;
}
}
return null;
};
StyleAttributeProto.fromObject = function fromObject(object) {
if (object instanceof $root.keyhole.dbroot.StyleAttributeProto)
return object;
var message = new $root.keyhole.dbroot.StyleAttributeProto();
if (object.styleId != null)
message.styleId = String(object.styleId);
if (object.providerId != null)
message.providerId = object.providerId | 0;
if (object.polyColorAbgr != null)
message.polyColorAbgr = object.polyColorAbgr >>> 0;
if (object.lineColorAbgr != null)
message.lineColorAbgr = object.lineColorAbgr >>> 0;
if (object.lineWidth != null)
message.lineWidth = Number(object.lineWidth);
if (object.labelColorAbgr != null)
message.labelColorAbgr = object.labelColorAbgr >>> 0;
if (object.labelScale != null)
message.labelScale = Number(object.labelScale);
if (object.placemarkIconColorAbgr != null)
message.placemarkIconColorAbgr = object.placemarkIconColorAbgr >>> 0;
if (object.placemarkIconScale != null)
message.placemarkIconScale = Number(object.placemarkIconScale);
if (object.placemarkIconPath != null) {
if (typeof object.placemarkIconPath !== "object")
throw TypeError(".keyhole.dbroot.StyleAttributeProto.placemarkIconPath: object expected");
message.placemarkIconPath = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.placemarkIconPath);
}
if (object.placemarkIconX != null)
message.placemarkIconX = object.placemarkIconX | 0;
if (object.placemarkIconY != null)
message.placemarkIconY = object.placemarkIconY | 0;
if (object.placemarkIconWidth != null)
message.placemarkIconWidth = object.placemarkIconWidth | 0;
if (object.placemarkIconHeight != null)
message.placemarkIconHeight = object.placemarkIconHeight | 0;
if (object.popUp != null) {
if (typeof object.popUp !== "object")
throw TypeError(".keyhole.dbroot.StyleAttributeProto.popUp: object expected");
message.popUp = $root.keyhole.dbroot.PopUpProto.fromObject(object.popUp);
}
if (object.drawFlag) {
if (!Array.isArray(object.drawFlag))
throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: array expected");
message.drawFlag = [];
for (var i = 0; i < object.drawFlag.length; ++i) {
if (typeof object.drawFlag[i] !== "object")
throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: object expected");
message.drawFlag[i] = $root.keyhole.dbroot.DrawFlagProto.fromObject(object.drawFlag[i]);
}
}
return message;
};
StyleAttributeProto.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.drawFlag = [];
if (options.defaults) {
object.styleId = "";
object.providerId = 0;
object.polyColorAbgr = 4294967295;
object.lineColorAbgr = 4294967295;
object.lineWidth = 1;
object.labelColorAbgr = 4294967295;
object.labelScale = 1;
object.placemarkIconColorAbgr = 4294967295;
object.placemarkIconScale = 1;
object.placemarkIconPath = null;
object.placemarkIconX = 0;
object.placemarkIconY = 0;
object.placemarkIconWidth = 32;
object.placemarkIconHeight = 32;
object.popUp = null;
}
if (message.styleId != null && message.hasOwnProperty("styleId"))
object.styleId = message.styleId;
if (message.providerId != null && message.hasOwnProperty("providerId"))
object.providerId = message.providerId;
if (message.polyColorAbgr != null && message.hasOwnProperty("polyColorAbgr"))
object.polyColorAbgr = message.polyColorAbgr;
if (message.lineColorAbgr != null && message.hasOwnProperty("lineColorAbgr"))
object.lineColorAbgr = message.lineColorAbgr;
if (message.lineWidth != null && message.hasOwnProperty("lineWidth"))
object.lineWidth = options.json && !isFinite(message.lineWidth) ? String(message.lineWidth) : message.lineWidth;
if (message.labelColorAbgr != null && message.hasOwnProperty("labelColorAbgr"))
object.labelColorAbgr = message.labelColorAbgr;
if (message.labelScale != null && message.hasOwnProperty("labelScale"))
object.labelScale = options.json && !isFinite(message.labelScale) ? String(message.labelScale) : message.labelScale;
if (message.placemarkIconColorAbgr != null && message.hasOwnProperty("placemarkIconColorAbgr"))
object.placemarkIconColorAbgr = message.placemarkIconColorAbgr;
if (message.placemarkIconScale != null && message.hasOwnProperty("placemarkIconScale"))
object.placemarkIconScale = options.json && !isFinite(message.placemarkIconScale) ? String(message.placemarkIconScale) : message.placemarkIconScale;
if (message.placemarkIconPath != null && message.hasOwnProperty("placemarkIconPath"))
object.placemarkIconPath = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.placemarkIconPath, options);
if (message.placemarkIconX != null && message.hasOwnProperty("placemarkIconX"))
object.placemarkIconX = message.placemarkIconX;
if (message.placemarkIconY != null && message.hasOwnProperty("placemarkIconY"))
object.placemarkIconY = message.placemarkIconY;
if (message.placemarkIconWidth != null && message.hasOwnProperty("placemarkIconWidth"))
object.placemarkIconWidth = message.placemarkIconWidth;
if (message.placemarkIconHeight != null && message.hasOwnProperty("placemarkIconHeight"))
object.placemarkIconHeight = message.placemarkIconHeight;
if (message.popUp != null && message.hasOwnProperty("popUp"))
object.popUp = $root.keyhole.dbroot.PopUpProto.toObject(message.popUp, options);
if (message.drawFlag && message.drawFlag.length) {
object.drawFlag = [];
for (var j = 0; j < message.drawFlag.length; ++j)
object.drawFlag[j] = $root.keyhole.dbroot.DrawFlagProto.toObject(message.drawFlag[j], options);
}
return object;
};
StyleAttributeProto.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
StyleAttributeProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/keyhole.dbroot.StyleAttributeProto";
};
return StyleAttributeProto;
})();
dbroot.StyleMapProto = (function() {
function StyleMapProto(properties) {
this.channelId = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
StyleMapProto.prototype.styleMapId = 0;
StyleMapProto.prototype.channelId = $util.emptyArray;
StyleMapProto.prototype.normalStyleAttribute = 0;
StyleMapProto.prototype.highlightStyleAttribute = 0;
StyleMapProto.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.StyleMapProto();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.styleMapId = reader.int32();
break;
}
case 2: {
if (!(message.channelId && message.channelId.length))
message.channelId = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.channelId.push(reader.int32());
} else
message.channelId.push(reader.int32());
break;
}
case 3: {
message.normalStyleAttribute = reader.int32();
break;
}
case 4: {
message.highlightStyleAttribute = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("styleMapId"))
throw $util.ProtocolError("missing required 'styleMapId'", { instance: message });
return message;
};
StyleMapProto.verify = function verify(