API & Client - tile server for map can be changed - fix #54

This commit is contained in:
Sam
2020-09-16 11:47:20 +02:00
parent 98fb8e95f8
commit a5e40612ba
14 changed files with 135 additions and 53 deletions

View File

@ -4,7 +4,7 @@ import { GeoJSON, Map, Marker, TileLayer } from 'react-leaflet'
import { connect } from 'react-redux'
import { getActivityGpx, getSegmentGpx } from '../../../actions/activities'
import { thunderforestApiKey } from '../../../utils'
import { apiUrl } from '../../../utils'
import { getGeoJson } from '../../../utils/activities'
class ActivityMap extends React.Component {
@ -62,8 +62,8 @@ class ActivityMap extends React.Component {
<TileLayer
// eslint-disable-next-line max-len
attribution='&copy; <a href="http://www.thunderforest.com/">Thunderforest</a>, &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
// eslint-disable-next-line max-len
url={`https://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=${thunderforestApiKey}`}
url={`${apiUrl}activities/map_tile/{s}/{z}/{x}/{y}.png`}
/>
<GeoJSON
// hash as a key to force re-rendering

View File

@ -19,10 +19,6 @@ export const getFileSizeInMB = fileSize => {
export const version = '0.3.0-beta' // version stored in 'utils' for now
export const apiUrl = `${process.env.REACT_APP_API_URL}/api/`
/* prettier-ignore */
export const thunderforestApiKey = `${
process.env.REACT_APP_THUNDERFOREST_API_KEY
}`
export const userFilters = [
{ key: 'activities_count', label: 'activities count' },