Skip to content

Commit

Permalink
docs: fix viewer ctor examples with v3.0 api
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarlorentzon committed Jan 13, 2021
1 parent c1f38e6 commit 6967d16
Show file tree
Hide file tree
Showing 16 changed files with 142 additions and 157 deletions.
31 changes: 16 additions & 15 deletions src/component/interfaces/ICacheConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
import {IComponentConfiguration} from "../../Component";
import { IComponentConfiguration } from "../../Component";

/**
* Interface for configuration of cache depth.
*
* @interface
* @example
* ```
* var viewer = new Mapillary.Viewer('<element-id>', '<client-id>', '<image-key>',
* {
* component: {
* cache: {
* depth: {
* pano: 2,
* sequence: 3,
* }
* },
* var viewer = new Mapillary.Viewer({
* ...
* component: {
* cache: {
* depth: {
* pano: 2,
* sequence: 3,
* }
* },
* })
* },
* ...
* });
* ```
*/
export interface ICacheDepth {
/**
* Cache depth in the sequence directions.
*
* @description Max value is 4. Value will be coerced
* @description Max value is 4. Value will be clamped
* to the interval [0, 4].
* @default 2
*/
Expand All @@ -32,7 +33,7 @@ export interface ICacheDepth {
/**
* Cache depth in the pano direction.
*
* @description Max value is 2. Value will be coerced
* @description Max value is 2. Value will be clamped
* to the interval [0, 2].
* @default 1
*/
Expand All @@ -41,7 +42,7 @@ export interface ICacheDepth {
/**
* Cache depth in the step directions.
*
* @description Max value is 3. Value will be coerced
* @description Max value is 3. Value will be clamped
* to the interval [0, 3].
* @default 1
*/
Expand All @@ -50,7 +51,7 @@ export interface ICacheDepth {
/**
* Cache depth in the turn directions.
*
* @description Max value is 1. Value will be coerced
* @description Max value is 1. Value will be clamped
* to the interval [0, 1].
* @default 0
*/
Expand Down
19 changes: 10 additions & 9 deletions src/component/interfaces/IDirectionConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import {IComponentConfiguration} from "../../Component";
import { IComponentConfiguration } from "../../Component";

/**
* Interface for configuration of direction component.
*
* @interface
* @example
* ```
* var viewer = new Mapillary.Viewer('<element-id>', '<client-id>', '<image-key>',
* {
* component: {
* direction: {
* minWidth: 140,
* maxWidth: 340,
* },
* var viewer = new Mapillary.Viewer({
* ...
* component: {
* direction: {
* minWidth: 140,
* maxWidth: 340,
* },
* })
* },
* ...
* });
* ```
*/
export interface IDirectionConfiguration extends IComponentConfiguration {
Expand Down
21 changes: 11 additions & 10 deletions src/component/interfaces/IKeyboardConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import {IComponentConfiguration} from "../../Component";
import { IComponentConfiguration } from "../../Component";

/**
* Interface for configuration of keyboard component.
*
* @interface
* @example
* ```
* var viewer = new Mapillary.Viewer('<element-id>', '<client-id>', '<image-key>',
* {
* component: {
* keyboard: {
* keyZoom: false,
* keySequenceNavigation: false,
* keySpatialNavigation: false,
* },
* var viewer = new Mapillary.Viewer({
* ...
* component: {
* keyboard: {
* keyZoom: false,
* keySequenceNavigation: false,
* keySpatialNavigation: false,
* },
* })
* },
* ...
* });
* ```
*/
export interface IKeyboardConfiguration extends IComponentConfiguration {
Expand Down
17 changes: 9 additions & 8 deletions src/component/interfaces/IMarkerConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import {IComponentConfiguration} from "../../Component";
import { IComponentConfiguration } from "../../Component";

/**
* Interface for configuration of marker component.
*
* @interface
* @example
* ```
* var viewer = new Mapillary.Viewer('<element-id>', '<client-id>', '<image-key>',
* {
* component: {
* marker: {
* visibleBBoxSize: 80,
* },
* var viewer = new Mapillary.Viewer({
* ...
* component: {
* marker: {
* visibleBBoxSize: 80,
* },
* })
* },
* ...
* });
* ```
*/
export interface IMarkerConfiguration extends IComponentConfiguration {
Expand Down
23 changes: 12 additions & 11 deletions src/component/interfaces/IMouseConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import {IComponentConfiguration} from "../../Component";
import { IComponentConfiguration } from "../../Component";

/**
* Interface for configuration of mouse component.
*
* @interface
* @example
* ```
* var viewer = new Mapillary.Viewer('<element-id>', '<client-id>', '<image-key>',
* {
* component: {
* mouse: {
* doubleClickZoom: false,
* dragPan: false,
* scrollZoom: false,
* touchZoom: false,
* },
* var viewer = new Mapillary.Viewer({
* ...
* component: {
* mouse: {
* doubleClickZoom: false,
* dragPan: false,
* scrollZoom: false,
* touchZoom: false,
* },
* })
* },
* ...
* });
* ```
*/
export interface IMouseConfiguration extends IComponentConfiguration {
Expand Down
17 changes: 9 additions & 8 deletions src/component/interfaces/INavigationConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import {IComponentConfiguration} from "../../Component";
import { IComponentConfiguration } from "../../Component";

/**
* Interface for configuration of navigation component.
*
* @interface
* @example
* ```
* var viewer = new Mapillary.Viewer('<element-id>', '<client-id>', '<image-key>',
* {
* component: {
* navigation: {
* spatial: false,
* },
* var viewer = new Mapillary.Viewer({
* ...
* component: {
* navigation: {
* spatial: false,
* },
* })
* },
* ...
* });
* ```
*/
export interface INavigationConfiguration extends IComponentConfiguration {
Expand Down
23 changes: 12 additions & 11 deletions src/component/interfaces/ISequenceConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import {IComponentConfiguration} from "../../Component";
import {EdgeDirection} from "../../Edge";
import { IComponentConfiguration } from "../../Component";
import { EdgeDirection } from "../../Edge";

/**
* Interface for configuration of sequence component.
*
* @interface
* @example
* ```
* var viewer = new Mapillary.Viewer('<element-id>', '<client-id>', '<image-key>',
* {
* component: {
* sequence: {
* minWidth: 40,
* maxWidth: 80,
* visible: false,
* },
* var viewer = new Mapillary.Viewer({
* ...
* component: {
* sequence: {
* minWidth: 40,
* maxWidth: 80,
* visible: false,
* },
* })
* },
* ...
* });
* ```
*/
export interface ISequenceConfiguration extends IComponentConfiguration {
Expand Down
25 changes: 13 additions & 12 deletions src/component/interfaces/ISliderConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {IComponentConfiguration} from "../../Component";
import { IComponentConfiguration } from "../../Component";

/**
* Enumeration for slider mode.
Expand Down Expand Up @@ -59,19 +59,20 @@ export interface ISliderKeys {
*
* @interface
* ```
* var viewer = new Mapillary.Viewer('<element-id>', '<client-id>', '<image-key>',
* {
* component: {
* slider: {
* initialPosition: 0.5,
* keys: {
* background: '<background-key>',
* foreground: '<foreground-key>',
* },
* sliderVisible: true,
* var viewer = new Mapillary.Viewer({
* ...
* component: {
* slider: {
* initialPosition: 0.5,
* keys: {
* background: '<background-key>',
* foreground: '<foreground-key>',
* },
* sliderVisible: true,
* },
* })
* },
* ...
* });
* ```
*/
export interface ISliderConfiguration extends IComponentConfiguration {
Expand Down
17 changes: 9 additions & 8 deletions src/component/interfaces/ITagConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ import {
* @interface
* @example
* ```
* var viewer = new Mapillary.Viewer('<element-id>', '<client-id>', '<image-key>',
* {
* component: {
* tag: {
* createColor: 0xFF0000,
* mode: Mapillary.TagComponent.TagMode.CreateRect,
* },
* var viewer = new Mapillary.Viewer({
* ...
* component: {
* tag: {
* createColor: 0xFF0000,
* mode: Mapillary.TagComponent.TagMode.CreateRect,
* },
* })
* },
* ...
* });
* ```
*/
export interface ITagConfiguration extends IComponentConfiguration {
Expand Down
7 changes: 2 additions & 5 deletions src/component/keyboard/KeyboardComponent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Subscription} from "rxjs";
import { Subscription } from "rxjs";

import {
ComponentService,
Expand Down Expand Up @@ -27,10 +27,7 @@ import {
*
* @example
* ```
* var viewer = new Mapillary.Viewer(
* "<element-id>",
* "<client-id>",
* "<my key>");
* var viewer = new Mapillary.Viewer({ ... });
*
* var keyboardComponent = viewer.getComponent("keyboard");
* ```
Expand Down
6 changes: 1 addition & 5 deletions src/component/marker/MarkerComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ import {
*
* @example
* ```
* var viewer = new Mapillary.Viewer(
* "<element-id>",
* "<client-id>",
* "<my key>",
* { component: { marker: true } });
* var viewer = new Mapillary.Viewer({ component: { marker: true }, ... });
*
* var markerComponent = viewer.getComponent("marker");
* ```
Expand Down
7 changes: 2 additions & 5 deletions src/component/mouse/MouseComponent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Subscription} from "rxjs";
import { Subscription } from "rxjs";

import {
BounceHandler,
Expand Down Expand Up @@ -29,10 +29,7 @@ import {
*
* @example
* ```
* var viewer = new Mapillary.Viewer(
* "<element-id>",
* "<client-id>",
* "<my key>");
* var viewer = new Mapillary.Viewer({ ... });
*
* var mouseComponent = viewer.getComponent("mouse");
* ```
Expand Down
6 changes: 1 addition & 5 deletions src/component/popup/PopupComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ import {
*
* @example
* ```
* var viewer = new Mapillary.Viewer(
* "<element-id>",
* "<client-id>",
* "<my key>",
* { component: { popup: true } });
* var viewer = new Mapillary.Viewer({ component: { popup: true }, ... });
*
* var popupComponent = viewer.getComponent("popup");
* ```
Expand Down
5 changes: 1 addition & 4 deletions src/component/slider/SliderComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ import {
*
* @example
* ```
* var viewer = new Mapillary.Viewer(
* "<element-id>",
* "<client-id>",
* "<my key>");
* var viewer = new Mapillary.Viewer({ ... });
*
* viewer.deactivateComponent("imagePlane");
* viewer.deactivateComponent("direction");
Expand Down
Loading

0 comments on commit 6967d16

Please sign in to comment.