Skip to content

FullScreenControl option to force pseudo fullscreen #6778

@stroebjo

Description

@stroebjo

User Story

As a developer of a Map application I would like a option to force the FullScreenControl to always use pseudo fullscreen (viewport of browser, instead of native fullscreen).

Rationale

  1. The native full screen can take multiple seconds to "open" (window UI change). The full map is first resized/shown after the transition to full screen is done (at least on macOS). Resizing the map to just cover the browser viewport is instantaneous.
  2. Fullscreen can only have one map open at a time. On applications containing a small map widget for example, where you would like to compare the maps in two different browser windows, with pseudo fullscreen you could enlarge each map to the viewport of its respective browser window and view those windows side-by-side.

Pseudo fullscreen is already available and used in the FullScreenControl as a fullback, just not controllable via an option:

_requestFullscreen() {
if (this._container.requestFullscreen) {
this._container.requestFullscreen();
} else if ((this._container as any).mozRequestFullScreen) {
(this._container as any).mozRequestFullScreen();
} else if ((this._container as any).msRequestFullscreen) {
(this._container as any).msRequestFullscreen();
} else if ((this._container as any).webkitRequestFullscreen) {
(this._container as any).webkitRequestFullscreen();
} else {
this._togglePseudoFullScreen();
}
}

I would suggest to make pseudo fullscreen available to developers via an option so they can enforce it over the native fullscreen, i.e. like this:

map.addControl(new FullScreenControl({
    pseudo: true,
}), "top-left");

While it is of course possible to create a custom control with this behavior, since the functionality is already there, just not accessible via an option, it think adding such a option would be beneficial, and should also have no impact on existing integrations.

Impact

n/a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions