Procházet zdrojové kódy

add protocol params for imagery layer

tags/2.9.0
Caven Chen před 3 roky
rodič
revize
9209648d1e

+ 13
- 13
modules/imagery/provider/AmapImageryProvider.js Zobrazit soubor

@@ -7,23 +7,23 @@ import { Cesium } from '@dc-modules/namespace'
import ImageryType from '../ImageryType'
import AmapMercatorTilingScheme from '../tiling-scheme/AmapMercatorTilingScheme'

const IMG_URL =
'https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}'

const ELEC_URL =
'http://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}'

const CVA_URL =
'https://webst{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}'
const TILE_URL = {
img: '//webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
elec:
'//webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}',
cva:
'//webst{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}'
}

class AmapImageryProvider extends Cesium.UrlTemplateImageryProvider {
constructor(options = {}) {
options['url'] =
options.style === 'img'
? IMG_URL
: options.style === 'cva'
? CVA_URL
: ELEC_URL
options.url ||
[
options.protocol || '',
options.protocol ? ':' : '',
TILE_URL[options.style || 'elec']
].join('')
options['subdomains'] = options.subdomains || ['01', '02', '03', '04']
if (options.crs === 'WGS84') {
options['tilingScheme'] = new AmapMercatorTilingScheme()

+ 16
- 18
modules/imagery/provider/BaiduImageryProvider.js Zobrazit soubor

@@ -7,28 +7,26 @@ import { Cesium } from '@dc-modules/namespace'
import ImageryType from '../ImageryType'
import BaiduMercatorTilingScheme from '../tiling-scheme/BaiduMercatorTilingScheme'

const IMG_URL =
'http://shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46'

const VEC_URL =
'http://online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020'

const CUSTOM_URL =
'http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}'

const TRAFFIC_URL =
'http://its.map.baidu.com:8002/traffic/TrafficTileService?time={time}&label={labelStyle}&v=016&level={z}&x={x}&y={y}&scaler=2'
const TILE_URL = {
img:
'//shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46',
vec:
'//online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020',
custom:
'//api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}',
traffic:
'//its.map.baidu.com:8002/traffic/TrafficTileService?time={time}&label={labelStyle}&v=016&level={z}&x={x}&y={y}&scaler=2'
}

class BaiduImageryProvider {
constructor(options = {}) {
this._url =
options.style === 'img'
? IMG_URL
: options.style === 'vec'
? VEC_URL
: options.style === 'traffic'
? TRAFFIC_URL
: CUSTOM_URL
options.url ||
[
options.protocol || '',
options.protocol ? ':' : '',
TILE_URL[options.style || 'custom']
].join('')
this._labelStyle = options.labelStyle || 'web2D'
this._tileWidth = 256
this._tileHeight = 256

+ 13
- 13
modules/imagery/provider/GoogleImageryProvider.js Zobrazit soubor

@@ -6,23 +6,23 @@
import { Cesium } from '@dc-modules/namespace'
import ImageryType from '../ImageryType'

const ELEC_URL =
'http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile'

const IMG_URL =
'http://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali'

const TER_URL =
'http://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile'
const TILE_URL = {
img: '//mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali',
elec:
'//mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile',
ter:
'//mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile'
}

class GoogleImageryProvider extends Cesium.UrlTemplateImageryProvider {
constructor(options = {}) {
options['url'] =
options.style === 'img'
? IMG_URL
: options.style === 'ter'
? TER_URL
: ELEC_URL
options.url ||
[
options.protocol || '',
options.protocol ? ':' : '',
TILE_URL[options.style || 'elec']
].join('')
options['subdomains'] = options.subdomains || ['1', '2', '3']
super(options)
}

+ 9
- 5
modules/imagery/provider/TdtImageryProvider.js Zobrazit soubor

@@ -7,15 +7,19 @@ import { Cesium } from '@dc-modules/namespace'
import ImageryType from '../ImageryType'

const MAP_URL =
'https://t{s}.tianditu.gov.cn/DataServer?T={style}_w&x={x}&y={y}&l={z}&tk={key}'
'//t{s}.tianditu.gov.cn/DataServer?T={style}_w&x={x}&y={y}&l={z}&tk={key}'

class TdtImageryProvider extends Cesium.UrlTemplateImageryProvider {
constructor(options = {}) {
super({
url: MAP_URL.replace(/\{style\}/g, options.style || 'vec').replace(
/\{key\}/g,
options.key || ''
),
url: [
options.protocol || '',
options.protocol ? ':' : '',
MAP_URL.replace(/\{style\}/g, options.style || 'vec').replace(
/\{key\}/g,
options.key || ''
)
].join(''),
subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
tilingScheme: new Cesium.WebMercatorTilingScheme(),
maximumLevel: 18

+ 13
- 6
modules/imagery/provider/TencentImageryProvider.js Zobrazit soubor

@@ -6,15 +6,22 @@
import { Cesium } from '@dc-modules/namespace'
import ImageryType from '../ImageryType'

const IMG_URL =
'https://p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=400'

const ELEC_URL =
'https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid={style}&scene=0&version=347'
const TILE_URL = {
img:
'//p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=400',
elec:
'//rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid={style}&scene=0&version=347'
}

class TencentImageryProvider extends Cesium.UrlTemplateImageryProvider {
constructor(options = {}) {
let url = options.style === 'img' ? IMG_URL : ELEC_URL
let url =
options.url ||
[
options.protocol || '',
options.protocol ? ':' : '',
TILE_URL[options.style || 'elec']
].join('')
options['url'] = url.replace('{style}', options.style || 1)
options['subdomains'] = options.subdomains || ['1', '2', '3']
if (options.style === 'img') {

Načítá se…
Zrušit
Uložit