Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browser: preview: inspect previews #9027

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions browser/src/control/Control.PartsPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ L.Control.PartsPreview = L.Control.extend({
map.on('scrolllimits', this._invalidateParts, this);
map.on('scrolltopart', this._scrollToPart, this);
map.on('beforerequestpreview', this._beforeRequestPreview, this);
map.on('inspectpreview', this._inspectPreviews, this);

window.addEventListener('resize', L.bind(this._resize, this));
},
Expand Down Expand Up @@ -817,6 +818,25 @@ L.Control.PartsPreview = L.Control.extend({
}

},

_inspectPreviews: function () {
var windowPreview = window.open('');
if (!windowPreview)
return;

windowPreview.document.title = 'Inspect Previews';
var container = L.DomUtil.create('div', '', windowPreview.document.body);
if (!container)
return;

for (var part = 0; part < this._previewTiles.length; part++) {
var img = L.DomUtil.create('img', '', container);
if (img) {
img.src = this._previewTiles[part].src;
img.style.display = 'block';
}
}
},
});

L.control.partsPreview = function (container, preview, options) {
Expand Down
8 changes: 6 additions & 2 deletions browser/src/map/handler/Map.Keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,12 @@ L.Map.Keyboard = L.Handler.extend({
}
} else if (e.altKey) {
switch (e.keyCode) {
case this.keyCodes.D: // Ctrl + Shift + Alt + d for tile debugging mode
this._map._debug.toggle();
case this.keyCodes.D: // Ctrl + Shift + Alt + d for tile debugging mode
this._map._debug.toggle();
break;
case this.keyCodes.E: // Ctrl + Shift + Alt + e for inspect previews
this._map.fire('inspectpreview');
break;
}
}

Expand Down