是否有可能在使用Stamen Toner-lite tiles的Leaflet地图上具有中间(2.5,3.5,4.5等)缩放级别?这是我的代码到目前为止,计算缩放级别:小册子:自定义缩放级别可能吗?
leafletmap.on('zoomstart', function (d){
targetZoom = leafletmap.getZoom(); //Grabs whatever current zoom level is
targetZoom = targetZoom +.5; //Adds .5
leafletmap.setZoom(targetZoom); //Sets new value to zoom level
console.log(targetZoom); //Consoles out new value
});
我尝试了添加0.5〜代码,但我得到一个错误too much recursion
,所以我猜它不是那么简单。任何帮助或方向非常感谢!
感谢您直接回复@ iH8。我看到了前面的问题并做了一些研究,但我不确定过去两年的情况是否有所改变。非常感激! – BDD 2015-01-27 01:13:23