import React from 'react' import { GeoJSON, Map, TileLayer } from 'react-leaflet' import { connect } from 'react-redux' import { getActivityGpx } from '../../actions/activities' import { getGeoJson, thunderforestApiKey } from '../../utils' class ActivityMap extends React.Component { constructor(props, context) { super(props, context) this.state = { zoom: 13, } } componentDidMount() { this.props.loadActivityGpx(this.props.activity.id) } componentWillUnmount() { this.props.loadActivityGpx(null) } render() { const { gpxContent } = this.props const { jsonData, bounds } = getGeoJson(gpxContent) return (