Skip to content

Commit 7d948bf

Browse files
author
Lucas Wojciechowski
committed
Merge remote-tracking branch 'origin/mb-pages'
2 parents d3cc7c5 + 024f65f commit 7d948bf

25 files changed

+276
-35
lines changed

docs/_layouts/docs.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,53 @@
44
options: full
55
---
66

7+
78
<div class='round doc clip fill-white keyline-all'>
9+
10+
<section class='pad4 keyline-bottom contain'>
11+
12+
<div class='pin-topright pad2'>
13+
<a class='icon github short button quiet' href="https://github.com/mapbox/mapbox-gl-js">Project on GitHub</a>
14+
</div>
15+
16+
<h1 class='space-bottom2'>
17+
Mapbox GL JS
18+
</h1>
19+
20+
<div class='prose space-bottom2'>
21+
<p>Mapbox GL JS is a JavaScript library that uses WebGL to render interactive maps from <a href='https://www.mapbox.com/blog/vector-tiles'>vector tiles</a> and <a href='https://www.mapbox.com/mapbox-gl-style-spec'>Mapbox GL styles</a><p>
22+
<p>It is part of the <a href='https://github.com/mapbox/mapbox-gl'>Mapbox GL ecosystem</a> which includes <a href='https://www.mapbox.com/mobile/'>Mapbox Mobile</a>, a compatible renderer written in C++ with bindings for desktop and mobile platforms.</p>
23+
<a href='https://www.mapbox.com/gallery/'><img width='981' alt='Mapbox GL JS gallery' src='{{site.baseurl}}/assets/gallery.png'></a>
24+
</div>
25+
26+
<h2 class='space'>Using Mapbox GL JS with a <code>&lt;script&gt;</code> tag</h2>
27+
28+
<div class='prose space-bottom2'>
29+
<p>To use the <a href='https://www.mapbox.com/maps/'>vector tiles</a> and styles hosted on <a href='http://mapbox.com'>Mapbox</a>, you must <a href='https://www.mapbox.com/studio/signup/'>create an account</a> and <a href='https://www.mapbox.com/studio/account/tokens/'>obtain an access token</a>. You can learn more about access tokens <a href='https://www.mapbox.com/help/define-access-token/'>here</a>.
30+
31+
<pre>
32+
&lt;!DOCTYPE html&gt;
33+
&lt;html&gt;
34+
&lt;head&gt;
35+
&lt;script src='https://api.tiles.mapbox.com/mapbox-gl-js/{{site.version}}/mapbox-gl.js'&gt;&lt;/script&gt;
36+
&lt;link href='https://api.tiles.mapbox.com/mapbox-gl-js/{{site.version}}/mapbox-gl.css' rel='stylesheet'&gt;
37+
&lt;/head&gt;
38+
39+
&lt;body&gt;
40+
&lt;div id='map' style='width: 400px; height: 300px;' /&gt;
41+
42+
&lt;script&gt;
43+
mapboxgl.accessToken = '&lt;your access token here&gt;';
44+
var map = new mapboxgl.Map({
45+
container: 'map',
46+
style: 'mapbox://styles/mapbox/streets-v8'
47+
});
48+
&lt;/script&gt;
49+
&lt;/body&gt;
50+
&lt;/html&gt;
51+
</pre>
52+
</div>
53+
</section>
54+
855
{{ content }}
956
</div>

docs/_layouts/example.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
2-
layout: docs
2+
layout: pages
33
---
4+
5+
<div class='round doc clip fill-white keyline-all'>
6+
47
<style>
58
.fill-white pre { background-color:transparent; }
69
</style>
@@ -76,4 +79,4 @@
7679
<a class='button icon clipboard col12 round-bottom js-clipboard' href='#' data-clipboard-target='code' id='copy'>Copy example</a>
7780
</div>
7881

79-
82+
</div>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
zoom: 3,
1616
});
1717

18-
map.on('style.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.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
zoom: 3,
1616
});
1717

18-
map.on('style.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.

docs/_posts/examples/3400-01-01-toggle-layers.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
center: [-71.97722138410576, -13.517379300798098]
6060
});
6161

62-
map.on('style.load', function () {
62+
map.on('load', function () {
6363
map.addSource('museums', {
6464
type: 'vector',
6565
url: 'mapbox://mapbox.2opop9hr'
@@ -68,6 +68,9 @@
6868
'id': 'museums',
6969
'type': 'circle',
7070
'source': 'museums',
71+
'layout': {
72+
'visibility': 'visible'
73+
},
7174
'paint': {
7275
'circle-radius': 8,
7376
'circle-color': 'rgba(55,148,179,1)'
@@ -85,6 +88,7 @@
8588
'source': 'contours',
8689
'source-layer': 'contour',
8790
'layout': {
91+
'visibility': 'visible',
8892
'line-join': 'round',
8993
'line-cap': 'round'
9094
},

docs/_posts/examples/3400-01-01-vector-source.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
center: [-122.447303, 37.753574]
1414
});
1515

16-
map.on('style.load', function () {
16+
map.on('load', function () {
1717
map.addSource('terrain-data', {
1818
type: 'vector',
1919
url: 'mapbox://mapbox.mapbox-terrain-v2'

docs/_posts/examples/3400-01-04-center-on-symbol.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
zoom: 8
1414
});
1515

16-
map.on('style.load', function () {
16+
map.on('load', function () {
1717

1818
// add geojson data as a new source
1919
map.addSource("symbols", {

docs/_posts/examples/3400-01-04-geojson-layer-in-stack.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
zoom: 4
1414
});
1515

16-
map.on('style.load', function () {
16+
map.on('load', function () {
1717
map.addSource('urban-areas', {
1818
'type': 'geojson',
1919
'data': 'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_50m_urban_areas.geojson'

docs/_posts/examples/3400-01-04-geojson-line.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
zoom: 15
1414
});
1515

16-
map.on('style.load', function () {
16+
map.on('load', function () {
1717
map.addSource("route", {
1818
"type": "geojson",
1919
"data": {

docs/_posts/examples/3400-01-04-geojson-polygon.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
zoom: 5
1414
});
1515

16-
map.on('style.load', function () {
16+
map.on('load', function () {
1717
map.addSource('maine', {
1818
'type': 'geojson',
1919
'data': {

0 commit comments

Comments
 (0)