Skip to content

Commit

Permalink
docs(Widgets): specify GlobeView support for navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
mgermerie authored and gchoqueux committed Mar 16, 2022
1 parent 8d9f69e commit c209fdc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion utils/gui/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class Navigation extends Widget {

/**
* @param {GlobeView} view The iTowns view the navigation should be linked
* to.
* to. For the moment, only `{@link GlobeView}`
* is supported.
* @param {Object} options The navigation menu optional configuration.
* @param {HTMLElement} [options.parentElement=view.domElement] The parent HTML container of the div which
* contains navigation widgets.
Expand Down Expand Up @@ -87,6 +88,14 @@ class Navigation extends Widget {
constructor(view, options = {}) {
// ---------- BUILD PROPERTIES ACCORDING TO DEFAULT OPTIONS AND OPTIONS PASSED IN PARAMETERS : ----------

// Check if the view is supported.
if (!view.isGlobeView) {
throw new Error(
'\'Navigation\' plugin only supports \'GlobeView\'. Therefore, the \'view\' parameter must be a ' +
'\'GlobeView\'.',
);
}

// `top`, `bottom`, `left` and `right` values for `position` option are not relevant for navigation widget.
if (['top', 'bottom', 'left', 'right'].includes(options.position)) {
console.warn(
Expand Down

0 comments on commit c209fdc

Please sign in to comment.