Skip to content

Commit 430cd4b

Browse files
author
Lucas Wojciechowski
committed
Merge remote-tracking branch 'origin/mb-pages'
2 parents ad1c0b0 + 2385d47 commit 430cd4b

File tree

61 files changed

+1318
-1068
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1318
-1068
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Mapbox GL JS
44

5-
Mapbox GL JS is a Javascript & WebGL library that renders interactive maps from [vector tiles](https://www.mapbox.com/blog/vector-tiles/) and the [Mapbox GL Style Specification]([Style Specification](https://www.mapbox.com/mapbox-gl-style-spec)).
5+
Mapbox GL JS is a Javascript & WebGL library that renders interactive maps from [vector tiles](https://www.mapbox.com/blog/vector-tiles/) and [Mapbox styles](https://www.mapbox.com/mapbox-gl-style-spec).
66

77
It is part of the [Mapbox GL ecosystem](https://github.com/mapbox/mapbox-gl) which includes [Mapbox GL Native](https://www.mapbox.com/mapbox-gl-native), a suite of compatible SDKs for native desktop and mobile applications.
88

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ In the post body, write the HTML and JavaScript constituting the example.
3030
* Use **4 space indentation**. Exception: do not add an initial level of indentation to code within `<script>` tags (it should start flush left).
3131
* Do **not** include an access token in the example code. The access token will be inserted automatically by the template, using the current logged in user's default public token, or a placeholder `<insert token here>` string if the user is not logged in.
3232
* Do **not** use custom styles from your personal account. Use only the default `mapbox` account styles.
33-
* When embedding literal JSON (GeoJSON or GL style snippets) into script code, double-quote property names and string values. Elsewhere, use single-quoted strings.
33+
* When embedding literal JSON (GeoJSON or Mapbox style snippets) into script code, double-quote property names and string values. Elsewhere, use single-quoted strings.
3434

3535
## Running the Documentation Server Locally
3636

docs/_layouts/default.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
<meta class='swiftype' name='author' data-type='string' content='{{page.author}}' />{% endif %}{% if page.excerpt or page.description %}
102102
<meta class='swiftype' name='excerpt' data-type='string' content='{% if page.description %}{{ page.description | strip_html | strip_newlines | replace:"'","&rsquo;" | replace:"'","&rsquo;" | truncatewords: 30 }}{% else %}{{ page.excerpt | strip_html | strip_newlines | replace:"'","&rsquo;" | replace:"'","&rsquo;" | truncatewords: 30 }}{% endif %}' />{% endif %}
103103
{% if site.baseurl == '/mapbox.js' %}{% if site.mapboxjs != page.version and page.version != 'latest' %}<meta name='robots' content='noindex'>{% endif %}{% endif %}
104-
{% if page.card %}
104+
{% if page.card or layout.card %}
105105
<meta name='twitter:site' content='@Mapbox' />
106106
<meta property='og:site_name' content='Mapbox' />
107107
<meta name='twitter:url' content='{{site.url}}{{site.baseurl}}{% if page.permalink %}{{page.permalink}}{% else %}{{page.url | replace:"index.html",""}}{% endif %}' />
@@ -110,7 +110,7 @@
110110
<meta property='og:title' content='{{page.title | replace:"'","&rsquo;" | replace:"'","&rsquo;"}}' />
111111
<meta name='twitter:description' content='{% if page.description %}{{ page.description | truncatewords: 30 }}{% elsif page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | replace:"'","&rsquo;" | replace:"'","&rsquo;" | truncatewords: 30 }}{% else %}{{content | strip_html | truncatewords: 30 }}{% endif %}' />
112112
<meta property='og:description' content='{% if page.description %}{{ page.description | truncatewords: 30 }}{% elsif page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | replace:"'","&rsquo;" | replace:"'","&rsquo;" | truncatewords: 30 }}{% else %}{{content | strip_html | truncatewords: 30 }}{% endif %}' />
113-
{% if page.video %}
113+
{% if page.video or layout.video %}
114114
<meta name='twitter:card' content='player' />
115115
<meta name='twitter:player' content='{{page.video | replace: "http:" , "https:" }}' />
116116
<meta name='twitter:player:width' content='640' />
@@ -119,7 +119,7 @@
119119
<meta property='og:video' content='{{page.video}}' />
120120
<meta property='og:video:width' content='640' />
121121
<meta property='og:video:height' content='480' />
122-
{% elsif page.image %}
122+
{% elsif page.image or layout.image %}
123123
<meta name='twitter:image' content='{{page.image | replace:"https:","http:"}}' />
124124
<meta name='st:image' content='{{page.image | replace:"https:","http:"}}' />
125125
<meta property='og:image' content='{{page.image | replace:"https:","http:"}}' />
@@ -376,7 +376,7 @@ <h3 class='pad0y pad1x strong space-bottom1'>Products</h3>
376376

377377
<div class='{% unless page.options contains 'full' or layout.options contains 'full' %} limiter clearfix{% endunless %}'>{{content}}</div>
378378

379-
{% unless page.url contains '/hello/directions' or page.url contains '/welcome' %}
379+
{% unless page.url contains '/hello/directions' %}
380380
<div class='footer footer-in-docs clearfix contain hide-mobile noprint fill-light' data-swiftype-index='false'>
381381
<div class='limiter clearfix'>
382382
<div class='footer-in-docs footer-cols-in-docs clearfix col12 pad8y small'>

docs/_layouts/docs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h1 class='space-bottom2'>
1818
</h1>
1919

2020
<div class='prose space-bottom2'>
21-
<p>Mapbox GL JS is a JavaScript library that uses WebGL to render interactive maps from <a href='{{site.url}}/help/define-vector-tiles'>vector tiles</a> and <a href='{{site.url}}/mapbox-gl-style-spec'>Mapbox GL styles</a>.<p>
21+
<p>Mapbox GL JS is a JavaScript library that uses WebGL to render interactive maps from <a href='{{site.url}}/help/define-vector-tiles'>vector tiles</a> and <a href='{{site.url}}/mapbox-gl-style-spec'>Mapbox styles</a>.<p>
2222
<p>It is part of the <a href='https://github.com/mapbox/mapbox-gl'>Mapbox GL ecosystem</a> which includes <a href='{{site.url}}/mobile/'>Mapbox Mobile</a>, a suite of compatible SDKs for native desktop and mobile applications.</p>
2323
</div>
2424
<a href='https://www.mapbox.com/gallery/'><img alt='Mapbox GL JS gallery' src='{{site.baseurl}}/assets/gallery.png'></a>

docs/_posts/examples/.eslintrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"plugins": ["html"],
3+
"globals": {
4+
"mapboxgl": true,
5+
"turf": true,
6+
"d3": true
7+
},
8+
"rules": {
9+
"strict": "off",
10+
"no-unused-vars": ["error", {varsIgnorePattern: "map|popup"}],
11+
}
12+
}

docs/_posts/examples/3400-01-01-cluster.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
layout: example
33
category: example
4-
title: Create and style marker clusters
5-
description: Use Mapbox GL JS' built-in functions to visualize point data as marker clusters.
4+
title: Create and style clusters
5+
description: Use Mapbox GL JS' built-in functions to visualize points as clusters.
66
---
77

88
<div id='map'></div>
@@ -12,10 +12,10 @@
1212
container: 'map',
1313
style: 'mapbox://styles/mapbox/dark-v9',
1414
center: [-103.59179687498357, 40.66995747013945],
15-
zoom: 3,
15+
zoom: 3
1616
});
1717

18-
map.on('load', function(){
18+
map.on('load', function() {
1919

2020
// Add a new source from our GeoJSON data and set the
2121
// 'cluster' option to true.
@@ -30,10 +30,10 @@
3030
});
3131

3232
// Use the earthquakes source to create five layers:
33-
// One for non-clustered markers, three for each cluster category,
33+
// One for unclustered points, three for each cluster category,
3434
// and one for cluster labels.
3535
map.addLayer({
36-
"id": "non-cluster-markers",
36+
"id": "unclustered-points",
3737
"type": "symbol",
3838
"source": "earthquakes",
3939
"layout": {
@@ -58,7 +58,7 @@
5858
"circle-color": layer[1],
5959
"circle-radius": 18
6060
},
61-
"filter": i == 0 ?
61+
"filter": i === 0 ?
6262
[">=", "point_count", layer[0]] :
6363
["all",
6464
[">=", "point_count", layer[0]],
@@ -74,9 +74,9 @@
7474
"layout": {
7575
"text-field": "{point_count}",
7676
"text-font": [
77-
"DIN Offc Pro Medium",
78-
"Arial Unicode MS Bold"
79-
],
77+
"DIN Offc Pro Medium",
78+
"Arial Unicode MS Bold"
79+
],
8080
"text-size": 12
8181
}
8282
});

docs/_posts/examples/3400-01-01-heatmap.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
container: 'map',
1313
style: 'mapbox://styles/mapbox/dark-v9',
1414
center: [-103.59179687498357, 40.66995747013945],
15-
zoom: 3,
15+
zoom: 3
1616
});
1717

18-
map.on('load', function(){
18+
map.on('load', function() {
1919

2020
// Add a new source from our GeoJSON data and set the
2121
// 'cluster' option to true.
@@ -30,7 +30,7 @@
3030
});
3131

3232
// Use the earthquakes source to create four layers:
33-
// three for each cluster category, and one for non-clustered markers
33+
// three for each cluster category, and one for unclustered points
3434

3535
// Each point range gets a different fill color.
3636
var layers = [
@@ -58,7 +58,7 @@
5858
});
5959

6060
map.addLayer({
61-
"id": "non-cluster-markers",
61+
"id": "unclustered-points",
6262
"type": "circle",
6363
"source": "earthquakes",
6464
"paint": {

docs/_posts/examples/3400-01-03-fitbounds.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</style>
2323
<div id='map'></div>
2424
<br/>
25-
<button onclick='fit();' id='fit'>Fit to Kenya</button>
25+
<button id='fit'>Fit to Kenya</button>
2626
<script>
2727
var map = new mapboxgl.Map({
2828
container: 'map',
@@ -31,13 +31,14 @@
3131
zoom: 9
3232
});
3333

34-
function fit() {
34+
document.getElementById('fit').addEventListener('click', function() {
3535
map.fitBounds([[
3636
32.958984,
3737
-5.353521
3838
], [
3939
43.50585,
4040
5.615985
4141
]]);
42-
}
42+
});
43+
4344
</script>

docs/_posts/examples/3400-01-03-flyto-options.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</style>
2323
<div id='map'></div>
2424
<br/>
25-
<button onclick='fly();' id='fly'>Fly</button>
25+
<button id='fly'>Fly</button>
2626
<script>
2727
var start = [-74.50, 40];
2828
var end = [74.50, 40];
@@ -35,7 +35,7 @@
3535

3636
var isAtStart = true;
3737

38-
function fly() {
38+
document.getElementById('fly').addEventListener('click', function() {
3939
// depending on whether we're currently at point a or b, aim for
4040
// point a or b
4141
var target = isAtStart ? end : start;
@@ -62,5 +62,5 @@
6262
return t;
6363
}
6464
});
65-
}
65+
});
6666
</script>

docs/_posts/examples/3400-01-03-flyto.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</style>
2323
<div id='map'></div>
2424
<br/>
25-
<button onclick='fly();' id='fly'>Fly</button>
25+
<button id='fly'>Fly</button>
2626
<script>
2727
var map = new mapboxgl.Map({
2828
container: 'map',
@@ -31,13 +31,13 @@
3131
zoom: 9
3232
});
3333

34-
function fly() {
34+
document.getElementById('fly').addEventListener('click', function () {
3535
// Fly to a random location by offsetting the point -74.50, 40
3636
// by up to 5 degrees.
3737
map.flyTo({
3838
center: [
3939
-74.50 + (Math.random() - 0.5) * 10,
4040
40 + (Math.random() - 0.5) * 10]
4141
});
42-
}
42+
});
4343
</script>

0 commit comments

Comments
 (0)