Merge branch 'next-minor' into develop
This commit is contained in:
commit
e0af180c9b
5 changed files with 23 additions and 37 deletions
|
|
@ -44,6 +44,7 @@ Although the chat was never enabled per default and was marked as experimental,
|
||||||
* Link diaspora only poduptime list [#8174](https://github.com/diaspora/diaspora/pull/8174)
|
* 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)
|
* 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)
|
* 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
|
## Features
|
||||||
* Support and recommend TOML as configuration format [#8132](https://github.com/diaspora/diaspora/pull/8132)
|
* Support and recommend TOML as configuration format [#8132](https://github.com/diaspora/diaspora/pull/8132)
|
||||||
|
|
|
||||||
|
|
@ -3,23 +3,21 @@
|
||||||
getTiles: function() {
|
getTiles: function() {
|
||||||
// If the mapbox option is enabled in the diaspora.toml, the mapbox tiles with the podmin's credentials are used.
|
// 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) {
|
if (gon.appConfig.map.mapbox.enabled) {
|
||||||
return L.tileLayer("https://api.mapbox.com/styles/v1/{style}/tiles/256/{z}/{x}/{y}?access_token={accessToken}", {
|
return L.tileLayer(
|
||||||
accessToken: gon.appConfig.map.mapbox.access_token,
|
"https://api.mapbox.com/styles/v1/{style}/tiles/256/{z}/{x}/{y}?access_token={accessToken}",
|
||||||
style: gon.appConfig.map.mapbox.style,
|
{
|
||||||
attribution: "Map data © <a href='https://openstreetmap.org'>OpenStreetMap</a> contributors, " +
|
accessToken: gon.appConfig.map.mapbox.access_token,
|
||||||
"<a href='https://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
|
style: gon.appConfig.map.mapbox.style,
|
||||||
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>",
|
attribution:
|
||||||
maxZoom: 18
|
"Map data © <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 © <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 map = L.map(mapContainer[0]).setView([location.lat, location.lng], 14);
|
||||||
var tiles = app.helpers.locations.getTiles();
|
var tiles = app.helpers.locations.getTiles();
|
||||||
|
if (tiles) {
|
||||||
tiles.addTo(map);
|
tiles.addTo(map);
|
||||||
|
}
|
||||||
|
|
||||||
// put marker on map
|
// put marker on map
|
||||||
L.marker(location).addTo(map);
|
L.marker(location).addTo(map);
|
||||||
|
|
|
||||||
|
|
@ -198,10 +198,9 @@
|
||||||
## increase environment.sidekiq.concurrency instead!
|
## increase environment.sidekiq.concurrency instead!
|
||||||
#sidekiq_workers = 1
|
#sidekiq_workers = 1
|
||||||
|
|
||||||
## Displays the location of a post in a map. Per default we are using the map
|
## Displays the location of a post in a map.
|
||||||
## tiles of the Heidelberg University (http://giscience.uni-hd.de).
|
## If you enable this setting you use the map tiles of https://www.mapbox.com
|
||||||
## You also have the possibility to use the map tiles of https://www.mapbox.com
|
## which is reliable. There you have to create an account to get
|
||||||
## which is probably more reliable. There you have to create an account to get
|
|
||||||
## an access token which is limited. If you want to get an unlimited account
|
## an access token which is limited. If you want to get an unlimited account
|
||||||
## you can write an email to team@diasporafoundation.org.
|
## you can write an email to team@diasporafoundation.org.
|
||||||
## Please enable mapbox and fill out your access_token.
|
## Please enable mapbox and fill out your access_token.
|
||||||
|
|
@ -209,7 +208,7 @@
|
||||||
|
|
||||||
#enabled = false
|
#enabled = false
|
||||||
#access_token = "youraccesstoken"
|
#access_token = "youraccesstoken"
|
||||||
#style = "mapbox/streets-v9"
|
#style = "mapbox/streets-v11"
|
||||||
|
|
||||||
## Settings potentially affecting the privacy of your users.
|
## Settings potentially affecting the privacy of your users.
|
||||||
[configuration.privacy]
|
[configuration.privacy]
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,15 @@
|
||||||
describe("app.helpers.locations", function() {
|
describe("app.helpers.locations", function() {
|
||||||
describe("getTiles", 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() {
|
context("with mapbox enabled", function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
/* eslint-disable camelcase */
|
/* 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 */
|
/* eslint-enable camelcase */
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns tiles from mapbox", function() {
|
it("returns tiles from mapbox", function() {
|
||||||
var tiles = app.helpers.locations.getTiles();
|
var tiles = app.helpers.locations.getTiles();
|
||||||
expect(tiles._url).toMatch("https://api.mapbox.com/");
|
expect(tiles._url).toMatch("https://api.mapbox.com/");
|
||||||
expect(tiles._url).not.toMatch("http://korona.geog.uni-heidelberg.de/");
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue