G
G
gracer2020-09-05 19:25:34
JavaScript
gracer, 2020-09-05 19:25:34

Why does Leaflet 1.x only display the first row of tiles?

Greetings. Getting familiar with leaflet to create my own map based on an image. I cut the image into tiles, placed it in a folder according to the template. I'm trying so far for one zoom option. But the script displays only the first line of the required tiles, as if the template is set to {x}_0.jpg
All this happens with versions 1.0-1.7.1, but if you load versions 0.7.1-0.8, the image loads completely as it should. What is the problem?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"/>
    <script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
    <style>
        html {
            height: 100%;
        }
        body {
            position: relative;
            margin: 0;
            padding: 0;
            height: 100%;
        }
        #map {
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
        }
    </style>
</head>
<body>
    <div id="map"></div>
    <script>
        var map = L.map('map').setView([0, 0], 0);
        L.tileLayer('tiles/0/{x}_{y}.jpg', {
            minZoom: 0,
            maxZoom: 0,
            noWrap: true,
            continuousWorld: true,
            attributionControl: false
        }).addTo(map);
    </script>
</body>
</html>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question