Show tiles from other zoomlevel in Leaflet -


i'm trying make offline maps leaflet.

for data saving, user has option not save zoomlevels. example user has zoomlevels: - 15 , 17.

now problem is, when user zooming in level 15 16.

how show level 15 (or 17) layers on zoom 16?

alternative skip zoomlevel 16, maybe there option? looked sourcecode leaflet, can't figure out.

jsfiddle

update fiddle plugin skips zoomlevel (by ilja zverev)

html

<div id="map"></div> <div id="out"></div>  

javascipt

var map = l.map('map').setview([52.084, 5.11], 15); isnozoomlevel = 16;  l.tilelayer('http://a.tile.openstreetmap.org/{z}/{x}/{y}.png', {     attribution: '&copy; <a href="http://openstreetmap.org">openstreetmap</a>',     maxzoom: 18 }).addto(map);   map.on('zoomend', function() {     console.log("i zoomed level " + map.getzoom());         if(map.getzoom() == isnozoomlevel) {         console.log("this offline zoomlevel not excist");         $("#out").html("this no zoomlevel");          // howto replace zoomlevel 16 17 or 15??        } else {         $("#out").html("");     } }); 

css

#map {     height: 250px; } 

specially i've made limitzoom plugin: specify zoom levels in zooms: [15, 17, ...] options of l.map.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -