leaflet - Leafletjs,覆盖最大放大选项
问题描述
我有一个标准的传单地图,由于各种原因(高分辨率数据),我需要将默认设置放大到厘米。
如何覆盖此最大缩放设置?
我的代码目前是:
<script>
// Set the projection system using proj4js and proj4leafletjs(not sure this works yet)
var crs = new L.Proj.CRS('EPSG:32365',
'+proj=utm +zone=35 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
{
resolutions: [
8192, 4096, 2048, 1024, 512, 256, 128
],
origin: [0, 0]
})
// Creating map options
var mapOptions = {
center: [38.623162,27.9282893],
zoom: 10,
zoomSnap: 0.25
}
// Creating a map object
var map = new L.map('map', mapOptions);
// Creating a Layer object
var layer = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
// Adding layer to the map
map.addLayer(layer);
</script>
解决方案
推荐阅读
- reactjs - 为什么 keycloak 在页面刷新时未经授权?
- php - 使用 Wordpress 子主题 functions.php 在插件 css 之后添加自定义 css 文件
- ajax - Access-Control-Allow-Origin 标头设置为 * - 但无法访问 HTML img 标记中的任何位置的图像
- linux - 向 getopts 发送一个带连字符/双连字符的参数
- javascript - 如何通过尊重他们的父母在jQuery中包装两个元素?
- codeigniter-4 - 使用 CI4 活动记录编写 SQL 子查询
- javascript - vuejs $emit 没有在第二个组件上触发
- r - 如何使用均匀分布将马尔可夫链的模拟状态转换为模拟时间序列?
- batch-file - 我需要断开 ane 锁定 vm 以及会话 ID 来控制
- html - 为什么 Aristocrat 字体不能工作 HTML CSS?