@cyclomedia/streetsmart-api 23.12.3 → 23.14.0
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 +78 -12
- package/dist/esm/index.js +80 -0
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -1,30 +1,96 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Street Smart API
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This Street Smart api package provides programmatic access to most of the UI components of the Street Smart Web application [here](https://streetsmart.cyclomedia.com).
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Setup
|
|
8
8
|
|
|
9
9
|
First install the package using npm or yarn.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
```sh
|
|
12
|
+
npm i @cyclomedia/streetsmart-api
|
|
13
|
+
```
|
|
12
14
|
|
|
13
15
|
Then import the package like
|
|
14
16
|
|
|
15
|
-
|
|
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
|
-
|
|
23
|
+
❌ This will not work
|
|
24
|
+
```ts
|
|
25
|
+
import { init } from "@cyclomedia/streetsmart-api"
|
|
26
|
+
```
|
|
20
27
|
|
|
21
|
-
|
|
28
|
+
✅ Named imports of TypeScript types is okay
|
|
29
|
+
```ts
|
|
30
|
+
import { ApiOptions } from "@cyclomedia/streetsmart-api"
|
|
31
|
+
```
|
|
22
32
|
|
|
23
|
-
|
|
33
|
+
## API
|
|
34
|
+
#### Init
|
|
24
35
|
|
|
25
|
-
|
|
36
|
+
Please see the [official docs](https://streetsmart.cyclomedia.com/api/v23.12/documentation/#init) or the `ApiOptions` type for more information about the options.
|
|
26
37
|
|
|
27
|
-
|
|
38
|
+
```ts
|
|
39
|
+
import StreetSmartApi from "@cyclomedia/streetsmart-api";
|
|
28
40
|
|
|
29
|
-
|
|
30
|
-
|
|
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 check out 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 Point Cloud 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 point cloud viewer and the mesh (3DNL) viewer.
|