Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

GoogleImageryProvider.js 882B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * @Author: Caven
  3. * @Date: 2020-01-21 16:06:14
  4. */
  5. import { Cesium } from '@dc-modules/namespace'
  6. import ImageryType from '../ImageryType'
  7. const TILE_URL = {
  8. img: '//mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali',
  9. elec:
  10. '//mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile',
  11. ter:
  12. '//mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile'
  13. }
  14. class GoogleImageryProvider extends Cesium.UrlTemplateImageryProvider {
  15. constructor(options = {}) {
  16. options['url'] =
  17. options.url ||
  18. [
  19. options.protocol || '',
  20. options.protocol ? ':' : '',
  21. TILE_URL[options.style || 'elec']
  22. ].join('')
  23. options['subdomains'] = options.subdomains || ['1', '2', '3']
  24. super(options)
  25. }
  26. }
  27. ImageryType.GOOGLE = 'google'
  28. export default GoogleImageryProvider