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 701B

123456789101112131415161718192021222324252627282930
  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}_c&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. maximumLevel: 18
  21. })
  22. }
  23. }
  24. ImageryType.TDT = 'tdt'
  25. export default TdtImageryProvider