You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TdtImageryProvider.js 759B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * @Author: Caven
  3. * @Date: 2020-01-15 20:31:46
  4. */
  5. import { Cesium } from '@dc-modules/namespace'
  6. import ImageryType from '../ImageryType'
  7. const MAP_URL =
  8. '//t{s}.tianditu.gov.cn/DataServer?T={style}_w&x={x}&y={y}&l={z}&tk={key}'
  9. class TdtImageryProvider extends Cesium.UrlTemplateImageryProvider {
  10. constructor(options = {}) {
  11. super({
  12. url: [
  13. options.protocol || '',
  14. MAP_URL.replace(/\{style\}/g, options.style || 'vec').replace(
  15. /\{key\}/g,
  16. options.key || ''
  17. )
  18. ].join(''),
  19. subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
  20. tilingScheme: new Cesium.WebMercatorTilingScheme(),
  21. maximumLevel: 18
  22. })
  23. }
  24. }
  25. ImageryType.TDT = 'tdt'
  26. export default TdtImageryProvider