Give the layers container an CSS class name
This commit is contained in:
@@ -25,7 +25,7 @@ const map = new Map({
|
|||||||
|
|
||||||
document.getElementById('export-png').addEventListener('click', function() {
|
document.getElementById('export-png').addEventListener('click', function() {
|
||||||
map.once('rendercomplete', function() {
|
map.once('rendercomplete', function() {
|
||||||
domtoimage.toPng(map.getViewport())
|
domtoimage.toPng(map.getViewport().querySelector('.ol-layers'))
|
||||||
.then(function(dataURL) {
|
.then(function(dataURL) {
|
||||||
const link = document.getElementById('image-download');
|
const link = document.getElementById('image-download');
|
||||||
link.href = dataURL;
|
link.href = dataURL;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class CompositeMapRenderer extends MapRenderer {
|
|||||||
style.width = '100%';
|
style.width = '100%';
|
||||||
style.height = '100%';
|
style.height = '100%';
|
||||||
|
|
||||||
this.element_.className = CLASS_UNSELECTABLE;
|
this.element_.className = CLASS_UNSELECTABLE + ' ol-layers';
|
||||||
|
|
||||||
const container = map.getViewport();
|
const container = map.getViewport();
|
||||||
container.insertBefore(this.element_, container.firstChild || null);
|
container.insertBefore(this.element_, container.firstChild || null);
|
||||||
|
|||||||
Reference in New Issue
Block a user