Skip to content

Commit

Permalink
add retina to cartodb basemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotjordan committed Jul 27, 2016
1 parent 10b412a commit 1abb366
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 6 additions & 4 deletions app/assets/javascripts/geoblacklight/basemaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@

GeoBlacklight.Basemaps = {
darkMatter: L.tileLayer(
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png', {
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}{retina}.png', {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>',
maxZoom: 18,
worldCopyJump: true,
detectRetina: true
retina: '@2x',
detectRetina: false
}
),
positron: L.tileLayer(
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', {
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{retina}.png', {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>',
maxZoom: 18,
worldCopyJump: true,
detectRetina: true
retina: '@2x',
detectRetina: false
}
)
};
10 changes: 2 additions & 8 deletions app/assets/javascripts/geoblacklight/viewers/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,10 @@ GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({
*/
selectBasemap: function() {
var _this = this;
var basemap;

if (_this.data.basemap) {
basemap = GeoBlacklight.Basemaps[_this.data.basemap];
return GeoBlacklight.Basemaps[_this.data.basemap];
} else {
basemap = _this.basemap.positron;
return GeoBlacklight.Basemaps.positron;
}

// Use value from app settings to set the detect retina option.
basemap.options.detectRetina = _this.detectRetina();
return basemap;
}
});

0 comments on commit 1abb366

Please sign in to comment.