Skip to content

Commit

Permalink
Update Map.js
Browse files Browse the repository at this point in the history
Fixing bug with deprecated map styles
  • Loading branch information
ebefarooqui authored Oct 5, 2022
1 parent 3267384 commit db81563
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/space/carto/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {

// NB: important constants for map, TODO: make statics
// Note: Base map is OpenStreetMaps by default; can choose another base map
const supportedMapboxMap = ["streets", "satellite"];
const supportedMapboxMap = ["streets-v11", "satellite"];
const defaultToken = "your_token";

class Map extends React.Component {
Expand Down Expand Up @@ -114,10 +114,10 @@ class Map extends React.Component {
}

if (supportedMapboxMap.indexOf(this.props.ui.tiles) !== -1) {
return `http://a.tiles.mapbox.com/v4/mapbox.${tiles}/{z}/{x}/{y}@2x.png?access_token=${process.env.MAPBOX_TOKEN}`;
return `https://api.mapbox.com/styles/v1/${this.props.ui.tiles}/tiles/{z}/{x}/{y}?access_token=${process.env.accessToken}`;
}

return `http://a.tiles.mapbox.com/styles/v1/${this.props.ui.tiles}/tiles/{z}/{x}/{y}?access_token=${process.env.MAPBOX_TOKEN}`;
return `https://api.mapbox.com/styles/v1/${supportedMapboxMap[0]}/tiles/{z}/{x}/{y}?access_token=${process.env.accessToken}`;
}

/**
Expand Down

0 comments on commit db81563

Please sign in to comment.