Skip to content
This repository has been archived by the owner on Apr 10, 2018. It is now read-only.

Commit

Permalink
Fixed light documentation (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
1ec5 authored Oct 20, 2016
1 parent 50fb83a commit 630ede5
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 47 deletions.
28 changes: 28 additions & 0 deletions docs/_generate/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@
- title: zoom
- title: bearing
- title: pitch
- title: light
- title: sources
- title: sprite
- title: glyphs
- title: transition
- title: layers
- title: Light
subnav:
- title: anchor
- title: position
- title: color
- title: intensity
- title: Sources
subnav:
- title: Vector
Expand Down Expand Up @@ -127,6 +134,27 @@ <h2><a href='#root' title='link to root'>Root Properties</a></h2>
</div>


<div class='pad2 prose'>
<a id='light' class='anchor'></a>
<h2><a href='#light' title='link to light'>Light</a></h2>
<p>
A style's <code>light</code> property provides global light source for that style.
<% if (ref.$root.light.example) { %>
<div class='space-bottom1 pad2x clearfix'>
{% highlight json %}
<%= '"light": ' + JSON.stringify(ref.$root.light.example, null, 2) %>
{% endhighlight %}
</div>
<% } %>
</p>
<div class='pad2 keyline-all fill-white'>
<% _(ref.light).each(function(prop, name) { %>
<%= item({prop: prop, id: "light-" + name, name: name}) %>
<% }); %>
</div>
</div>


<% var source_types = ['vector', 'raster', 'geojson', 'image', 'video']; %>

<div class='pad2 prose'>
Expand Down
101 changes: 55 additions & 46 deletions reference/v8.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,52 +44,12 @@
"example": 50
},
"light": {
"anchor": {
"type": "enum",
"default": "viewport",
"values": {
"map": {
"doc": "The position of the light source is aligned to the rotation of the map."
},
"viewport": {
"doc": "The position of the light source is aligned to the rotation of the viewport."
}
},
"transition": false,
"doc": "Whether extruded geometries are lit relative to the map or viewport.",
"example": "map"
},
"position": {
"type": "array",
"default": [1.15, 210, 30],
"length": 3,
"value": "number",
"transition": true,
"function": "interpolated",
"zoom-function": true,
"property-function": false,
"doc": "Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",
"example": [1.5, 90, 80]
},
"color": {
"type": "color",
"default": "#ffffff",
"function": "interpolated",
"zoom-function": true,
"property-function": false,
"transition": true,
"doc": "Color tint for lighting extruded geometries."
},
"intensity": {
"type": "number",
"default": 0.5,
"minimum": 0,
"maximum": 1,
"function": "interpolated",
"zoom-function": true,
"property-function": false,
"transition": true,
"doc": "Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast."
"type": "light",
"doc": "The global light source.",
"example": {
"anchor": "viewport",
"color": "white",
"intensity": 0.4
}
},
"sources": {
Expand Down Expand Up @@ -1536,6 +1496,55 @@
"length": 2,
"doc": "Zoom level and value pair."
},
"light": {
"anchor": {
"type": "enum",
"default": "viewport",
"values": {
"map": {
"doc": "The position of the light source is aligned to the rotation of the map."
},
"viewport": {
"doc": "The position of the light source is aligned to the rotation of the viewport."
}
},
"transition": false,
"doc": "Whether extruded geometries are lit relative to the map or viewport.",
"example": "map"
},
"position": {
"type": "array",
"default": [1.15, 210, 30],
"length": 3,
"value": "number",
"transition": true,
"function": "interpolated",
"zoom-function": true,
"property-function": false,
"doc": "Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",
"example": [1.5, 90, 80]
},
"color": {
"type": "color",
"default": "#ffffff",
"function": "interpolated",
"zoom-function": true,
"property-function": false,
"transition": true,
"doc": "Color tint for lighting extruded geometries."
},
"intensity": {
"type": "number",
"default": 0.5,
"minimum": 0,
"maximum": 1,
"function": "interpolated",
"zoom-function": true,
"property-function": false,
"transition": true,
"doc": "Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast."
}
},
"paint": [
"paint_fill",
"paint_line",
Expand Down
Loading

0 comments on commit 630ede5

Please sign in to comment.