Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

AmapImageryProvider.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * @Author: Caven
  3. * @Date: 2020-01-15 20:31:28
  4. */
  5. import { Cesium } from '@dc-modules/namespace'
  6. import ImageryType from '../ImageryType'
  7. import AmapMercatorTilingScheme from '../tiling-scheme/AmapMercatorTilingScheme'
  8. const TILE_URL = {
  9. img: '//webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
  10. elec:
  11. '//webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}',
  12. cva:
  13. '//webst{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}'
  14. }
  15. class AmapImageryProvider extends Cesium.UrlTemplateImageryProvider {
  16. constructor(options = {}) {
  17. options['url'] =
  18. options.url ||
  19. [
  20. options.protocol || '',
  21. options.protocol ? ':' : '',
  22. TILE_URL[options.style || 'elec']
  23. ].join('')
  24. options['subdomains'] = options.subdomains || ['01', '02', '03', '04']
  25. if (options.crs === 'WGS84') {
  26. options['tilingScheme'] = new AmapMercatorTilingScheme()
  27. }
  28. super(options)
  29. }
  30. }
  31. ImageryType.AMAP = 'amap'
  32. export default AmapImageryProvider