Skip to content
New issue

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

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

Already on GitHub? # to your account

Add a free vector tile services to avoid the usage of a token #5079

Merged
merged 86 commits into from
Oct 30, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
c400861
replace mapbox light basemap with positron
Oct 28, 2020
51256d8
replace mapbox dark basemap with dark-matter
Oct 28, 2020
0be06bb
replace mapbox light basemap with positron
Oct 28, 2020
df13054
replace mapbox dark basemap with dark-matter
Oct 28, 2020
8651014
Gatsby and remove mapbox doc in arc
alasarr Oct 28, 2020
ee04a30
Remove token info from doc
alasarr Oct 28, 2020
f8f18db
Merge branch 'ivan/carto-basemaps' of github.com:visgl/deck.gl into i…
Oct 28, 2020
32cb2ea
change basemaps for examples
Oct 28, 2020
9c303ab
change basemap url to staging
Oct 28, 2020
b585353
remove EnvPlugin from webpack-config
Oct 28, 2020
47f3cef
change basemap to prod version
Oct 28, 2020
09aaa64
minor changes
Oct 28, 2020
0e47ba2
Add CARTO basemaps as a free tile service
alasarr Oct 28, 2020
31190af
More texts to usign-with-map doc
alasarr Oct 28, 2020
dbebf57
fix lint
Oct 29, 2020
0a4942e
remove useless comments
Oct 29, 2020
97581fb
Merge branch 'ivan/carto-basemaps' of github.com:visgl/deck.gl into i…
Oct 29, 2020
e172c00
fixes in mapbox example
Oct 29, 2020
49615c1
move style to const
Oct 29, 2020
132f1dd
fix: mapboxApiAccessToken instead of mapStyle
Oct 29, 2020
bb7933c
replace mapbox light basemap with positron
Oct 28, 2020
34e492d
replace mapbox dark basemap with dark-matter
Oct 28, 2020
52479ee
Gatsby and remove mapbox doc in arc
alasarr Oct 28, 2020
c800c29
Remove token info from doc
alasarr Oct 28, 2020
ca675be
change basemaps for examples
Oct 28, 2020
ec803f8
change basemap url to staging
Oct 28, 2020
9c67784
remove EnvPlugin from webpack-config
Oct 28, 2020
00b107d
change basemap to prod version
Oct 28, 2020
f044327
minor changes
Oct 28, 2020
cc4b1a7
fix lint
Oct 29, 2020
2748006
remove useless comments
Oct 29, 2020
bc631b7
Add CARTO basemaps as a free tile service
alasarr Oct 28, 2020
d3f1760
More texts to usign-with-map doc
alasarr Oct 28, 2020
8b28af3
fixes in mapbox example
Oct 29, 2020
bce7011
move style to const
Oct 29, 2020
8e609e3
fix: mapboxApiAccessToken instead of mapStyle
Oct 29, 2020
1e18d5e
remove MapboxAccessToken where possible in test folder
Oct 29, 2020
246d11a
Merge branch 'ivan/carto-basemaps' of github.com:visgl/deck.gl into i…
Oct 29, 2020
8143721
added new dark/light mapstyles
Oct 29, 2020
7a15148
update basemaps
Oct 29, 2020
52036bb
getting style from constants
Oct 29, 2020
1145188
update README's
Oct 29, 2020
1aad218
change link, redirect to website instead of github doc
Oct 29, 2020
0a934b8
move basemaps doc to carto module
Oct 29, 2020
6b33560
added basemap info to readme
Oct 29, 2020
4e4f7b0
Changing texts at using-with-map.md
alasarr Oct 29, 2020
98638aa
Update readme link
alasarr Oct 29, 2020
306099d
Shader support for extreme latitude coordinates (#5081)
Pessimistress Oct 29, 2020
47c71e8
minor fixes in basemaps
Oct 30, 2020
4e0e687
replace mapbox light basemap with positron
Oct 28, 2020
5fa65cf
replace mapbox dark basemap with dark-matter
Oct 28, 2020
bae9c8b
Gatsby and remove mapbox doc in arc
alasarr Oct 28, 2020
79c9189
Remove token info from doc
alasarr Oct 28, 2020
a258b29
change basemaps for examples
Oct 28, 2020
5a18ebd
change basemap url to staging
Oct 28, 2020
6a16a97
remove EnvPlugin from webpack-config
Oct 28, 2020
eff1af3
change basemap to prod version
Oct 28, 2020
5effcb3
minor changes
Oct 28, 2020
d2a5506
fix lint
Oct 29, 2020
361ada0
remove useless comments
Oct 29, 2020
8bac0b7
Add CARTO basemaps as a free tile service
alasarr Oct 28, 2020
458611e
More texts to usign-with-map doc
alasarr Oct 28, 2020
063f402
fixes in mapbox example
Oct 29, 2020
aa91c72
move style to const
Oct 29, 2020
5fd423a
fix: mapboxApiAccessToken instead of mapStyle
Oct 29, 2020
bb4c6c3
remove MapboxAccessToken where possible in test folder
Oct 29, 2020
5d641fe
replace mapbox light basemap with positron
Oct 28, 2020
64ca822
change basemap to prod version
Oct 28, 2020
7597ce4
fixes in mapbox example
Oct 29, 2020
f98a1a6
added new dark/light mapstyles
Oct 29, 2020
01b879e
update basemaps
Oct 29, 2020
476f85d
getting style from constants
Oct 29, 2020
0d7f3c5
update README's
Oct 29, 2020
0f0a6aa
change link, redirect to website instead of github doc
Oct 29, 2020
c001335
move basemaps doc to carto module
Oct 29, 2020
f5d8f17
added basemap info to readme
Oct 29, 2020
3f2e2be
Changing texts at using-with-map.md
alasarr Oct 29, 2020
12cdfa1
Update readme link
alasarr Oct 29, 2020
47d06c6
minor fixes in basemaps
Oct 30, 2020
d69c1ad
Merge branch 'ivan/carto-basemaps' of github.com:visgl/deck.gl into i…
Oct 30, 2020
e6451bb
basemaps: added runway and taxiway
Oct 30, 2020
2026b46
update basemaps, added buildings and minor roads
Oct 30, 2020
1a8f735
change text in basemap.md
Oct 30, 2020
db216aa
fix: terrain example need token
Oct 30, 2020
af724d5
minor fix in basemaps
Oct 30, 2020
3a8a674
update basemaps doc
Oct 30, 2020
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
22 changes: 21 additions & 1 deletion docs/get-started/using-with-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ If you are using react-map-gl, there are several ways to provide a token to your

It is possible to use the map component without the Mapbox service, if you use another tile source (for example, if you host your own map tiles). You will need a custom Mapbox GL style that points to your own [vector tile source](https://www.mapbox.com/mapbox-gl-js/style-spec/), and pass it to `ReactMapGL` using the `mapStyle` prop. This custom style must match the schema of your tile source.

Existing free vector tile services:

- [CARTO free basemaps](https://carto.com/basemaps) for non commercial applications:


| POSITRON | DARK MATTER | VOYAGER |
alasarr marked this conversation as resolved.
Show resolved Hide resolved
| -------- |-------------| -------- |
|<img src="https://carto.com/help/images/building-maps/basemaps/positron_labels.png" /> | <img src="https://carto.com/help/images/building-maps/basemaps/dark_labels.png" /> | <img src="https://carto.com/help/images/building-maps/basemaps/voyager_labels.png" />
| https://basemaps.cartocdn.com/gl/positron-gl-style/style.json|https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json|https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json


| POSITRON NO LABELS | DARK MATTER NO LABELS | VOYAGER NO LABELS |
| --------------- |--------------------- | -------- |
|<img src="https://carto.com/help/images/building-maps/basemaps/positron_no_labels.png" /> | <img src="https://carto.com/help/images/building-maps/basemaps/dark_no_labels.png" /> | <img src="https://carto.com/help/images/building-maps/basemaps/voyager_no_labels.png" />
| https://basemaps.cartocdn.com/gl/positron-nolabels--gl-style/style.json|https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json|https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json
|

Ensure you follow the [Terms and Conditions](https://drive.google.com/file/d/0B3OBExqwT6KJNHp3U3VUamx6U1U/view) when using them.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this not hosted on carto.com anywhere? It seems like linking to a webpage and not a document on Google Drive would be preferable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we're adding that to our website



Open source tile schemas include:

- [TileZen schema](https://tilezen.readthedocs.io/en/latest/layers/)
Expand All @@ -48,7 +68,7 @@ Some useful resources for creating your own map service:

- [Mapbox Vector Tile Spec](https://www.mapbox.com/developers/vector-tiles/)
- [Open source tools](https://github.com/mapbox/awesome-vector-tiles)

- [Maputnik Style editor](https://maputnik.github.io)

## Using deck.gl with Google Maps

Expand Down
7 changes: 3 additions & 4 deletions examples/experimental/h3-grid/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import {StaticMap} from 'react-map-gl';
import H3GridLayer from './h3-grid-layer';
import {getMinZoom} from './h3-utils';

// Set your mapbox token here
const MAPBOX_TOKEN = process.env.MapboxAccessToken; // eslint-disable-line

const CONTROL_PANEL_STYLE = {
position: 'fixed',
top: 20,
Expand All @@ -20,6 +17,8 @@ const CONTROL_PANEL_STYLE = {
background: '#fff'
};

const MAP_STYLE =
'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json';
// `repeat` will draw multiple copies of the map at low zoom leveles
const MAP_VIEW = new MapView({repeat: true});
// hexagon per tile at minZoom
Expand Down Expand Up @@ -76,7 +75,7 @@ export default function App() {
onViewStateChange={onViewStateChange}
getTooltip={info => info.object}
>
<StaticMap mapStyle="mapbox://styles/mapbox/light-v9" mapboxApiAccessToken={MAPBOX_TOKEN} />
<StaticMap mapStyle={MAP_STYLE} />
</DeckGL>
<div style={CONTROL_PANEL_STYLE}>
<div>Resolution: {resolution}</div>
Expand Down
1 change: 0 additions & 1 deletion examples/experimental/h3-grid/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const CONFIG = {
},

plugins: [
new webpack.EnvironmentPlugin(['MapboxAccessToken']),
alasarr marked this conversation as resolved.
Show resolved Hide resolved
new HtmlWebpackPlugin({title: 'deck.gl example'})
]
};
Expand Down
1 change: 0 additions & 1 deletion examples/gallery/build-tools/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const IMAGE_DIR = 'images';
const MAPBOX_TOKEN = process.env.MapboxAccessToken;
if (!MAPBOX_TOKEN) {
console.log('Missing environment variable: MapboxAccessToken');
process.exit(1);
alasarr marked this conversation as resolved.
Show resolved Hide resolved
}
/* eslint-enable */

Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/arc-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
];

const deckgl = new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/light-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json',
initialViewState: {
longitude: -100,
latitude: 40.7,
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/bitmap-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

// MapBox example : https://docs.mapbox.com/mapbox-gl-js/example/image-on-a-map/
new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/dark-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json',
initialViewState: {
longitude: -75.789,
latitude: 41.874,
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/boiler-plate.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
const {DeckGL, ScatterplotLayer, TextLayer} = deck;

new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/light-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json',
initialViewState: {
longitude: -122.45,
latitude: 37.78,
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/column-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
<script type="text/javascript">
const {DeckGL, ColumnLayer} = deck;
new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/dark-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json',
initialViewState: {
longitude: -122.4,
latitude: 37.74,
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/src/contour-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/dark-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json',
initialViewState: {
longitude: -119.3,
latitude: 35.6,
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/geojson-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@
});

new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/light-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json',
initialViewState: {
latitude: 49.254,
longitude: -123.13,
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/great-circle-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
});

new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/dark-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json',
initialViewState: {
longitude: -122.38,
latitude: 37.6,
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/hexagon-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
const {DeckGL, HexagonLayer} = deck;

const deckgl = new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/dark-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json',
initialViewState: {
longitude: -1.4157,
latitude: 52.2324,
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/highway.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@
maxZoom: 8
},
controller: true,
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/dark-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json',
pickingRadius: 5,
layers: [],
getTooltip
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/line-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
const {DeckGL, LineLayer} = deck;

new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/dark-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json',
initialViewState: {
latitude: 51.51,
longitude: -0.11,
Expand Down
4 changes: 1 addition & 3 deletions examples/gallery/src/mapbox-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@

const {MapboxLayer, ScatterplotLayer} = deck;

mapboxgl.accessToken = '<mapbox-access-token>';
alasarr marked this conversation as resolved.
Show resolved Hide resolved

const map = new mapboxgl.Map({
container: document.body,
style: 'mapbox://styles/mapbox/light-v9',
alasarr marked this conversation as resolved.
Show resolved Hide resolved
style: 'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json',
center: [-122.4, 37.79],
zoom: 15,
pitch: 60
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/scatterplot-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
const FEMALE_COLOR = [255, 0, 128];

new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/light-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json',
initialViewState: {
longitude: -74,
latitude: 40.76,
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/screengrid-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
const {DeckGL, ScreenGridLayer} = deck;

new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/dark-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json',
initialViewState: {
longitude: -119.3,
latitude: 35.6,
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/text-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
const {DeckGL,TextLayer} = deck;

const deckgl = new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/dark-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json',
initialViewState: {
longitude: -122.4,
latitude: 37.74,
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/tile-3d-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
const {I3SLoader} = loaders;

const deckgl = new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/dark-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json',
initialViewState: INITIAL_VIEW_STATE,
controller: true,
layers: [
Expand Down
3 changes: 1 addition & 2 deletions examples/gallery/src/viewport-transition.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@

// Deck canvas
const deckgl = new DeckGL({
mapboxApiAccessToken: '<mapbox-access-token>',
mapStyle: 'mapbox://styles/mapbox/light-v9',
mapStyle: 'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json',
initialViewState: {
longitude: CITIES[0].longitude,
latitude: CITIES[0].latitude,
Expand Down
5 changes: 2 additions & 3 deletions examples/get-started/pure-js/mapbox/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ const INITIAL_VIEW_STATE = {
pitch: 30
};

// Set your mapbox token here
mapboxgl.accessToken = process.env.MapboxAccessToken; // eslint-disable-line
const MAP_STYLE = 'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json'

const map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/light-v9',
style: MAP_STYLE,
// Note: deck.gl will be in charge of interaction and event handling
interactive: false,
center: [INITIAL_VIEW_STATE.longitude, INITIAL_VIEW_STATE.latitude],
Expand Down
5 changes: 1 addition & 4 deletions examples/get-started/pure-js/mapbox/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ const CONFIG = {
// From mapbox-gl-js README. Required for non-browserify bundlers (e.g. webpack):
'mapbox-gl$': resolve('./node_modules/mapbox-gl/dist/mapbox-gl.js')
}
},

// Optional: Enables reading mapbox token from environment variable
plugins: [new webpack.EnvironmentPlugin(['MapboxAccessToken'])]
alasarr marked this conversation as resolved.
Show resolved Hide resolved
}
alasarr marked this conversation as resolved.
Show resolved Hide resolved
};

// This line enables bundling against src in this repo rather than installed module
Expand Down
7 changes: 3 additions & 4 deletions examples/get-started/react/mapbox/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import {render} from 'react-dom';
import {StaticMap} from 'react-map-gl';
import DeckGL, {GeoJsonLayer, ArcLayer} from 'deck.gl';

// Set your mapbox token here
const MAPBOX_TOKEN = process.env.MapboxAccessToken; // eslint-disable-line

// source: Natural Earth http://www.naturalearthdata.com/ via geojson.xyz
const AIR_PORTS =
'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_10m_airports.geojson';
Expand All @@ -18,6 +15,8 @@ const INITIAL_VIEW_STATE = {
pitch: 30
};

const MAP_STYLE = 'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json'

function Root() {
const onClick = info => {
if (info.object) {
Expand Down Expand Up @@ -56,7 +55,7 @@ function Root() {

return (
<DeckGL initialViewState={INITIAL_VIEW_STATE} controller={true} layers={layers}>
<StaticMap mapboxApiAccessToken={MAPBOX_TOKEN} mapStyle="mapbox://styles/mapbox/light-v9" />
<StaticMap mapStyle={MAP_STYLE} />
</DeckGL>
);
}
Expand Down
1 change: 0 additions & 1 deletion examples/get-started/react/mapbox/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const CONFIG = {

// Optional: Enables reading mapbox token from environment variable
plugins: [
new webpack.EnvironmentPlugin(['MapboxAccessToken']),
new HtmlWebpackPlugin({title: 'deck.gl example'})
]
};
Expand Down
14 changes: 4 additions & 10 deletions examples/layer-browser/src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import {COORDINATE_SYSTEM, View} from '@deck.gl/core';
import LayerInfo from './components/layer-info';
import {RenderMetrics} from './render-metrics';

/* eslint-disable no-process-env */
const MapboxAccessToken =
process.env.MapboxAccessToken || // eslint-disable-line
'Set MapboxAccessToken environment variable or put your token here.';

const NAVIGATION_CONTROL_STYLES = {
margin: 10,
position: 'absolute'
Expand Down Expand Up @@ -46,6 +41,9 @@ const INITIAL_VIEW_STATES = {
}
};

const MAP_STYLE =
'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json';

const ViewportLabel = props => <div style={VIEW_LABEL_STYLES}>{props.children}</div>;

export default class Map extends PureComponent {
Expand Down Expand Up @@ -160,11 +158,7 @@ export default class Map extends PureComponent {
_onMetrics={this._onMetrics}
>
<View id="basemap">
<StaticMap
key="map"
mapStyle="mapbox://styles/mapbox/light-v9"
mapboxApiAccessToken={MapboxAccessToken || 'no_token'}
/>
<StaticMap key="map" mapStyle={MAP_STYLE} />
<ViewportLabel key="label">Map View</ViewportLabel>
</View>

Expand Down
5 changes: 1 addition & 4 deletions examples/layer-browser/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ const CONFIG = {

node: {
fs: 'empty'
},

// Optional: Enables reading mapbox token from environment variable
plugins: [new webpack.EnvironmentPlugin(['MapboxAccessToken'])]
}
};

// This line enables bundling against src in this repo rather than installed deck.gl module
Expand Down
4 changes: 2 additions & 2 deletions examples/playground/json-examples/3d-heatmap-minimap.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
{
"@@type": "MapView",
"id": "main",
"mapStyle": "mapbox://styles/mapbox/dark-v9",
"mapStyle": "https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",
"controller": true
},
{
"@@type": "MapView",
"id": "minimap",
"mapStyle": "mapbox://styles/mapbox/light-v9",
"mapStyle": "https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",
"width": "40%",
"height": "40%",
"x": "55%",
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/json-examples/3d-heatmap.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{
"@@type": "MapView",
"controller": true,
"mapStyle": "mapbox://styles/mapbox/dark-v9"
"mapStyle": "https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json"
}
],
"layers": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"views": [
{
"@@type": "MapView",
"mapStyle": "mapbox://styles/mapbox/dark-v9",
"mapStyle": "https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",
"controller": true
}
],
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/json-examples/3d-tiles-new-york.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"views": [
{
"@@type": "MapView",
"mapStyle": "mapbox://styles/mapbox/dark-v9",
"mapStyle": "https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",
"controller": true
}
],
Expand Down
Loading