@loaders.gl/mvt
Version:
Loader for Mapbox Vector Tiles
127 lines • 4.67 kB
JavaScript
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright vis.gl contributors
/**
* MVT spec constants
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
*/
export var TileInfo;
(function (TileInfo) {
/** repeated Layer */
TileInfo[TileInfo["layers"] = 3] = "layers";
})(TileInfo || (TileInfo = {}));
/**
* MVT spec constants
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
* @note Layers are described in section 4.1 of the specification
*/
export var LayerInfo;
(function (LayerInfo) {
/**
* Any compliant implementation must first read the version
* number encoded in this message and choose the correct
* implementation for this version number before proceeding to
* decode other parts of this message.
* required uint32 [ default = 1 ];
*/
LayerInfo[LayerInfo["version"] = 15] = "version";
/** PBF: required string */
LayerInfo[LayerInfo["name"] = 1] = "name";
/** The actual features in this tile.
* PBF: repeated Feature
*/
LayerInfo[LayerInfo["features"] = 2] = "features";
/**
* Dictionary encoding for keys
* PBF: repeated string
*/
LayerInfo[LayerInfo["keys"] = 3] = "keys";
/**
* Dictionary encoding for values
* PBF: repeated Value
*/
LayerInfo[LayerInfo["values"] = 4] = "values";
/**
* Although this is an "optional" field it is required by the specification.
* See https://github.com/mapbox/vector-tile-spec/issues/47
* PBF: optional uint32 [ default = 4096 ];
*/
LayerInfo[LayerInfo["extent"] = 5] = "extent";
// extensions 16 to max;
})(LayerInfo || (LayerInfo = {}));
/**
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
* Features are described in section 4.2 of the specification
*/
export var FeatureInfo;
(function (FeatureInfo) {
/** optional uint64 [ default = 0 ]; */
FeatureInfo[FeatureInfo["id"] = 1] = "id";
/**
* Tags of this feature are encoded as repeated pairs of integers.
* A detailed description of tags is located in sections 4.2 and 4.4 of the specification
* repeated uint32 [ packed = true ];
*/
FeatureInfo[FeatureInfo["tags"] = 2] = "tags";
/**
* The type of geometry stored in this feature.
* GeomType [ default = UNKNOWN ];
*/
FeatureInfo[FeatureInfo["type"] = 3] = "type";
/**
* Contains a stream of commands and parameters (vertices).
* A detailed description on geometry encoding is located in
* section 4.3 of the specification.
* repeated uint32 [ packed = true ];
*/
FeatureInfo[FeatureInfo["geometry"] = 4] = "geometry";
})(FeatureInfo || (FeatureInfo = {}));
/**
* GeomType is described in section 4.3.4 of the specification
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
* */
export var GeometryType;
(function (GeometryType) {
GeometryType[GeometryType["UNKNOWN"] = 0] = "UNKNOWN";
GeometryType[GeometryType["POINT"] = 1] = "POINT";
GeometryType[GeometryType["LINESTRING"] = 2] = "LINESTRING";
GeometryType[GeometryType["POLYGON"] = 3] = "POLYGON";
})(GeometryType || (GeometryType = {}));
/**
* Variant type encoding
* The use of values is described in section 4.1 of the specification
* @note Exactly one of these values must be present in a valid message
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
*/
export var PropertyType;
(function (PropertyType) {
/** string */
PropertyType[PropertyType["string_value"] = 1] = "string_value";
/** float */
PropertyType[PropertyType["float_value"] = 2] = "float_value";
/** double */
PropertyType[PropertyType["double_value"] = 3] = "double_value";
/** int64 */
PropertyType[PropertyType["int_value"] = 4] = "int_value";
/** uint64 */
PropertyType[PropertyType["uint_value"] = 5] = "uint_value";
/** sint64 */
PropertyType[PropertyType["sint_value"] = 6] = "sint_value";
/** bool */
PropertyType[PropertyType["bool_value"] = 7] = "bool_value";
// extensions 8 to max;
})(PropertyType || (PropertyType = {}));
/**
* "Turtle graphics" style geometry commands
* @see https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
*/
export var Command;
(function (Command) {
/** 2 Parameters: dX, dY */
Command[Command["MoveTo"] = 1] = "MoveTo";
/** 2 Parameters dX, dY */
Command[Command["LineTo"] = 2] = "LineTo";
/** No parameters */
Command[Command["ClosePath"] = 7] = "ClosePath";
})(Command || (Command = {}));
//# sourceMappingURL=mvt-constants.js.map