如何在Leaflet的TileLayer上定义起始网格位置?

时间:2019-12-17 21:26:16

标签: leaflet tile bounding-box wms

我的应用需要在

定义的框中显示地图
    const corner1 = L.latLng(5.21244812011719, -96.5979537963867);
    const corner2 = L.latLng(34.086555480957, -55.4220504760742);

    const map = L.map(el,
      {
        crs: L.CRS.EPSG4326,
        center: [19.6875, -76.201171875],
        zoom: 3.5,
        maxBounds: new L.latLngBounds(corner1, corner2),
      });
    L.tileLayer.wms("http://localhost:8080/wms?", {
        layers: 'xxx',
        tileSize: 700,
        transparent: true,
        maxBounds: new L.latLngBounds(corner1, corner2),
        bounds: new L.latLngBounds(corner1, corner2)
      }).addTo(map)

问题是该层正在请求从定义的边界之外开始的图块(例如,此请求是http://localhost:8080/wms?&service=WMS&request=GetMap&layers=Mano%3AT22&styles=&format=image%2Fjpeg&transparent=true&version=1.1.1&maxBounds=%5Bobject%20Object%5D&time=2018-05-02T00%3A00%3A00.000Z&width=700&height=700&srs=EPSG%3A4326&bbox=-87.71484375,28.4765625,-56.953125,59.23828125,bbox是 -87.71484375、28.4765625,-56.953125、59.23828125 ,其中包含我定义的角,但不是最佳选择,因为它要求的地图区域不会在我的应用中显示)

我需要不超过所定义角落的传单请求图块。我该如何存档?预先感谢

0 个答案:

没有答案