add correct attributions for map tiles of Heidelberg University
remove personal credentials from mapbox and refactored some code #5813 Signed-off-by: zaziemo <maren.heltsche@gmail.com>
This commit is contained in:
parent
57b7c05c4f
commit
0f3eff8f88
5 changed files with 35 additions and 32 deletions
|
|
@ -15,16 +15,18 @@ app.views.LocationStream = app.views.Content.extend({
|
||||||
mapContainer.css("height", "150px");
|
mapContainer.css("height", "150px");
|
||||||
|
|
||||||
if (location.lat) {
|
if (location.lat) {
|
||||||
// If the mapbox option is enabled in the defaults the mapbox tiles with the podmin's credentials are used.
|
|
||||||
// If mapbox is not enabled the OpenMapSurfer tiles are used, which don't need credentials.
|
// If the mapbox option is enabled in the diaspora.yml, the mapbox tiles with the podmin's credentials are used.
|
||||||
|
// If mapbox is not enabled the Maptiles from the Heidelberg University are used, which don't need credentials.
|
||||||
var mapsource = gon.appConfig.map.mapbox.enabled ? gon.appConfig.map.mapbox : "";
|
var mapsource = gon.appConfig.map.mapbox.enabled ? gon.appConfig.map.mapbox : "";
|
||||||
var tileLayerSource = mapsource ? "https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}"
|
var tileLayerSource = mapsource ? "https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}"
|
||||||
: "http://korona.geog.uni-heidelberg.de/tiles/roads/x={x}&y={y}&z={z}";
|
: "http://korona.geog.uni-heidelberg.de/tiles/roads/x={x}&y={y}&z={z}";
|
||||||
var tileAttribution = mapsource ? "<a href='https://www.mapbox.com'>Mapbox</a>"
|
var tileAttribution = mapsource ? "<a href='http://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
|
||||||
: "<a href='http://korona.geog.uni-heidelberg.de/contact.html'>OpenMapSurfer</a>";
|
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>"
|
||||||
|
: "rendering <a href='http://giscience.uni-hd.de/'>" +
|
||||||
|
"GIScience Research Group @ Heidelberg University</a>";
|
||||||
var attribution = "Map data © <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, " +
|
var attribution = "Map data © <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, " +
|
||||||
"<a href='http://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
|
tileAttribution;
|
||||||
"Imagery © "+ tileAttribution;
|
|
||||||
|
|
||||||
var map = L.map(mapContainer[0]).setView([location.lat, location.lng], 14);
|
var map = L.map(mapContainer[0]).setView([location.lat, location.lng], 14);
|
||||||
L.tileLayer(tileLayerSource, {
|
L.tileLayer(tileLayerSource, {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ app.views.SinglePostContent = app.views.Base.extend({
|
||||||
"click .near-from": "toggleMap"
|
"click .near-from": "toggleMap"
|
||||||
},
|
},
|
||||||
|
|
||||||
templateName: 'single-post-viewer/single-post-content',
|
templateName: "single-post-viewer/single-post-content",
|
||||||
tooltipSelector: "time, .post_scope",
|
tooltipSelector: "time, .post_scope",
|
||||||
|
|
||||||
subviews : {
|
subviews : {
|
||||||
|
|
@ -14,7 +14,7 @@ app.views.SinglePostContent = app.views.Base.extend({
|
||||||
"#real-post-content" : "postContentView",
|
"#real-post-content" : "postContentView",
|
||||||
".oembed" : "oEmbedView",
|
".oembed" : "oEmbedView",
|
||||||
".opengraph" : "openGraphView",
|
".opengraph" : "openGraphView",
|
||||||
'.poll': 'pollView',
|
".poll": "pollView",
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize : function() {
|
initialize : function() {
|
||||||
|
|
@ -37,16 +37,17 @@ app.views.SinglePostContent = app.views.Base.extend({
|
||||||
// get location data and render map
|
// get location data and render map
|
||||||
var location = this.model.get("location");
|
var location = this.model.get("location");
|
||||||
|
|
||||||
// If the mapbox option is enabled in the defaults the mapbox tiles with the podmin's credentials are used.
|
// If the mapbox option is enabled in the diaspora.yml, the mapbox tiles with the podmin's credentials are used.
|
||||||
// If mapbox is not enabled the OpenMapSurfer tiles are used, which don't need credentials.
|
// If mapbox is not enabled the Maptiles from the Heidelberg University are used, which don't need credentials.
|
||||||
var mapsource = gon.appConfig.map.mapbox.enabled ? gon.appConfig.map.mapbox : "";
|
var mapsource = gon.appConfig.map.mapbox.enabled ? gon.appConfig.map.mapbox : "";
|
||||||
var tileLayerSource = mapsource ? "https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}"
|
var tileLayerSource = mapsource ? "https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}"
|
||||||
: "http://korona.geog.uni-heidelberg.de/tiles/roads/x={x}&y={y}&z={z}";
|
: "http://korona.geog.uni-heidelberg.de/tiles/roads/x={x}&y={y}&z={z}";
|
||||||
var tileAttribution = mapsource ? "<a href='https://www.mapbox.com'>Mapbox</a>"
|
var tileAttribution = mapsource ? "<a href='http://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
|
||||||
: "<a href='http://korona.geog.uni-heidelberg.de/contact.html'>OpenMapSurfer</a>";
|
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>"
|
||||||
|
: "rendering <a href='http://giscience.uni-hd.de/'>" +
|
||||||
|
"GIScience Research Group @ Heidelberg University</a>";
|
||||||
var attribution = "Map data © <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, " +
|
var attribution = "Map data © <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, " +
|
||||||
"<a href='http://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
|
tileAttribution;
|
||||||
"Imagery © "+ tileAttribution;
|
|
||||||
|
|
||||||
var map = L.map(mapContainer[0]).setView([location.lat, location.lng], 14);
|
var map = L.map(mapContainer[0]).setView([location.lat, location.lng], 14);
|
||||||
L.tileLayer(tileLayerSource, {
|
L.tileLayer(tileLayerSource, {
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,8 @@ defaults:
|
||||||
enabled: true
|
enabled: true
|
||||||
mapbox:
|
mapbox:
|
||||||
enabled: false
|
enabled: false
|
||||||
id: "zaziemo.mpn66kn8"
|
id:
|
||||||
access_token: "pk.eyJ1IjoiemF6aWVtbyIsImEiOiI3ODVjMzVjNmM2ZTU3YWM3YTE5YWYwMTRhODljM2M1MSJ9.-nVgyS4PLnV4m9YkvMB5wA"
|
access_token:
|
||||||
privacy:
|
privacy:
|
||||||
jquery_cdn: false
|
jquery_cdn: false
|
||||||
google_analytics_key:
|
google_analytics_key:
|
||||||
|
|
|
||||||
|
|
@ -334,9 +334,9 @@ configuration: ## Section
|
||||||
## and access_token.
|
## and access_token.
|
||||||
map: ##Section
|
map: ##Section
|
||||||
|
|
||||||
# enable: false
|
# enabled: true
|
||||||
# mapbox:
|
# mapbox:
|
||||||
# enable: false
|
# enabled: false
|
||||||
# id: 'your.id'
|
# id: 'your.id'
|
||||||
# access_token: 'youraccesstoken'
|
# access_token: 'youraccesstoken'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -312,4 +312,4 @@ describe Reshare, type: :model do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue