@cyclomedia/streetsmart-api 23.12.3 → 23.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,27 +4,93 @@ This Streetsmart api package provides programmatic access to most of the UI comp
4
4
 
5
5
  ---
6
6
 
7
- ### Setup
7
+ ## Setup
8
8
 
9
9
  First install the package using npm or yarn.
10
10
 
11
- `npm i @cyclomedia/streetsmart-api`
11
+ ```sh
12
+ npm i @cyclomedia/streetsmart-api
13
+ ```
12
14
 
13
15
  Then import the package like
14
16
 
15
- `import StreetSmartApi from "@cyclomedia/streetsmart-api";`
17
+ ```ts
18
+ import StreetSmartApi from "@cyclomedia/streetsmart-api";
19
+ ````
16
20
 
17
21
  Please note that the package only exposes one default export and no named exports.
18
22
 
19
- Hence `import { init } from "@cyclomedia/streetsmart-api"` should not be attempted.
23
+ ❌ This will not work
24
+ ```ts
25
+ import { init } from "@cyclomedia/streetsmart-api"
26
+ ```
20
27
 
21
- ### Init
28
+ ✅ Named imports of TypeScript types is okay
29
+ ```ts
30
+ import { ApiOptions } from "@cyclomedia/streetsmart-api"
31
+ ```
22
32
 
23
- The viewer can be initialized by calling. Please see the Typescript docs for more info.
33
+ ## API
34
+ #### Init
24
35
 
25
- `StreetSmartApi.init({options})`
36
+ Please see the [official docs](https://streetsmart.cyclomedia.com/api/v23.12/documentation/#init) or the `ApiOptions` type for more informations about the options.
26
37
 
27
- ### Destroy
38
+ ```ts
39
+ import StreetSmartApi from "@cyclomedia/streetsmart-api";
28
40
 
29
- The viewer can be destroyed by calling
30
- `StreetSmartApi.destroy(options)`
41
+ StreetSmartApi.init({
42
+ targetElement: HTMLElement,
43
+ srs: string,
44
+ locale: string,
45
+ apiKey: string,
46
+ loginOauth: boolean,
47
+ loginRedirectUri: string,
48
+ logoutRedirectUri: string,
49
+ clientId: string,
50
+ ...
51
+ })
52
+ ```
53
+
54
+ #### Open Panorama viewer
55
+
56
+ Please checkout the [official docs](https://streetsmart.cyclomedia.com/api/v23.12/documentation/#open).
57
+
58
+ ```ts
59
+ import StreetSmartApi, {OpenViewerQuery} from "@cyclomedia/streetsmart-api";
60
+
61
+ StreetSmartApi.open("1681 broadway, New York NY", {
62
+ viewerType: "PANORAMA" | "OBLIQUE" | "...",
63
+ srs: string,
64
+ panoramaViewer: {
65
+ closable: boolean,
66
+ maximizable: boolean,
67
+ timeTravelVisible: boolean,
68
+ recordingsVisible: boolean,
69
+ navbarVisible: boolean,
70
+ ...
71
+ },
72
+ ...
73
+ })
74
+ ```
75
+
76
+ #### Destroy
77
+
78
+ For options and behavior please refer to the [official docs](https://streetsmart.cyclomedia.com/api/v23.12/documentation/#destroy)
79
+
80
+ ```ts
81
+ StreetSmartApi.destroy({
82
+ targetElement: HTMLElement,
83
+ loginOauth: boolean
84
+ })
85
+ ```
86
+
87
+ ## FAQ
88
+ - [What API functions are available?](#what-api-functions-are-available)
89
+ - [The PointCloud Viewer or 3DNL viewer don't load](#the-pointcloud-viewer-or-3dnl-viewer-don't-load)
90
+
91
+ #### What API functions are available?
92
+ Please see the [docs](https://streetsmart.cyclomedia.com/api/v23.12/documentation/) for all available functionality.
93
+
94
+ #### The PointCloud Viewer or 3DNL viewer don't load
95
+ Only the panorama and oblique viewer are working in this package.
96
+ We are actively working on integrating the PointCloud viewer and the mesh (3DNL) viewer.