Skip to content

Commit

Permalink
refinements to config-basemap branch
Browse files Browse the repository at this point in the history
cleanup
  • Loading branch information
eliotjordan committed Apr 27, 2015
1 parent 8519623 commit 8b8052c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
26 changes: 26 additions & 0 deletions app/assets/javascripts/geoblacklight/basemaps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// basemaps

GeoBlacklight.Basemaps = {
darkMatter: L.tileLayer(
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.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
}
),
mapquest: L.tileLayer(
'https://otile{s}-s.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="//developer.mapquest.com/content/osm/mq_logo.png" alt="">',
maxZoom: 18,
worldCopyJump: true,
subdomains: '1234' // see http://developer.mapquest.com/web/products/open/map
}
),
positron: L.tileLayer(
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.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
}
)
};
31 changes: 3 additions & 28 deletions app/assets/javascripts/geoblacklight/viewers/map.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,15 @@
//= require geoblacklight/viewers/viewer

GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({

options: {
/**
* Initial bounds of map
* @type {L.LatLngBounds}
*/
bbox: [[-80, -195], [80, 185]]
},

basemap: {
darkMatter: L.tileLayer(
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.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
}
),
mapquest: L.tileLayer(
'https://otile{s}-s.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="//developer.mapquest.com/content/osm/mq_logo.png" alt="">',
maxZoom: 18,
worldCopyJump: true,
subdomains: '1234' // see http://developer.mapquest.com/web/products/open/map
}
),
positron: L.tileLayer(
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.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
}
)
},


overlay: L.layerGroup(),

load: function() {
Expand Down Expand Up @@ -77,7 +52,7 @@ GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({
selectBasemap: function() {
var _this = this;
if (_this.data.basemap) {
return _this.basemap[_this.data.basemap];
return GeoBlacklight.Basemaps[_this.data.basemap];
} else {
return _this.basemap.mapquest;
}
Expand Down
1 change: 1 addition & 0 deletions lib/generators/geoblacklight/templates/geoblacklight.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//= require geoblacklight/geoblacklight
//= require geoblacklight/basemaps
//= require geoblacklight/viewers
//= require geoblacklight/modules
//= require geoblacklight/downloaders
Expand Down

0 comments on commit 8b8052c

Please sign in to comment.