diff --git a/README.md b/README.md
index a659b5e..199443c 100644
--- a/README.md
+++ b/README.md
@@ -137,3 +137,5 @@ Copyright (c) 2012 Makina Corpus, [MIT License](https://github.com/makinacorpus/
Copyright (c) 2014 Dominik Moritz, [MIT License](https://github.com/domoritz/leaflet-locatecontrol/blob/gh-pages/LICENSE)
* [Font Awesome](http://fontawesome.io/license/)
by Dave Gandy; [SIL OFL 1.1](https://scripts.sil.org/OFL) (Font), MIT License (Code), CC BY 3.0 (Documentation)
+* [Map BBCode](https://github.com/MapBBCode/mapbbcode)
+Ilya Zverev; [Do What The F*ck You Want To Public License](https://github.com/MapBBCode/mapbbcode/blob/master/LICENSE)
diff --git a/bower.json b/bower.json
index bcfadf7..74e4fa6 100644
--- a/bower.json
+++ b/bower.json
@@ -29,7 +29,8 @@
"bootstrap-select": "hugdx/bootstrap-select#patch-1",
"leaflet-sidebar-v2": "nrenner/leaflet-sidebar-v2#dev",
"leaflet.editable": "^1.1.0",
- "codemirror": "^5.35.0"
+ "codemirror": "^5.35.0",
+ "mapbbcode": "MapBBCode/mapbbcode#v1.2.0"
},
"overrides": {
"leaflet": {
@@ -100,6 +101,9 @@
"jquery": "*",
"bootstrap": "*"
}
+ },
+ "mapbbcode": {
+ "main": "src/controls/PermalinkAttribution.js"
}
},
"resolutions": {
diff --git a/index.html b/index.html
index 4ef3334..b1bcca5 100644
--- a/index.html
+++ b/index.html
@@ -67,20 +67,36 @@
© OpenStreetMap contributors
under ODbL
-
OpenstreetMap.de tiles
- openstreetmap.de
+
+ Search by Nominatim
+
+ OpenStreetMap tiles
+
+ openstreetmap.org
+ under CC-BY-SA 2.0
+
+ OpenStreetMap.de tiles
+
+ openstreetmap.de
+
OpenTopoMap tiles
© OpenTopoMap
under CC-BY-SA
SRTM
- Thunderforest tiles
+ OpenCycleMap & Outdoors tiles
© Thunderforest
under CC-BY-SA 2.0
- Waymarked Trails tiles
+ Esri World Imagery
+
+ World Imagery
+ © Esri, sources:
+ Esri, DigitalGlobe, Earthstar Geographics, CNES/Airbus DS, GeoEye, USDA FSA, USGS, Getmapping, Aerogrid, IGN, IGP, and the GIS User Community
+
+ Cycling & Hiking tiles
© Waymarked Trails
under CC-BY-SA 3.0 DE
diff --git a/js/Map.js b/js/Map.js
index bf1d1f7..6381d1e 100644
--- a/js/Map.js
+++ b/js/Map.js
@@ -8,50 +8,57 @@ BR.Map = {
var maxZoom = 19;
+ // Layer attribution here only as short link to original site,
+ // to keep current position use placeholders: {zoom}/{lat}/{lon}
+ // Copyright attribution in index.html #credits
+
var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- maxZoom: maxZoom
+ maxZoom: maxZoom,
+ attribution: 'OpenStreetMap'
});
var osmde = L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', {
maxNativeZoom: 18,
- maxZoom: maxZoom
+ maxZoom: maxZoom,
+ attribution: 'OpenStreetMap.de'
});
var topo = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
maxNativeZoom: 17,
- maxZoom: maxZoom
+ maxZoom: maxZoom,
+ attribution: 'OpenTopoMap'
});
- var thunderforestAttribution = 'tiles © Thunderforest '
- + '(CC-BY-SA 2.0)';
var thunderforestAuth = BR.keys.thunderforest ? '?apikey=' + BR.keys.thunderforest : '';
var cycle = L.tileLayer('https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' + thunderforestAuth, {
maxNativeZoom: 18,
- maxZoom: maxZoom
+ maxZoom: maxZoom,
+ attribution: 'OpenCycleMap'
});
var outdoors = L.tileLayer('https://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png' + thunderforestAuth, {
maxNativeZoom: 18,
- maxZoom: maxZoom
+ maxZoom: maxZoom,
+ attribution: 'Outdoors'
});
var esri = L.tileLayer('https://{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
maxNativeZoom: 19,
maxZoom: maxZoom,
subdomains: ['server', 'services'],
- attribution: 'World Imagery '
- + '© Esri, sources: '
- + 'Esri, DigitalGlobe, Earthstar Geographics, CNES/Airbus DS, GeoEye, USDA FSA, USGS, Getmapping, Aerogrid, IGN, IGP, and the GIS User Community'
+ attribution: 'Esri World Imagery'
});
var cycling = L.tileLayer('https://tile.waymarkedtrails.org/cycling/{z}/{x}/{y}.png', {
maxNativeZoom: 18,
opacity: 0.7,
- maxZoom: maxZoom
+ maxZoom: maxZoom,
+ attribution: 'Cycling'
});
var hiking = L.tileLayer('https://tile.waymarkedtrails.org/hiking/{z}/{x}/{y}.png', {
maxNativeZoom: 18,
opacity: 0.7,
- maxZoom: maxZoom
+ maxZoom: maxZoom,
+ attribution: 'Hiking'
});
map = new L.Map('map', {
@@ -60,9 +67,17 @@ BR.Map = {
if (!map.restoreView()) {
map.setView([50.99, 9.86], 6);
}
- map.attributionControl.setPrefix(false);
- map.attributionControl.addAttribution('Copyright & credits')
+ // two attribution lines by adding two controls, prevents ugly wrapping on
+ // small screens, better separates static from layer-specific attribution
+ map.attributionControl.setPrefix(
+ '© OpenStreetMap' +
+ ($(map.getContainer()).outerWidth() >= 400 ? ' contributers' : '') +
+ ' · Copyright' +
+ ' · Privacy');
+
+ new L.Control.PermalinkAttribution().addTo(map);
+ map.attributionControl.setPrefix(false);
var baseLayers = {
'OpenStreetMap': osm,
diff --git a/js/plugin/Search.js b/js/plugin/Search.js
index 81e2ce1..7154ea3 100644
--- a/js/plugin/Search.js
+++ b/js/plugin/Search.js
@@ -6,13 +6,6 @@ BR.Search = L.Control.Geocoder.extend({
position: 'topleft'
},
- onAdd: function (map) {
- map.attributionControl.addAttribution(
- 'search by Nominatim');
-
- return L.Control.Geocoder.prototype.onAdd.call(this, map);
- },
-
markGeocode: function(result) {
this._map.fitBounds(result.geocode.bbox, {
maxZoom: 17