1
votes

I am new to leaflet and mapbox. I built a map with with mapbox with my own tiled layers that I made with tilemill exported as mbtiles and extracted with mb-util. Tested from my localhost everything is fine, but when I built the map from my webserver, the layer contents are repeating on each tile when zooming the map. Below is my code. I don't understand this different behaviour and how to avoid this. Can anybody help me, please??

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Layers Control</title>

<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.css' rel='stylesheet' />

<style>
  body { margin:0; padding:0; }
  #map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>

<div id='map'></div>

<script type="text/javascript">

var map = L.map('map').setView([50.11, 8.86], 13);
map.setMaxBounds([[50.09, 8.797], [50.134, 8.889]]);

L.control.layers({
    'Base Map': L.mapbox.tileLayer('examples.map-9ijuk24y', { noWrap: true }).addTo(map),
    'OSM': L.tileLayer('http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png', {
    attribution: '&copy; ' + '<a href="http://openstreetmap.org">OpenStreetMap</a>' + ' Contributors', noWrap: true
    })
}, {
    'NEG Dietesheimer Steinbrüche': L.tileLayer('tiles/leafNegGrenz/{z}/{x}/{y}.png', { maxZoom: 19, minZoom: 0, noWrap: true }).addTo(map), 
    'NEG Ausstattung': L.tileLayer('tiles/leafNegAus/{z}/{x}/{y}.png', { maxZoom: 19, minZoom: 0, noWrap: true })
}).addTo(map);

1
can you include a link to your site? or a jsfiddle that demonstrates the problem?sfletche
@sfleche oh sorry, yes of course. This is the link, zoom into the map: geo-information.de/TestMapbox.htmluser3623155
i'm not seeing any obvious problems with your leaflet/mapbox code. i wonder if the problem is the NEG tile layers themselves. is there any reason to not use vector/geojson (non-tiled) layers for your NEG overlays?sfletche
Thank you for your answer, so I will try geojson. But the behaviour of the tileLayer is still strange to me.user3623155

1 Answers

0
votes

Something is wrong with your server, or the export you created: tiles redirect to each other. For instance, open

http://geo-information.de/tiles/leafNegGrenz/15/17190/11098.png

In a browser, and it redirects to

http://geo-information.de/tiles/leafNegGrenz/15/17190/11096.png

This is why tiles are repeating.