App style is now single source of truth

This commit is contained in:
lukasmartinelli
2016-09-10 13:42:23 +02:00
parent c84318e6fe
commit e0a8b0a8e9
5 changed files with 117 additions and 122 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ export class Map extends React.Component {
componentWillReceiveProps(nextProps) {
const map = this.state.map
if(map) {
const changes = diffStyles(this.props.mapStyle, nextProps.mapStyle)
const changes = diffStyles(this.props.mapStyle.toJS(), nextProps.mapStyle.toJS())
changes.forEach(change => {
map[change.command].apply(map, change.args);
});
@@ -26,7 +26,7 @@ export class Map extends React.Component {
MapboxGl.accessToken = "pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6IjIzcmN0NlkifQ.0LRTNgCc-envt9d5MzR75w";
const map = new MapboxGl.Map({
container: this.container,
style: this.props.mapStyle,
style: this.props.mapStyle.toJS(),
});
map.on("style.load", (...args) => {