MAPG-126 add configurable attribution for Leaflet maps

This commit is contained in:
Bence Pőcze 2020-06-11 00:14:30 +02:00
parent 2fc0ab557f
commit a0d1e8778c
3 changed files with 3 additions and 1 deletions

View File

@ -6,3 +6,4 @@ DB_NAME=mapguesser
GOOGLE_MAPS_SERVER_API_KEY=your_google_maps_server_api_key
GOOGLE_MAPS_JS_API_KEY=your_google_maps_js_api_key
LEAFLET_TILESERVER_URL=a_leaflet_compatible_tileserver_url
LEAFLET_TILESERVER_ATTRIBUTION=attribution_to_be_shown_for_tiles

View File

@ -351,7 +351,6 @@
};
MapEditor.map = L.map('map', {
attributionControl: false,
zoomControl: false
});
@ -371,6 +370,7 @@
var highResData = Util.getHighResData();
L.tileLayer(tileUrl, {
attribution: tileAttribution,
subdomains: '1234',
ppi: highResData.ppi,
tileSize: highResData.tileSize,

View File

@ -62,6 +62,7 @@
</div>
<script>
var tileUrl = '<?= $_ENV['LEAFLET_TILESERVER_URL'] ?>';
var tileAttribution = '<?= $_ENV['LEAFLET_TILESERVER_ATTRIBUTION'] ?>';
var mapId = <?= $mapId ?>;
var mapBounds = <?= json_encode($bounds) ?>;
var places = <?= json_encode($places, JSON_FORCE_OBJECT) ?>;