Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zooming issue #430

Open
e0xify opened this issue Jul 21, 2024 · 0 comments
Open

zooming issue #430

e0xify opened this issue Jul 21, 2024 · 0 comments

Comments

@e0xify
Copy link

e0xify commented Jul 21, 2024

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

`

<title>Leaflet Static Zoom Level 18</title>
<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>
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant