-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Opens the door for WMS, and other customized basemaps.
- Loading branch information
1 parent
0d90c31
commit 08f23c1
Showing
14 changed files
with
99 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
BlacklightHeatmaps.Basemaps = { | ||
darkMatter: L.tileLayer( | ||
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png', { | ||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://cartodb.com/attributions">CartoDB</a>', | ||
maxZoom: 18, | ||
worldCopyJump: true, | ||
detectRetina: true, | ||
} | ||
), | ||
positron: L.tileLayer( | ||
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', { | ||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://cartodb.com/attributions">CartoDB</a>', | ||
maxZoom: 18, | ||
worldCopyJump: true, | ||
detectRetina: true, | ||
} | ||
), | ||
'OpenStreetMap.HOT': L.tileLayer( | ||
'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', { | ||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>', | ||
maxZoom: 19, | ||
} | ||
), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<% features = document.to_geojson(blacklight_config) %> | ||
<% unless features.nil? %> | ||
<%= content_tag(:div, nil, class: 'blacklight-heatmaps-show-map', id: "map-#{document.id}", data: {show_map: true, features: features, basemap: blacklight_config.basemap}) %> | ||
<%= content_tag(:div, nil, class: 'blacklight-heatmaps-show-map', id: "map-#{document.id}", data: {show_map: true, features: features, basemap_provider: blacklight_config.basemap_provider}) %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require 'spec_helper' | ||
|
||
feature 'Configurable basemap', js: true do | ||
scenario 'defaults to positron' do | ||
visit search_catalog_path(q: ' ', view: 'heatmaps', search_field: 'all_fields') | ||
expect(page).to have_css "img[src*='light_all']" | ||
end | ||
feature 'without configured basemap' do | ||
before do | ||
CatalogController.blacklight_config.basemap_provider = nil | ||
end | ||
scenario 'defaults to positron' do | ||
visit search_catalog_path(q: ' ', view: 'heatmaps', search_field: 'all_fields') | ||
expect(page).to have_css "img[src*='light_all']" | ||
end | ||
end | ||
feature 'with alterate configured basemap' do | ||
before do | ||
CatalogController.blacklight_config.basemap_provider = 'darkMatter' | ||
end | ||
after do | ||
CatalogController.blacklight_config.basemap_provider = 'positron' | ||
end | ||
scenario 'defaults to positron' do | ||
visit search_catalog_path(q: ' ', view: 'heatmaps', search_field: 'all_fields') | ||
expect(page).to have_css "img[src*='dark_all']" | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters