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.

AmapImageryProvider.js 1.0KB

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 IMG_URL =
  9. 'https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}'
  10. const ELEC_URL =
  11. 'http://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}'
  12. const LOAD_MARK_URL =
  13. 'https://webst{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}'
  14. class AmapImageryProvider extends Cesium.UrlTemplateImageryProvider {
  15. constructor(options = {}) {
  16. options['url'] =
  17. options.style === 'img'
  18. ? IMG_URL
  19. : options.style === 'load'
  20. ? LOAD_MARK_URL
  21. : ELEC_URL
  22. options['subdomains'] = options.subdomains || ['01', '02', '03', '04']
  23. if (options.crs === 'WGS84') {
  24. options['tilingScheme'] = new AmapMercatorTilingScheme()
  25. }
  26. super(options)
  27. }
  28. }
  29. ImageryType.AMAP = 'amap'
  30. export default AmapImageryProvider