File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ class Navigation extends Widget {
56
56
57
57
/**
58
58
* @param {GlobeView } view The iTowns view the navigation should be linked
59
- * to.
59
+ * to. For the moment, only `{@link GlobeView}`
60
+ * is supported.
60
61
* @param {Object } options The navigation menu optional configuration.
61
62
* @param {HTMLElement } [options.parentElement=view.domElement] The parent HTML container of the div which
62
63
* contains navigation widgets.
@@ -87,6 +88,14 @@ class Navigation extends Widget {
87
88
constructor ( view , options = { } ) {
88
89
// ---------- BUILD PROPERTIES ACCORDING TO DEFAULT OPTIONS AND OPTIONS PASSED IN PARAMETERS : ----------
89
90
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
+
90
99
// `top`, `bottom`, `left` and `right` values for `position` option are not relevant for navigation widget.
91
100
if ( [ 'top' , 'bottom' , 'left' , 'right' ] . includes ( options . position ) ) {
92
101
console . warn (
You can’t perform that action at this time.
0 commit comments