Commit a98fdc80 authored by Thorsten Claus's avatar Thorsten Claus Committed by Jonne Haß
Browse files

Remove 'heidelberg' tile map service.

Updated settings for MapTiles as recommended by leaflet.js
Updating current licence text

Closes #8209
closes #8215
parent 7154fc3c
......@@ -9,6 +9,7 @@
* Link diaspora only poduptime list [#8174](https://github.com/diaspora/diaspora/pull/8174)
* Delete a user's invitation code during account deletion [#8202](https://github.com/diaspora/diaspora/pull/8202)
* Bump mimemagic [#8231](https://github.com/diaspora/diaspora/pull/8231)
* Removed support for defunct Uni Heidelberg OSM tile server, Mapbox is now required if you want to show maps [#8215](https://github.com/diaspora/diaspora/pull/8215)
## Features
* Support and recommend TOML as configuration format [#8132](https://github.com/diaspora/diaspora/pull/8132)
......
......@@ -3,23 +3,21 @@
getTiles: function() {
// If the mapbox option is enabled in the diaspora.toml, the mapbox tiles with the podmin's credentials are used.
if (gon.appConfig.map.mapbox.enabled) {
return L.tileLayer("https://api.mapbox.com/styles/v1/{style}/tiles/256/{z}/{x}/{y}?access_token={accessToken}", {
accessToken: gon.appConfig.map.mapbox.access_token,
style: gon.appConfig.map.mapbox.style,
attribution: "Map data &copy; <a href='https://openstreetmap.org'>OpenStreetMap</a> contributors, " +
"<a href='https://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>",
maxZoom: 18
});
return L.tileLayer(
"https://api.mapbox.com/styles/v1/{style}/tiles/256/{z}/{x}/{y}?access_token={accessToken}",
{
accessToken: gon.appConfig.map.mapbox.access_token,
style: gon.appConfig.map.mapbox.style,
attribution:
"Map data &copy; <a href='https://openstreetmap.org'>OpenStreetMap</a> contributors, " +
"<a href='http://opendatacommons.org/licenses/dbcl/1.0/'>Open Database License, ODbL 1.0</a>, " +
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>",
maxZoom: 18,
tileSize: 512,
zoomOffset: -1
}
);
}
// maptiles from the Heidelberg University are used by default.
return L.tileLayer("http://korona.geog.uni-heidelberg.de/tiles/roads/x={x}&y={y}&z={z}", {
attribution: "Map data &copy; <a href='https://openstreetmap.org'>OpenStreetMap</a> contributors, " +
"rendering <a href='http://giscience.uni-hd.de/'>" +
"GIScience Research Group @ Heidelberg University</a>",
maxZoom: 18
});
}
};
})();
......@@ -36,8 +36,9 @@ app.views.SinglePostContent = app.views.Base.extend({
var map = L.map(mapContainer[0]).setView([location.lat, location.lng], 14);
var tiles = app.helpers.locations.getTiles();
tiles.addTo(map);
if (tiles) {
tiles.addTo(map);
}
// put marker on map
L.marker(location).addTo(map);
......
......@@ -261,10 +261,9 @@
## The debug level logs all XML sent and received by the server.
#debug = false
## Displays the location of a post in a map. Per default we are using the map
## tiles of the Heidelberg University (http://giscience.uni-hd.de).
## You also have the possibility to use the map tiles of https://www.mapbox.com
## which is probably more reliable. There you have to create an account to get
## Displays the location of a post in a map.
## If you enable this setting you use the map tiles of https://www.mapbox.com
## which is reliable. There you have to create an account to get
## an access token which is limited. If you want to get an unlimited account
## you can write an email to team@diasporafoundation.org.
## Please enable mapbox and fill out your access_token.
......@@ -272,7 +271,7 @@
#enabled = false
#access_token = "youraccesstoken"
#style = "mapbox/streets-v9"
#style = "mapbox/streets-v11"
## Settings potentially affecting the privacy of your users.
[configuration.privacy]
......
describe("app.helpers.locations", function() {
describe("getTiles", function() {
context("with mapbox disabled", function() {
beforeEach(function() {
gon.appConfig = {map: {mapbox: {enabled: false}}};
});
it("returns tiles from the Heidelberg University", function() {
var tiles = app.helpers.locations.getTiles();
expect(tiles._url).toMatch("http://korona.geog.uni-heidelberg.de/");
expect(tiles._url).not.toMatch("https://api.tiles.mapbox.com/");
});
});
context("with mapbox enabled", function() {
beforeEach(function() {
/* eslint-disable camelcase */
gon.appConfig = {map: {mapbox: {enabled: true, style: "mapbox/streets-v9", access_token: "yourAccessToken"}}};
gon.appConfig = {map: {mapbox: {enabled: true, style: "mapbox/streets-v11", access_token: "yourAccessToken"}}};
/* eslint-enable camelcase */
});
it("returns tiles from mapbox", function() {
var tiles = app.helpers.locations.getTiles();
expect(tiles._url).toMatch("https://api.mapbox.com/");
expect(tiles._url).not.toMatch("http://korona.geog.uni-heidelberg.de/");
});
});
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment