首页 > 解决方案 > 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>

标签: leaflet

解决方案


推荐阅读