Skip to content

Commit 6a64eb4

Browse files
author
David Emory
committed
feat(map): Make route overlay url configurable
1 parent de127d1 commit 6a64eb4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

lib/components/map/routes-overlay.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,28 @@ import { TileLayer } from 'react-leaflet'
44

55
class RoutesOverlay extends Component {
66
static propTypes = {
7+
tileUrl: PropTypes.string
78
}
89

910
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
1514
}
1615
}
1716

1817
// connect to the redux store
1918

2019
const mapStateToProps = (state, ownProps) => {
2120
// 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+
}
2329
}
2430

2531
const mapDispatchToProps = { }

0 commit comments

Comments
 (0)