API & Client - update map attribution to match tile server - fix #54

This commit is contained in:
Sam
2020-09-16 13:01:15 +02:00
parent a5e40612ba
commit a5a2033918
16 changed files with 242 additions and 123 deletions

View File

@ -44,7 +44,7 @@ class ActivityMap extends React.Component {
}
render() {
const { activity, coordinates, gpxContent } = this.props
const { activity, coordinates, gpxContent, mapAttribution } = this.props
const { jsonData } = getGeoJson(gpxContent)
const bounds = [
[activity.bounds[0], activity.bounds[1]],
@ -61,9 +61,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>'
attribution={mapAttribution}
url={`${apiUrl}activities/map_tile/{s}/{z}/{x}/{y}.png`}
/>
<GeoJSON
// hash as a key to force re-rendering
@ -85,6 +84,7 @@ class ActivityMap extends React.Component {
export default connect(
state => ({
gpxContent: state.gpx,
mapAttribution: state.application.config.map_attribution,
}),
dispatch => ({
loadActivityGpx: activityId => {