@ray-js/robot-map-sdk 0.0.2-beta-1
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 +34 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +3501 -0
- package/dist/index.es.js +1 -0
- package/dist-app/assets/index-ByRT_epP.js +1 -0
- package/dist-app/assets/robot-C6x7WFAQ.png +0 -0
- package/dist-app/assets/sleep-C_YKDk6M.json +879 -0
- package/dist-app/index.html +16 -0
- package/package.json +81 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Robot Map SDK
|
|
2
|
+
|
|
3
|
+
A high-performance 2D map SDK for robot vacuums based on PIXI.js.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { MapApplication } from '@ray-js/robot-map-sdk'
|
|
9
|
+
|
|
10
|
+
// Create map application instance
|
|
11
|
+
const mapApp = new MapApplication()
|
|
12
|
+
|
|
13
|
+
// Initialize
|
|
14
|
+
await mapApp.initialize({
|
|
15
|
+
resizeTo: containerElement,
|
|
16
|
+
config: {
|
|
17
|
+
global: {
|
|
18
|
+
backgroundColor: 0xffffff,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
runtime: {
|
|
22
|
+
enableRoomSelection: true,
|
|
23
|
+
showRoomName: true,
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
// Draw map
|
|
28
|
+
const rasterData = decodeMap(mapString)
|
|
29
|
+
await mapApp.drawRasterMap(rasterData)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## API Documentation
|
|
33
|
+
|
|
34
|
+
For detailed API documentation, please refer to the generated documentation site.
|