-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
48 lines (45 loc) · 1.17 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* globals WrldIndoorControl */
import { Wrld, WrldMap } from "wrld-react";
const App = () => {
return (
<div>
<WrldMap
apiKey={"your_api_key_here"}
containerStyle={{
width: "600px",
height: "400px"
}}
mapOptions={{
center: [56.459604, -2.977816],
indoorsEnabled: true
}}
onMapMount={(map) => {
new WrldIndoorControl("wrld-indoor-control", map);
}}
onInitialStreamingComplete={(map) => {
map.indoors.on("indoormapenter", ({ indoorMap }) => {
map.indoors.setFloor(2);
map.setView([56.459984, -2.978238], 19);
Wrld.marker([56.459984, -2.978238], {
indoorMapId: indoorMap.getIndoorMapId(),
indoorMapFloorId: 2
}).addTo(map);
});
map.indoors.enter("westport_house");
}}
>
<div
id={"wrld-indoor-control"}
style={{
position: "absolute",
top: "20px",
right: "20px",
bottom: "40px"
}}
>
</div>
</WrldMap>
</div>
);
};
export default App;