developmentseed / rem-web-demo

Demo visualiztion of REM model developed at MIT Tata center
http://developmentseed.github.io/rem-web-demo
MIT License
1 stars 5 forks source link

Attribution is shown twice and no disclaimer is shown #4

Closed stephenjlee closed 8 years ago

stephenjlee commented 8 years ago

The Mapbox/OSM attribution shows twice on the bottom of the screen, and there is no disclaimer on the bottom of the screen.

We would like the disclaimer to show: "Disclaimer: FOR DEMONSTRATION PURPOSES ONLY. Data shown is not an official recommendation by Development Seed or the MIT-Comillas Universal Energy Access Research Group"

Changing the _update function as follows is a slightly hacky way I thought of to do it:

    _update: function() {
        var attributions = [];
        attributions.push('Discliamer: FOR DEMONSTRATION PURPOSES ONLY. Data shown is not an official recommendation by Development Seed or the MIT-Comillas Universal Energy Access Research Group');
        if (this._map.style) {
            for (var id in this._map.style.sources) {
                if(id == 'satellite'){
                    var source = this._map.style.sources[id];
                    if (source.attribution && attributions.indexOf(source.attribution) < 0) {
                        attributions.push(source.attribution);
                    }
                }
            }
        }
        this._container.innerHTML = attributions.join(' | ');
        this._editLink = this._container.getElementsByClassName('mapbox-improve-map')[0];
        this._updateEditLink();
    },