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.

GoogleImageryProvider.js 855B

1234567891011121314151617181920212223242526272829303132
  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. TILE_URL[options.style] || TILE_URL['elec']
  21. ].join('')
  22. options['subdomains'] = options.subdomains || ['1', '2', '3']
  23. super(options)
  24. }
  25. }
  26. ImageryType.GOOGLE = 'google'
  27. export default GoogleImageryProvider