import TiledLayer from './TiledLayer' ; type Style = "Default" | "Cycle" | "Transport" | "Humanitarian" ; export class OsmTiledLayer extends TiledLayer { private idx : number = 0 ; constructor ( style = "Default" ) { super ( style ) ; } getTileUrl ( level , row , column ) { if ( this . idx === undefined ) { this . idx = 0 ; } var url = '' ; var server = [ "a" , "b" , "c" ] [ this . idx ] ; if ( this . style === "Cycle" ) { url = `//${ server }.tile.thunderforest.com/cycle/${ level }/${ column }/${ row }.png` ; } else if ( this . style === "Transport" ) { url = `//${ server }.tile.thunderforest.com/transport/${ level }/${ column }/${ row }.png` ; } else if ( this . style === "Humanitarian" ) { url = `//tile-${ server }.openstreetmap.fr/hot/${ level }/${ column }/${ row }.png` ; } else { url = `//${ server }.tile.openstreetmap.org/${ level }/${ column }/${ row }.png` ; } this . idx ++ ; if ( this . idx >= 3 ) { this . idx = 0 ; } return url ; } }