Add demonstration of layer extent setting to reprojection example
This commit is contained in:
@@ -178,6 +178,13 @@ function updateViewProjection() {
|
|||||||
extent: newProjExtent || undefined
|
extent: newProjExtent || undefined
|
||||||
});
|
});
|
||||||
map.setView(newView);
|
map.setView(newView);
|
||||||
|
|
||||||
|
// Example how to prevent double occurence of map by limiting layer extent
|
||||||
|
if (newProj == ol.proj.get('EPSG:3857')) {
|
||||||
|
layers['bng'].setExtent([-1057216, 6405988, 404315, 8759696]);
|
||||||
|
} else {
|
||||||
|
layers['bng'].setExtent(undefined);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user