Update README.md, colors.txt, config.sh, and 10 more files for alpha v0.3
This commit is contained in:
parent
a08a86dc40
commit
6d9651b4ff
13 changed files with 449 additions and 109 deletions
|
|
@ -7,7 +7,7 @@
|
|||
</h3>
|
||||
|
||||
<div id="live-map-container-%%current_world_key%%">
|
||||
<div id="ol-map-container-%%current_world_key%%" class="map-view-container"></div>
|
||||
<div id="ol-map-container-%%current_world_key%%" class="map-view-container" style="background-color: %%map_background_color%%;"></div>
|
||||
|
||||
<div id="popup-%%current_world_key%%" class="ol-popup">
|
||||
<a href="#" id="popup-closer-%%current_world_key%%" class="ol-popup-closer"></a>
|
||||
|
|
@ -78,7 +78,17 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
mapContainer.innerHTML = '';
|
||||
|
||||
const extent = [0, -mapData.mapHeight, mapData.mapWidth, 0];
|
||||
const resolutions = %%RESOLUTIONS_JS_ARRAY%%;
|
||||
|
||||
// KORREKTUR: Wir trennen die echten von den virtuellen Auflösungen
|
||||
const sourceResolutions = %%RESOLUTIONS_JS_ARRAY%%;
|
||||
|
||||
const viewResolutions = [...sourceResolutions]; // Kopie für die Ansicht
|
||||
const digitalZoomLevels = 3;
|
||||
let lastResolution = viewResolutions[viewResolutions.length - 1];
|
||||
for (let i = 0; i < digitalZoomLevels; i++) {
|
||||
lastResolution = lastResolution / 2;
|
||||
viewResolutions.push(lastResolution);
|
||||
}
|
||||
|
||||
const projection = new ol.proj.Projection({
|
||||
code: 'pixel-map-%%current_world_key%%',
|
||||
|
|
@ -88,7 +98,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
|
||||
const tileGrid = new ol.tilegrid.TileGrid({
|
||||
origin: ol.extent.getTopLeft(extent),
|
||||
resolutions: resolutions,
|
||||
resolutions: sourceResolutions, // Das TileGrid kennt NUR die echten Auflösungen
|
||||
});
|
||||
|
||||
const tileSource = new ol.source.TileImage({
|
||||
|
|
@ -96,6 +106,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
tileGrid: tileGrid,
|
||||
tileUrlFunction: function(tileCoord) {
|
||||
if (!tileCoord) return '';
|
||||
// OpenLayers wählt jetzt selbst die beste verfügbare Kachel aus.
|
||||
// Die URL-Funktion kann wieder einfach sein.
|
||||
return ('/%%web_tiles_rel_path%%/' + tileCoord[0] + '/' + tileCoord[1] + '/' + tileCoord[2] + '.png?v=%%CACHE_BUSTER%%');
|
||||
}
|
||||
});
|
||||
|
|
@ -107,8 +119,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
const view = new ol.View({
|
||||
projection: projection,
|
||||
center: ol.extent.getCenter(extent),
|
||||
resolutions: resolutions,
|
||||
maxZoom: resolutions.length - 1
|
||||
resolutions: viewResolutions, // Die View kennt ALLE Auflösungen (echte + digitale)
|
||||
});
|
||||
|
||||
const popupContainer = document.getElementById('popup-%%current_world_key%%');
|
||||
|
|
@ -129,10 +140,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
});
|
||||
|
||||
const map = window.olMap_%%current_world_key%%;
|
||||
|
||||
// KORREKTUR: Hintergrundfarbe wird hier per JavaScript gesetzt
|
||||
map.getViewport().style.backgroundColor = '%%map_background_color%%';
|
||||
|
||||
map.getView().fit(extent, { size: map.getSize() });
|
||||
|
||||
map.on('click', function(evt) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue