@evergis/sgis
Advanced tools
Comparing version 0.4.12 to 0.4.13
@@ -28,2 +28,3 @@ import { TileScheme } from "../TileScheme"; | ||
}; | ||
export declare type GetTileUrl = (xIndex: number, yIndex: number, level: number) => string; | ||
/** | ||
@@ -55,3 +56,3 @@ * A layer that is drawn as a set of tile images received from server. The layer calculates tile indexes (x, y, z) | ||
*/ | ||
constructor(urlMask: any, {tileScheme, crs, cycleX, cycleY, cacheSize, transitionTime, ...LayerParams}?: TileLayerConstructorParams, extensions?: Object); | ||
constructor(urlMask: string | GetTileUrl, {tileScheme, crs, cycleX, cycleY, cacheSize, transitionTime, ...LayerParams}?: TileLayerConstructorParams, extensions?: Object); | ||
/** | ||
@@ -58,0 +59,0 @@ * Returns url of a tile. |
@@ -55,5 +55,10 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
getTileUrl(xIndex, yIndex, level) { | ||
return this._urlMask.replace('{x}', xIndex.toString()) | ||
.replace('{y}', yIndex.toString()) | ||
.replace('{z}', level.toString()); | ||
if (typeof this._urlMask === "string") { | ||
return this._urlMask.replace('{x}', xIndex.toString()) | ||
.replace('{y}', yIndex.toString()) | ||
.replace('{z}', level.toString()); | ||
} | ||
else { | ||
return this._urlMask(xIndex, yIndex, level); | ||
} | ||
} | ||
@@ -60,0 +65,0 @@ getRenders(bbox, resolution) { |
@@ -63,4 +63,4 @@ import { PolyControl } from "./controls/PolyControl"; | ||
export { Control } from "./controls/Control"; | ||
export declare const version = "0.4.12"; | ||
export declare const releaseDate = "18.06.2019"; | ||
export declare const version = "0.4.13"; | ||
export declare const releaseDate = "24.06.2019"; | ||
export declare const controls: { | ||
@@ -67,0 +67,0 @@ Circle: typeof Circle; |
@@ -65,4 +65,4 @@ import { PolyControl } from "./controls/PolyControl"; | ||
export { Control } from "./controls/Control"; | ||
export const version = "0.4.12"; | ||
export const releaseDate = "18.06.2019"; | ||
export const version = "0.4.13"; | ||
export const releaseDate = "24.06.2019"; | ||
let utilsModulesExt = {}; | ||
@@ -69,0 +69,0 @@ Object.assign(utilsModulesExt, utilsModule, { Color: Color }); |
{ | ||
"name": "@evergis/sgis", | ||
"version": "0.4.12", | ||
"version": "0.4.13", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/sGis.js", |
@@ -39,2 +39,4 @@ import {TileScheme} from "../TileScheme"; | ||
export type GetTileUrl = (xIndex: number, yIndex: number, level: number) => string; | ||
/** | ||
@@ -48,3 +50,3 @@ * A layer that is drawn as a set of tile images received from server. The layer calculates tile indexes (x, y, z) | ||
private _tileCache: {[key: string]: TileRender} = {}; | ||
private readonly _urlMask: string; | ||
private readonly _urlMask: string | GetTileUrl; | ||
private readonly _cacheSize: number; | ||
@@ -73,3 +75,3 @@ private _transitionTime: number; | ||
*/ | ||
constructor(urlMask, { | ||
constructor(urlMask: string | GetTileUrl, { | ||
tileScheme = TileScheme.default, | ||
@@ -103,5 +105,9 @@ crs = webMercator, | ||
getTileUrl(xIndex: number, yIndex: number, level: number): string { | ||
return this._urlMask.replace('{x}', xIndex.toString()) | ||
.replace('{y}', yIndex.toString()) | ||
.replace('{z}', level.toString()); | ||
if (typeof this._urlMask === "string") { | ||
return this._urlMask.replace('{x}', xIndex.toString()) | ||
.replace('{y}', yIndex.toString()) | ||
.replace('{z}', level.toString()); | ||
} else { | ||
return this._urlMask(xIndex, yIndex, level); | ||
} | ||
} | ||
@@ -108,0 +114,0 @@ |
@@ -69,4 +69,4 @@ import {PolyControl} from "./controls/PolyControl"; | ||
export const version = "0.4.12"; | ||
export const releaseDate = "18.06.2019"; | ||
export const version = "0.4.13"; | ||
export const releaseDate = "24.06.2019"; | ||
@@ -73,0 +73,0 @@ let utilsModulesExt = <any>{}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
2374277
34872