@pointr-tech/web-sdk 10.8.0-rc.3
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 +125 -0
- package/dist/css/pointr.css +5 -0
- package/dist/mapbox-gl-rtl-text.min.js +6 -0
- package/dist/pointrwebsdk.d.ts +3022 -0
- package/dist/pointrwebsdk.esm.mjs +347 -0
- package/dist/pointrwebsdk.js +318 -0
- package/package.json +193 -0
package/README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Pointr Web SDK
|
|
2
|
+
|
|
3
|
+
Pointr Web SDK provides interactive indoor maps and static wayfinding for web apps and kiosks.
|
|
4
|
+
|
|
5
|
+
- Docs: [Web SDK References](https://dev.pointr.tech/sdk-and-api-references/web-sdk-references)
|
|
6
|
+
- Playground: [Web Playground (Code Editor)](https://websdk-playground.pointr.cloud/)
|
|
7
|
+
- Sample projects: [Download a Sample Project](https://dev.pointr.tech/sdk-and-api-references/web-sdk-references#sample-projects)
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install pointr-web-sdk
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
You can integrate the SDK either from npm (bundled in your app) or directly via CDN.
|
|
16
|
+
|
|
17
|
+
## Quick Start (npm + bundler)
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { MapWidget, Options } from "pointr-web-sdk";
|
|
21
|
+
import "pointr-web-sdk/css";
|
|
22
|
+
|
|
23
|
+
const options = new Options({
|
|
24
|
+
container: "pointr-map",
|
|
25
|
+
baseUrl: "BASE_URL",
|
|
26
|
+
clientIdentifier: "CLIENT_IDENTIFIER",
|
|
27
|
+
licenseKey: "LICENSE_KEY",
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const pointrWeb = new MapWidget(options);
|
|
31
|
+
pointrWeb.start();
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<div id="pointr-map"></div>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Quick Start (CDN)
|
|
39
|
+
|
|
40
|
+
Add SDK assets to your HTML:
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<head>
|
|
44
|
+
<link href="https://pointr-websdk.azureedge.net/${version}/css/pointr.css" rel="stylesheet" />
|
|
45
|
+
<script src="https://pointr-websdk.azureedge.net/${version}/pointrwebsdk.js"></script>
|
|
46
|
+
</head>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Initialize and start the map:
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<script>
|
|
53
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
54
|
+
const options = new PointrWebSDK.Options({
|
|
55
|
+
container: "pointr-map",
|
|
56
|
+
baseUrl: "BASE_URL",
|
|
57
|
+
clientIdentifier: "CLIENT_IDENTIFIER",
|
|
58
|
+
licenseKey: "LICENSE_KEY",
|
|
59
|
+
siteInternalIdentifier: "SITE_INTERNAL_IDENTIFIER", // optional
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const pointrWeb = new PointrWebSDK.MapWidget(options);
|
|
63
|
+
pointrWeb.start();
|
|
64
|
+
});
|
|
65
|
+
</script>
|
|
66
|
+
<div id="pointr-map"></div>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Authentication Options
|
|
70
|
+
|
|
71
|
+
### Option 1: Client credentials
|
|
72
|
+
|
|
73
|
+
Set these required options:
|
|
74
|
+
|
|
75
|
+
- `baseUrl`
|
|
76
|
+
- `clientIdentifier`
|
|
77
|
+
- `licenseKey`
|
|
78
|
+
|
|
79
|
+
### Option 2: Pointr Cloud Token
|
|
80
|
+
|
|
81
|
+
You can initialize with `pointrCloudToken` instead of client credentials:
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
85
|
+
const options = new PointrWebSDK.Options({
|
|
86
|
+
container: "pointr-map",
|
|
87
|
+
pointrCloudToken: "POINTR_CLOUD_TOKEN",
|
|
88
|
+
siteInternalIdentifier: "SITE_INTERNAL_IDENTIFIER", // optional
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const pointrWeb = new PointrWebSDK.MapWidget(options);
|
|
92
|
+
pointrWeb.start();
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
When using token-based initialization, you are responsible for token refresh:
|
|
97
|
+
|
|
98
|
+
```js
|
|
99
|
+
pointrWeb.setPointrCloudToken(access_token);
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
See [Pointr Cloud API Reference](https://dev.pointr.tech/sdk-and-api-references/cloud-api-reference) for token retrieval.
|
|
103
|
+
|
|
104
|
+
## Required Options
|
|
105
|
+
|
|
106
|
+
| Option | Type | Description |
|
|
107
|
+
| -------------------------- | -------- | ----------------------------------------------- |
|
|
108
|
+
| `baseUrl` | `string` | URL of your Pointr Cloud instance. |
|
|
109
|
+
| `clientIdentifier` | `string` | Client internal identifier provided by Pointr. |
|
|
110
|
+
| `licenseKey` | `string` | Client secret / license key provided by Pointr. |
|
|
111
|
+
|
|
112
|
+
For full option details, see [Web SDK References](https://dev.pointr.tech/sdk-and-api-references/web-sdk-references).
|
|
113
|
+
|
|
114
|
+
## Common Use Cases
|
|
115
|
+
|
|
116
|
+
- [Highlight a POI](https://dev.pointr.tech/getting-started/web-quick-start/highlight-a-poi)
|
|
117
|
+
- [Start Wayfinding](https://dev.pointr.tech/getting-started/web-quick-start/start-wayfinding)
|
|
118
|
+
- [Add Map Event Listeners](https://dev.pointr.tech/getting-started/web-quick-start/add-map-event-listeners)
|
|
119
|
+
- [Add Custom Markers](https://dev.pointr.tech/getting-started/web-quick-start/add-custom-markers)
|
|
120
|
+
- [Kiosks](https://dev.pointr.tech/getting-started/web-quick-start/kiosk-guide)
|
|
121
|
+
|
|
122
|
+
## Important Notes
|
|
123
|
+
|
|
124
|
+
- Due to browser limitations (especially Bluetooth/background constraints), real-time positioning is supported on Mobile SDK, not Web SDK.
|
|
125
|
+
- SDK and map configuration can be updated from Pointr Cloud Dashboard without app redeploy; changes are typically visible within ~15 minutes.
|