Skip to content

QGIS: GDAL2Tiles

Generate TMS Tiles from GeoTIFF

Using gdal2tiles

gdal2tiles

Alternate

You can also generate tiles by Geoserver's GeoWebCache server.

Loading to CesiumJS

js
var tms = new Cesium.TileMapServiceImageryProvider({
   url : '../images/cesium_maptiler/Cesium_Logo_Color',
   fileExtension: 'png',
   maximumLevel: 4,
   rectangle: new Cesium.Rectangle(
       Cesium.Math.toRadians(-120.0),
       Cesium.Math.toRadians(20.0),
       Cesium.Math.toRadians(-60.0),
       Cesium.Math.toRadians(40.0))
});

CesiumJS: TileMapServiceImageryProvider

js
addTdtMap(option: TdtMap) {
    const imageryLayer = this.viewer.imageryLayers.addImageryProvider(
      new Cesium.TileMapServiceImageryProvider({
        url: option.url || (option.name && lib.config.URL_CONFIG[option.name]), // 获取配置
        maximumLevel: option.maximumLevel || 19,
        fileExtension: option.fileExtension || "png",
        rectangle: Cesium.Rectangle.fromDegrees(
          73.497551,
          3.593695,
          135.103684,
          53.568958
        ),
      })
    )
    imageryLayer.saturation = option.saturation || 1
    return imageryLayer
  }

:::

Credit @Wayne19980