Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector Tiles #228

Merged
merged 34 commits into from
Jan 8, 2018
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2983510
Saving progress
lasalvavida Aug 25, 2016
1886325
Fixed error in quantized formula
lasalvavida Aug 26, 2016
b8f9334
First draft of Vector tiles spec
lasalvavida Aug 26, 2016
990f939
Edits
lasalvavida Aug 26, 2016
303affa
More edits; added quantized-volume figure
lasalvavida Aug 26, 2016
43b9878
Fixed a few paths
lasalvavida Aug 26, 2016
47d6089
Tweaks
pjcozzi Aug 26, 2016
09f1222
Tweaks
pjcozzi Aug 29, 2016
79b6e8a
File extension notes
lilleyse Apr 27, 2017
6b052b7
Merge remote-tracking branch 'rob-3d-tiles/vector-tiles' into vector-…
bagnell Jun 1, 2017
842de53
Updates and remove unneeded figures.
bagnell Jun 2, 2017
a976569
Update indices and include example figure.
bagnell Jun 2, 2017
e88f1aa
Update positions descriptions, update figures, create vector feature …
bagnell Jun 5, 2017
e2939ce
Update vector styling.
bagnell Jun 5, 2017
75bb1e2
Merge branch 'master' into vector-tiles
bagnell Jun 27, 2017
3acd529
Update vector styling.
bagnell Jun 27, 2017
1b45038
Updates from review.
bagnell Jun 28, 2017
13e14ca
Tweaks
pjcozzi Jun 29, 2017
bd9f198
Tweak
pjcozzi Jun 29, 2017
a002761
Merge branch 'master' into vector-tiles
bagnell Oct 17, 2017
2ac37bb
Update with new types and from review comments.
bagnell Oct 17, 2017
1c30cc1
Update schemas.
bagnell Oct 17, 2017
226d01f
Update Mesh section.
bagnell Oct 17, 2017
94b737d
Update figures.
bagnell Oct 18, 2017
0faaf50
Updates from review. Remove geometry and mesh details.
bagnell Dec 11, 2017
ac6c656
More updates from review.
bagnell Dec 11, 2017
2207d1a
Update figures.
bagnell Dec 11, 2017
84f3968
Add geometry tile spec.
bagnell Dec 14, 2017
ae5a7c1
Updates from review.
bagnell Dec 14, 2017
107423d
Update link in main readme.
bagnell Dec 14, 2017
596d30e
Mention classification use case.
bagnell Dec 14, 2017
c57399f
Updates from review. Update schemas.
bagnell Jan 3, 2018
e11fa25
Remove min/max height from schema as they are now in region.
bagnell Jan 4, 2018
55a582d
Updates from review.
bagnell Jan 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 63 additions & 1 deletion Styling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Example: Creating a color ramp based on building height.
* Tom Fili, [@CesiumFili](https://twitter.com/CesiumFili)
* Sean Lilley, [@lilleyse](https://github.com/lilleyse)
* Patrick Cozzi, [@pjcozzi](https://twitter.com/pjcozzi)
* Dan Bagnell, [@bagnell](https://github.com/bagnell)

Contents:

Expand All @@ -51,6 +52,7 @@ Contents:
* [Notes](#notes)
* [Batch Table Hierarchy](#batch-table-hierarchy)
* [Point Cloud](#point-cloud)
* [Vector Data](#vector-data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add yourself to the contributors list in this file.

* [File Extension](#file-extension)
* [MIME Type](#mime-type)
* [Acknowledgments](#acknowledgments)
Expand Down Expand Up @@ -254,7 +256,7 @@ The following types are supported:
* `vec4`
* `RegExp`

All of the types except `vec2`, `vec3`, `vec4`, and `RegExp` have the same syntax and runtime behavior as JavaScript. `vec2`, `vec3`, and `vec4` are derived from GLSL vectors and behave similarly to JavaScript `Object` (see the [Vector section](#vector)). Colors derive from [CSS3 Colors](https://www.w3.org/TR/css3-color/) and are implemented as `vec4`. `RegExp` is derived from JavaScript and described in the [RegExp section](#regexp).
All of the types except `vec2`, `vec3`, `vec4`, and `RegExp` have the same syntax and runtime behavior as JavaScript. `vec2`, `vec3`, and `vec4` are derived from GLSL vectors and behave similarly to JavaScript `Object` (see the [Vector section](#vector)). Colors derive from [CSS3 Colors](https://www.w3.org/TR/css3-color/) and are implemented as `vec4`. Fonts derive from [CSS3 Fonts](https://www.w3.org/TR/css-fonts-3/) and are implemented as `String`. RegExp` is derived from JavaScript and described in the [RegExp section](#regexp).

Example expressions for different types include the following:
* `true`, `false`
Expand All @@ -268,6 +270,7 @@ Example expressions for different types include the following:
* `vec4(1.0, 2.0, 3.0, 4.0)`
* `color('#00FFFF')`
* `regExp('^Chest'))`
* `"30px sans-serif"`

#### Number

Expand Down Expand Up @@ -1344,6 +1347,65 @@ For example:

**TODO : add note about GLSL implementations requires strict type comparisons among other things: https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/140**

## Vector Data

A [Vector Tile](../TileFormats/VectorData/README.md) is a collection of vector features such as points, polygons, and polylines. Vector features can be styled similar to other features with `color` and `show`. Points have several other styling options:

**TODO : generate these tables from the JSON schema**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps remove this TODO and add a note to #37?


The following style properties apply to geometry features in vector tiles:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably clearer to say polygons and polylines here.


| Style | Type | Description | Default |
| --- | --- | --- | --- |
| `show` | `Boolean` | Whether or not to show the feature. | `true` |
| `color` | `vec4` | The color of the feature. | `color('#FFFFFF')` |

The following style properties apply to point features in vector tiles:

| Style | Type | Description | Default |
| --- | --- | --- | --- |
| `show` | `Boolean` | Whether or not to show the feature. | `true` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is color still a valid property for points?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can point's just use color instead of pointColor so basically point features inherit all the geometry features' style properties and add new ones - as opposed to removing some as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added pointColor and labelColor so that they can have different colors from the polygond/polylines. Should they have the same color? Should the only way to make them different from using a style that uses the metadata from the batch table?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I am confused; what does color do when applied to a point feature? Is it valid to use? Or must pointColor be set instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

color isn't applied to a point. Its applied to polygons and polylines. pointColor is applied to points only.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so question still is can't color apply to a point? So that point features "inherit" the standard properties instead of ignoring some and adding new ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

| `pointSize` | `Number` | The size of the point in pixels. `pointSize` is ignored when `image` is defined. | `8.0` |
| `pointColor` | `vec4` | The color of the point. `pointColor` is ignored when `image` is defined. | `color('#FFFFFF')` |
| `pointOutlineColor` | `vec4` | The color of the point outline. `pointOutlineColor` is ignored when `image` is defined. | `color('#000000')` |
| `pointOutlineWidth` | `Number` | The width, in pixels, of the point outline. `pointOutlineWidth` is ignored when `image` is defined. | `0.0` |
| `labelText` | `String` | The text to display for the point. | `undefined` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are \n line breaks allowed? If so, explicitly mention it.

| `labelColor` | `vec4` | The color of the label. This is ignored when `labelText` is undefined. | `color('#FFFFFF')` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be clearer if the description says it's for the label's text.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and throughout below probably remove:

This is ignored when labelText is undefined.

It is obvious and keeping the text makes the table more verbose.

| `labelStyle` | `Number` | The label style: **fill** (`0`), **outline** (`1`), or **both** (`2`). This is ignored when `labelText` is undefined. | `0` |
| `labelOutlineColor` | `vec` | The color of the text outline. This is ignored when `labelText` is undefined. | `color('#FFFFFF')` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be vec4?

| `labelOutlineWidth` | `Number` | The width of the text outline. This is ignored when `labelText` is undefined. | `1.0` |
| `font` | `String` | The font of the displayed text. This is ignored when `labelText` is undefined. | `"30px sans-serif"` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I mentioned this before but the format of the font string needs to be referenced, e.g., like this spec does for CSS colors.

| `backgroundColor` | `vec4` | The label background color. This is ignored when `labelText` is undefined. | `rgba(42, 42, 42, 0.8)` |
| `backgroundPadding` | `vec2` | The background padding, in pixels, of this label. The `x` value controls horizontal padding, and the `y` value controls vertical padding. This is ignored when `labelText` is undefined. | `vec2(7, 5)` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this add a tad more detail: is this the number of pixels on each size? Or is that / 2?

| `backgroundEnabled` | `Boolean` | Whether or not to display the label background. This is ignored when `labelText` is undefined. | `false` |
| `scaleByDistance` | `vec4` | Sets near and far scaling properties of a feature based on the features's distance from the camera. A feature's scale will interpolate between the `y` and `w` values while the camera distance falls within the upper and lower bounds of the specified `x` and `z` value. Outside of these ranges, the features's scale remains clamped to the nearest bound. If undefined, `scaleByDistance` will be disabled. | `undefined` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure, is x the lower bound and z the upper bound, or reverse?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here or below - the spec should specify how the interpolation occurs or if it is up to the implementation, e.g., some implementations may just do linear while others may ease in / ease out, overshot, etc. If you want to leave it up to the implementation, I think it is fine as long as the start and end points are clamped to the start and end scales, respectively.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do you see this as a long-term feature in 3D Tiles? Given the use cases we have had so far, this is truly required, right? It is not just a workaround for more careful tiling.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oterral added translucencyByDistance and distanceDisplayCondition to the implementation in Cesium (maybe even scaleByDistance).

I can imagine having a root tile over a country with labels for the major cities. You could have some priority in the style where some of the cities are always visible and some fade in as the camera gets closer to reduce cluttering. You could get that effect with better tiling but the labels would pop in as opposed to fading in.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, but please still document interpolation. #228 (comment)

| `translucencyByDistance` | `vec4` | Sets near and far translucency properties of a feature based on the feature's distance from the camera. A feature's translucency will interpolate between the `y` and `w` while the camera distance falls within the upper and lower bounds of the specified `x` and `z`. Outside of these ranges the feature's translucency remains clamped to the nearest bound. If undefined, `translucencyByDistance` will be disabled. | `undefined` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also define what translucency is and what the range is.

We could also make the case that this should be alpha to be consistent with the rest of the styling language - not the Cesium API.

@bagnell @lilleyse what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with either translucency or alpha.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, then up to @lilleyse I suppose.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alpha is fine with me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, captain obvious, but please make it 0 - transparent, 1 - opaque, and then map it to Cesium's translucency.

| `distanceDisplayCondition` | `vec2` | Sets the condition specifying at what distance from the camera that this feature will be displayed. The `x` value is the smallest distance in the interval where the feature is visible. The `y` value is the largest distance in the interval where the object is visible. If undefined, `distanceDisplayCondition` will be disabled. | `undefined` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question - is this a long-term feature?

| `heightOffset` | `Number` | The distance, in meters, to offset the height. This is ignored if the valuse is less than or equal to zero. | `0.0` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valuse typo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Height probably needs to be defined more concretely. Is it the distance from the ellipsoid or from the terrain? Is it implementation specific?

| `anchorLineEnabled` | `Boolean` | Whether or not to display a line from the feature to the point on terrain. This is ignored unless `heightOffset` is greater than zero. | `false` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't state "point on terrain" - it is just the original position - it could be on terrain, on a BIM model, etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bagnell @tfili also, for the acknowledgements - can we add whoever's idea this was?

| `anchorLineColor` | `vec4` | The color of the line from the feature to terrain. This is ignored unless `heightOffset` is greater than 0.0. | `color('#FFFFFF')` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment.

| `image` | `String` | A URL to an image or a data URI to be displayed instead of a point. | `undefined` |
| `disableDepthTestDistance` | `Number` | The distance where depth testing for a point will be disabled. | `undefined` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be helpful for the description to reference the positive infinity number.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the description in Cesium suitable here?

         * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
         * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is undefined the default, or is 0.0? If undefined the description should say that disableDepthTestDistance won't be applied.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - this should be more explicit so it is clear if [0, disableDepthTestDistance] or [disableDepthTestDistance, infinity] is when the depth test is disabled.

| `origin` | `Number` | The horizontal origin of the point: **center** (`0`), **left** (`1`), or **right** (`-1`). | `0` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there also be a vertical origin?

| `labelOrigin` | The horizontal origin of the label: **center** (`0`), **left** (`1`), or **right** (`-1`). This is ignored when `labelText` is undefined. | `0` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this different than origin?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This row is missing a column for the type.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


For example:

```json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I mentioned this before, but please add more examples showing more of the vector tile-specific properties.

{
"labelText" : "${DISPLAY_TEXT}",
"labelColor" : "color('#FFFF00')",
"labelStyle" : "2",
"image" : "'http://example.com/url/to/image.jpg'",
"origin" : "1",
"labelOrigin" : "-1"
}
```

| Fill | Outline | Fill and Outline |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This table doesn't have context. Perhaps given it a table number and captain and then reference it from the properties in the table above.

| --- | --- | --- |
| ![](figures/label_fill.jpg) | ![](figures/label_outline.jpg) | ![](figures/label_fill_outline.jpg) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quality of these images seems low. Was FXAA on?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FXAA was disabled. I'll see what they look like when drawing the text to a canvas.


## File Extension

TBA
Expand Down
Binary file added Styling/figures/label_fill.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Styling/figures/label_fill_outline.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Styling/figures/label_outline.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Styling/schema/style.vec2Expression.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema" : "http://json-schema.org/draft-04/schema",
"id" : "style.vec2Expression.schema.json",
"title" : "vec2 expression",
"type" : "string",
"description" : "3D Tiles style expression that evaluates to a vec2."
}
7 changes: 7 additions & 0 deletions Styling/schema/style.vec4Expression.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema" : "http://json-schema.org/draft-04/schema",
"id" : "style.vec4Expression.schema.json",
"title" : "vec4 expression",
"type" : "string",
"description" : "3D Tiles style expression that evaluates to a vec4."
}
243 changes: 243 additions & 0 deletions Styling/schema/vctr.style.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
{
"$schema" : "http://json-schema.org/draft-04/schema",
"id" : "vctr.style.schema.json",
"title" : "Vector Style",
"type" : "object",
"description" : "A 3D Tiles style with additional properties for vector data.",
"allOf" : [{
"$ref" : "style.schema.json"
}, {
"properties" : {
"show" : {
"oneOf" : [{
"$ref" : "style.booleanExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "If a feature should be shown.",
"default" : "true"
},
"pointSize" : {
"oneOf" : [{
"$ref" : "style.numberExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The size of points in pixels.",
"default" : 8.0
},
"pointColor" : {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was removed.

"oneOf" : [{
"$ref" : "style.colorExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The color of the point.",
"default" : "Color('#FFFFFF')"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These all should be lowercase color

},
"pointOutlineColor" : {
"oneOf" : [{
"$ref" : "style.colorExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The color of the point outline.",
"default" : "Color('#000000')"
},
"pointOutlineWidth" : {
"oneOf" : [{
"$ref" : "style.numberExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The width, in pixels, of the point outline.",
"default" : 0.0
},
"labelText" : {
"oneOf" : [{
"type" : "string"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The label text to display.",
"default" : "Undefined"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be lower case undefined

},
"labelColor" : {
"oneOf" : [{
"$ref" : "style.colorExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The color of the label.",
"default" : "Color('#FFFFFF')"
},
"labelStyle" : {
"oneOf" : [{
"$ref" : "style.numberExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The label style: fill (0), outline (1), or both (2).",
"default" : 0
},
"labelOutlineColor" : {
"oneOf" : [{
"$ref" : "style.colorExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The color of the text outline.",
"default" : "Color('#FFFFFF')"
},
"labelOutlineWidth" : {
"oneOf" : [{
"$ref" : "style.numberExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The width of the text outline.",
"default" : 1.0
},
"font" : {
"oneOf" : [{
"type" : "string"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The font of the displayed text.",
"default" : "'30px sans-serif'"
},
"backgroundColor" : {
"oneOf" : [{
"$ref" : "style.colorExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The label background color.",
"default" : "rgba(42, 42, 42, 0.8)"
},
"backgroundPadding" : {
"oneOf" : [{
"$ref" : "style.vec2Expression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The background padding, in pixels, of this label. The `x` value controls horizontal padding, and the `y` value controls vertical padding.",
"default" : "vec2(7, 5)"
},
"backgroundEnabled" : {
"oneOf" : [{
"$ref" : "style.booleanExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "Whether or not to display the label background.",
"default" : "false"
},
"scaleByDistance" : {
"oneOf" : [{
"$ref" : "style.vec4Expression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "Sets near and far scaling properties of a feature based on the features's distance from the camera. A feature's scale will interpolate between the `y` and `w` values while the camera distance falls within the upper and lower bounds of the specified `x` and `z` value. Outside of these ranges, the features's scale remains clamped to the nearest bound. If undefined, `scaleByDistance` will be disabled.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are minor differences between the descriptions in the schema and in the spec text, it's probably worth going through all of these to make sure they are the same.

For example this one does not include "in meters".

"default" : "Undefined"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll have to check if it is valid for "Undefined" to be a default value for some of these whose type is not string.

},
"translucencyByDistance" : {
"oneOf" : [{
"$ref" : "style.vec4Expression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "Sets near and far translucency properties of a feature based on the feature's distance from the camera. A feature's translucency will interpolate between the `y` and `w` while the camera distance falls within the upper and lower bounds of the specified `x` and `z`. Outside of these ranges the feature's translucency remains clamped to the nearest bound. If undefined, `translucencyByDistance` will be disabled.",
"default" : "Undefined"
},
"distanceDisplayCondition" : {
"oneOf" : [{
"$ref" : "style.vec2Expression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "Sets the condition specifying at what distance from the camera that this feature will be displayed. The `x` value is the smallest distance in the interval where the feature is visible. The `y` value is the largest distance in the interval where the object is visible. If undefined, `distanceDisplayCondition` will be disabled.",
"default" : "Undefined"
},
"heightOffset" : {
"oneOf" : [{
"$ref" : "style.numberExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The distance, in meters, to offset the height. This is ignored if the valuse is less than or equal to zero.",
"default" : 0.0
},
"anchorLineEnabled" : {
"oneOf" : [{
"$ref" : "style.booleanExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "Whether or not to display a line from the feature to the point on terrain. This is ignored unless `heightOffset` is greater than zero.",
"default" : "false"
},
"anchorLineColor" : {
"oneOf" : [{
"$ref" : "style.colorExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The color of the line from the feature to terrain. This is ignored unless `heightOffset` is greater than 0.0.",
"default" : "Color('#FFFFFF)"
},
"image" : {
"oneOf" : [{
"type" : "string"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "A URL to an image or a data URI to be displayed instead of a point.",
"default" : "Undefined"
},
"disableDepthTestDistance" : {
"oneOf" : [{
"$ref" : "style.numberExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The distance from that camera at which the depth test will be disabled.",
"default" : "Undefined"
},
"origin" : {
"oneOf" : [{
"$ref" : "style.numberExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The horizontal origin of the point: center ('0'), left ('1'), or right ('-1').",
"default" : "0"
},
"labelOrigin" : {
"oneOf" : [{
"$ref" : "style.numberExpression.schema.json"
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "The horizontal origin of the label: center ('0'), left ('1'), or right ('-1').",
"default" : "0"
}
},
"dependencies" : {
"labelText" : [
"labelStyle",
"labelColor",
"labelOutlineColor",
"labelOutlineWidth",
"labelOrigin",
"font",
"backgroundColor",
"backgroundPadding",
"backgroundEnabled"
]
}
}],
"additionalProperties" : false
}
Loading