Implement min/maxzoom on vectorlayer
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2020-09-16 20:09:52 +02:00
parent c44c771feb
commit 9e4a538a07
2 changed files with 10 additions and 2 deletions

View File

@ -120,7 +120,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
var layer: Layer = null; var layer: Layer = null;
layerIndex = itemLayer.layerIndex != -1 ? itemLayer.layerIndex : item.data.layers[0].index; layerIndex = itemLayer.layerIndex != -1 ? itemLayer.layerIndex : item.data.layers[0].index;
var data = item.data; var data = item.data;
var l = (data && data.layers && data.layers.length > 0) ? data.layers[layerIndex] : null; var l:ILayer = (data && data.layers && data.layers.length > 0) ? data.layers[layerIndex] : null;
if (l && l.rendering && l.rendering.renderoutputType == "VectorTiles") { if (l && l.rendering && l.rendering.renderoutputType == "VectorTiles") {
var rt = l.rendering as IRenderoutputTiles; var rt = l.rendering as IRenderoutputTiles;
layer = new VectorTileLayer({ layer = new VectorTileLayer({
@ -194,6 +194,12 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
} }
}); });
} }
if(l.minzoom) {
layer.setMinZoom(l.minzoom);
}
if(l.maxzoom) {
layer.setMaxZoom(l.maxzoom);
}
return layer; return layer;
} }

View File

@ -88,5 +88,7 @@ export interface IRenderoutputImage {
export interface ILayer extends IDataLayer { export interface ILayer extends IDataLayer {
renderer: IRenderer, renderer: IRenderer,
rendering: IRenderoutput rendering: IRenderoutput,
minzoom: number,
maxzoom: number
} }