maptalks / issues

Repo of issues for webgl layers
2 stars 0 forks source link

Cesium地形没有正常请求 #662

Closed fuzhenn closed 2 months ago

fuzhenn commented 2 months ago

报告人: 佐罗

地形之上的TileLayer没有正常请求,但取消地形后就正常了。

代码如下:

import { onMounted } from "vue";
import "maptalks/dist/maptalks.css";
import * as maptalks from "maptalks";
import { GroupGLLayer } from "@maptalks/gl-layers";

onMounted(() => {
  const map = new maptalks.Map("map", {
    center: [124, 41.5],
    zoom: 13,
    pitch: 56,
    bearing: 30,
    spatialReference: {
      projection: "EPSG:4326",
    },
    attribution: false,
  });
 const cia_ly = new maptalks.TileLayer("basecia", {
    tileSystem: [1, -1, -180, 90],
    urlTemplate:
      "http://218.60.153.184:18081/service/api/egis/base/v1/wmts?layer=cia&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}",
  });
 const img_ly = new maptalks.TileLayer("base", {
    tileSystem: [1, -1, -180, 90],
    urlTemplate:
      "http://218.60.153.184:18081/service/api/egis/base/v1/wmts?layer=img&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}",
  });
  const terrain = {
    tileSystem: [1, 1, -180, -90],
    zoomOffset: -1,
    maxAvailableZoom: 14,
    type: "cesium",
    terrainWidth: 65,
    urlTemplate:
      "http://218.60.153.184:18081/service/api/egis/base/v1/wtts/china-12/{z}/{x}/{y}.terrain",
    shader: "lit",
  };

  const group = new GroupGLLayer("group", [img_ly,cia_ly], {
    terrain: terrain,
  });
  group.addTo(map);
  group.bringToBack();
});
fuzhenn commented 2 months ago

看上去是terrain的tileSystem设置问题导致,考虑在TerrainLayer中自动设置正确的tileSystem和其他相关参数

fuzhenn commented 2 months ago

closing for now