Leaflet: A weird problem during Loading Tiles-- disorder tiles

Created on 7 Jun 2017  路  2Comments  路  Source: Leaflet/Leaflet

As a beginer,I get leaflet 1.0.3 version.When I load a map and get an problem below:

OS:Window 7
WebServer:IIS
Broser:chorme

Code from the http://leafletjs.com/index.html

<!DOCTYPE html>
<html>
<head>
    <title>Quick Start - Leaflet</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
    <link ref ="stylesheet" href = "./leaflet.css"  />
    <script src = "./leaflet.js"></script>
</head>
<body>

<div id="map" style="width: 800px; height: 450px;"></div>
<script>
var map = L.map('map').setView([51.505, -0.09], 13);

L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

L.marker([51.5, -0.09]).addTo(map)
    .bindPopup('A pretty CSS3 popup.<br> Easily customizable.')
    .openPopup();
</script>

</body>
</html>

The snapshot below:

qq 20170607104139

qq 20170607110221

But When I use the leaflet.js from the CDN,there is no the problem.

I want to know why this situation happens.

Most helpful comment

Hi,
I'm pretty sure this is an issue with not loading Leaflet's CSS correctly, or possibly overriding the CSS with some other rules.

Check that your example loads Lealfet's CSS without errors. Check any extra CSS rules you add.

If the problem persists, please provide a running example illustrating the issue so we can have a closer look.

All 2 comments

Hi,
I'm pretty sure this is an issue with not loading Leaflet's CSS correctly, or possibly overriding the CSS with some other rules.

Check that your example loads Lealfet's CSS without errors. Check any extra CSS rules you add.

If the problem persists, please provide a running example illustrating the issue so we can have a closer look.

Thanks a lot!

You are right.As what you say, loading css with a problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gdbd picture gdbd  路  3Comments

zdila picture zdila  路  3Comments

JonnyBGod picture JonnyBGod  路  4Comments

broofa picture broofa  路  4Comments

jblarsen picture jblarsen  路  3Comments