import TiledLayer from './TiledLayer' ; import TrafficLayer from './TrafficLayer' ; export class QihuTiledLayer extends TiledLayer { private idx : number = 0 ; getTileUrl ( level , row , column ) { if ( this . idx === undefined ) { this . idx = 0 ; } row = Math . pow ( 2 , level ) - row - 1 ; var url = `//map${ this . idx }.ssl.ishowchina.com/sotile/ver11/2/${ level }/?x=${ column }&y=${ row }` ; this . idx ++ ; if ( this . idx >= 5 ) { this . idx = 0 ; } return this . wrapUrlWithProxy ( url ) ; } } ; export class QihuTrafficLayer extends TrafficLayer { protected minLevel : number = 8 ; getTileUrl ( level , row , column ) { row = Math . pow ( 2 , level ) - row - 1 ; var timestamp = Date . now ( ) ; return `//qhapi.map.ishowchina.com/lkinfo/?act=tile&x=${ column }&y=${ row }&z=${ level }&t=${ timestamp }` ; } } ;