diff --git a/src/actions/index.js b/src/actions/index.js
index 266310c..9a2cc74 100644
--- a/src/actions/index.js
+++ b/src/actions/index.js
@@ -383,6 +383,13 @@ export function toggleCover() {
};
}
+export const TOGGLE_TILE_OVERLAY = "TOGGLE_TILE_OVERLAY";
+export function toggleTileOverlay() {
+ return {
+ type: TOGGLE_TILE_OVERLAY,
+ };
+}
+
export const UPDATE_SEARCH_QUERY = "UPDATE_SEARCH_QUERY";
export function updateSearchQuery(searchQuery) {
return {
@@ -400,17 +407,3 @@ export function fetchSourceError(msg) {
msg,
};
}
-
-export const USE_SATELLITE_TILES_OVERLAY = "USE_SATELLITE_TILES_OVERLAY";
-export function useSatelliteTilesOverlay() {
- return {
- type: USE_SATELLITE_TILES_OVERLAY,
- };
-}
-
-export const RESET_TILES_OVERLAY = "RESET_TILES_OVERLAY";
-export function resetTilesOverlay() {
- return {
- type: RESET_TILES_OVERLAY,
- };
-}
diff --git a/src/components/space/carto/Map.js b/src/components/space/carto/Map.js
index ed3bd57..48979d7 100644
--- a/src/components/space/carto/Map.js
+++ b/src/components/space/carto/Map.js
@@ -64,7 +64,7 @@ class Map extends React.Component {
}
componentDidUpdate(prevProps) {
- if (prevProps.ui.tiles !== this.props.ui.tiles && this.map) {
+ if (prevProps.ui.tile !== this.props.ui.tile && this.map) {
this.initializeTileLayer();
}
}
@@ -105,18 +105,18 @@ class Map extends React.Component {
}
}
- getTileUrl(tiles) {
+ getTileUrl(tile) {
if (
supportedMapboxMap.indexOf(this.props.ui.tiles) !== -1 &&
process.env.MAPBOX_TOKEN &&
process.env.MAPBOX_TOKEN !== defaultToken
) {
- return `http://a.tiles.mapbox.com/v4/mapbox.${tiles}/{z}/{x}/{y}@2x.png?access_token=${process.env.MAPBOX_TOKEN}`;
+ return `http://a.tiles.mapbox.com/v4/mapbox.${tile}/{z}/{x}/{y}@2x.png?access_token=${process.env.MAPBOX_TOKEN}`;
} else if (
process.env.MAPBOX_TOKEN &&
process.env.MAPBOX_TOKEN !== defaultToken
) {
- return `https://api.mapbox.com/styles/v1/${tiles}/tiles/256/{z}/{x}/{y}@2x?access_token=${process.env.MAPBOX_TOKEN}`;
+ return `https://api.mapbox.com/styles/v1/${tile}/tiles/256/{z}/{x}/{y}@2x?access_token=${process.env.MAPBOX_TOKEN}`;
// `http://a.tiles.mapbox.com/styles/v1/${this.props.ui.tiles}/tiles/{z}/{x}/{y}?access_token=${process.env.MAPBOX_TOKEN}`
} else {
return "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
@@ -132,7 +132,7 @@ class Map extends React.Component {
return;
}
- const url = this.getTileUrl(this.props.ui.tiles);
+ const url = this.getTileUrl(this.props.ui.tile);
/**
* If a tile layer already exists, we update its url. Otherwise, we create it and add it to the map.
*/
@@ -548,9 +548,8 @@ class Map extends React.Component {
/>
{this.props.features.USE_SATELLITE_OVERLAY_TOGGLE && (