File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -4,22 +4,28 @@ import { TileLayer } from 'react-leaflet'
4
4
5
5
class RoutesOverlay extends Component {
6
6
static propTypes = {
7
+ tileUrl : PropTypes . string
7
8
}
8
9
9
10
render ( ) {
10
- return (
11
- < TileLayer
12
- url = 'https://d2dyq00q2cz8yt.cloudfront.net/{z}_{x}_{y}@2x.png'
13
- />
14
- )
11
+ return this . props . tileUrl
12
+ ? < TileLayer url = { this . props . tileUrl } />
13
+ : null
15
14
}
16
15
}
17
16
18
17
// connect to the redux store
19
18
20
19
const mapStateToProps = ( state , ownProps ) => {
21
20
// TODO: pass in tileset via config
22
- return { }
21
+ return {
22
+ tileUrl :
23
+ state . otp . config . map &&
24
+ state . otp . config . map . routesOverlay &&
25
+ state . otp . config . map . routesOverlay . tileUrl
26
+ ? state . otp . config . map . routesOverlay . tileUrl
27
+ : null
28
+ }
23
29
}
24
30
25
31
const mapDispatchToProps = { }
You can’t perform that action at this time.
0 commit comments