Skip to content

Commit c209fdc

Browse files
mgermeriegchoqueux
authored andcommitted
docs(Widgets): specify GlobeView support for navigation
1 parent 8d9f69e commit c209fdc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

utils/gui/Navigation.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class Navigation extends Widget {
5656

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

91+
// Check if the view is supported.
92+
if (!view.isGlobeView) {
93+
throw new Error(
94+
'\'Navigation\' plugin only supports \'GlobeView\'. Therefore, the \'view\' parameter must be a ' +
95+
'\'GlobeView\'.',
96+
);
97+
}
98+
9099
// `top`, `bottom`, `left` and `right` values for `position` option are not relevant for navigation widget.
91100
if (['top', 'bottom', 'left', 'right'].includes(options.position)) {
92101
console.warn(

0 commit comments

Comments
 (0)