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.

GeoVisImageryProvider.js 768B

12345678910111213141516171819202122232425262728
  1. /**
  2. * @Author : Caven Chen
  3. */
  4. import { Cesium } from '../../../namespace'
  5. import ImageryType from '../ImageryType'
  6. const TILE_URL =
  7. '//tiles{s}.geovisearth.com/base/v1/{style}/{z}/{x}/{y}?format={format}&tmsIds=w&token={key}'
  8. class GeoVisImageryProvider extends Cesium.UrlTemplateImageryProvider {
  9. constructor(options = {}) {
  10. options['url'] =
  11. options.url ||
  12. [
  13. options.protocol || '',
  14. TILE_URL.replace(/\{style\}/g, options.style || 'vec')
  15. .replace(/\{format\}/g, options.format || 'png')
  16. .replace(/\{key\}/g, options.key || ''),
  17. ].join('')
  18. options['subdomains'] = options.subdomains || ['1', '2', '3']
  19. super(options)
  20. }
  21. }
  22. ImageryType.GEO_VIS = 'geoVis'
  23. export default GeoVisImageryProvider