openstreetmap-tile-server icon indicating copy to clipboard operation
openstreetmap-tile-server copied to clipboard

zooming issue

Open e0xify opened this issue 7 months ago • 0 comments

Just created the server cause i screewed up my old docker container. Having one issue, the zoom level of 18 seems not to be the same as in the leaflet demo here:.

https://leafletjs.com/examples/zoom-levels/#:~:text=To%20enable%20it%2C%20use%20the,%2C%202%20%2C%20and%20so%20on.

i can set it to 18, which should show up streets and streetnames but in my view with 18 set its way more far away and i cant get closer. everything even the attribution seems to be super small.

starting with

docker run
-p 8080:80
-v osm-data:/data/database/
--shm-size="192m"
-d overv/openstreetmap-tile-server
run

germany-latest.obf downloaded and imported manually. didnt change the obf so this should be fine cause it worked before on the old container.

Any idea?

image

`

Leaflet Static Zoom Level 18
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="leaflet.css"/>
<script src="leaflet.js"></script>

<style>
    html, body, #map {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
    }
</style>
<script>
    // Initialize the map
    var map = L.map('map', {
        center: [51.1657, 10.4515], // Default center of Germany
        zoom: 18, // Set initial zoom level to 18
        minZoom: 18, // Prevent zooming out
        maxZoom: 18 // Prevent zooming in
    });

    // Add the tile layer
    L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
        maxZoom: 18, // Ensure this matches the max zoom your server supports
        attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors'
    }).addTo(map);

    // Add a marker (optional)
    L.marker([51.1657, 10.4515]).addTo(map)
        .bindPopup('Center of Germany')
        .openPopup();
</script>
`

e0xify avatar Jul 21 '24 07:07 e0xify