I have two sets of tiles. One for zoom level 10 and one for zoom level 14. However, I want to be able to see tiles on my map at zoom levels 9 through 15. For the nonexistent sets of tiles I want to use the tiles from either level 10 or 14 and scale them accordingly. E. g. at the zoom level 9, 11 and 12 I want to have the tiles from the level 10 displayed, but scaled by factor 0.5, 2 and 4 respectively and at the zoom level 13 and 15 I want to have the tiles from the level 14 displayed and scaled by factor 0.5 and 2. I can achieve this for the levels 9 and 15 using the "maxNativeZoom" and "minNativeZoom" options, but how to do this with the other zoom levels?
In Open Layers, which I am using now I can solve this by specifying the "server resolutions" and "client resolutions" options. Now I want to try Leaflet - mostly because of better handling of overlays. That means I want to find a solution that works with overlays, like markers.
I've been looking at the setTransform function, which probably scales the tiles in the case of max/minNativeZoom, but my knowledge of Javascript and HTML is limited and I couldn't figure out how to use it.
Here's my scratch:
<html>
<head>
<title>Leaflet map</title>
<link rel="stylesheet" href="leaflet.css" />
<script src="leaflet.js"></script>
</head>
<body>
<div id="mapid" style="width:100%; height:100%;"></div>
<script>
var mymap = L.map('mapid').setView([46.5, 8], 10);
L.tileLayer('tiles/{z}/{x}/{y}.png',{maxNativeZoom: 14, maxZoom: 15, minNativeZoom: 10, minZoom: 9}).addTo(mymap);
</script>
</body>
</html>