From fdcf7b592cc426b0218737fadcdf0efc084a7e57 Mon Sep 17 00:00:00 2001 From: Xintong Xia Date: Fri, 22 Mar 2019 06:58:01 +0800 Subject: [PATCH] remove mapbox baseMap --- examples/website/openstreet-map/app.js | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/examples/website/openstreet-map/app.js b/examples/website/openstreet-map/app.js index 6233999c0e8..a7da98d22cf 100644 --- a/examples/website/openstreet-map/app.js +++ b/examples/website/openstreet-map/app.js @@ -1,13 +1,9 @@ import React, {Component} from 'react'; import {render} from 'react-dom'; -import {StaticMap} from 'react-map-gl'; import DeckGL, {TileLayer, BitmapLayer} from 'deck.gl'; import {loadImage} from '@loaders.gl/core'; -// Set your mapbox token here -const MAPBOX_TOKEN = process.env.MapboxAccessToken; // eslint-disable-line - export const INITIAL_VIEW_STATE = { latitude: 47.65, longitude: 7, @@ -37,6 +33,7 @@ function tileIndexToBounds({x, y, z}) { export class App extends Component { constructor(props) { super(props); + this.state = {}; this._getTileData = this._getTileData.bind(this); } @@ -55,7 +52,10 @@ export class App extends Component { }); }); - return new BitmapLayer({id: layerId, ...this.state[layerId]}); + return new BitmapLayer({ + id: layerId, + ...this.state[layerId] + }); } }) ]; @@ -63,7 +63,6 @@ export class App extends Component { _getTileData({x, y, z}) { const [west, south, east, north] = tileIndexToBounds({x, y, z}); - // const mapSource = `https://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v7/${z}/${x}/${y}.vector.pbf?access_token=${MAPBOX_TOKEN}`; const mapSource = `https://${s}.tile.openstreetmap.org/${z}/${x}/${y}.png`; return loadImage(mapSource).then(data => { return { @@ -74,7 +73,7 @@ export class App extends Component { } render() { - const {viewState, controller = true, baseMap = true} = this.props; + const {viewState, controller = true} = this.props; return ( - {baseMap && ( - - )} - + /> ); } }