Py.Cafe

adamschroeder.m/

GGM-Classroom

Interactive Virtual Tour of Madison Streets

DocsPricing
  • app.py
  • requirements.txt
app.py
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import dash
from dash import html, dcc, Input, Output
import dash_pannellum

app = dash.Dash(__name__)

tour_config = {
    "default": {
        "firstScene": "outside",
        "sceneFadeDuration": 1000,
    },
    "scenes": {
        "outside": {
            "title": "Outside Classroom",
            "hfov": 200,
            "pitch": -1,
            "yaw": -30,
            "type": "equirectangular",
            "panorama": "https://i.ibb.co/Fn71NwK/signal-2024-11-03-202251-111.jpg",
            "autoLoad": True,
            "hotSpots": [
                {
                    "pitch": -2.1,
                    "yaw": -30,
                    "type": "scene",
                    "text": "Go into classroom",
                    "sceneId": "classroom"
                }
            ]
        },
        "classroom": {
            "title": "Inside Classroom",
            "hfov": 200,
            "yaw": -60,
            "type": "equirectangular",
            "panorama": "https://i.ibb.co/kmJQMzR/signal-2024-11-03-202251-333.jpg",
            "autoLoad": True,
            "hotSpots": [
                {
                    "pitch": 0,
                    "yaw": 180,
                    "type": "scene",
                    "text": "Go outside",
                    "sceneId": "outside",
                    "targetYaw": 180,
                    "targetPitch": 0
                }
            ]
        }
    }
}



app.layout = html.Div([
    html.H1("GGM School Tour"),
    dash_pannellum.DashPannellum(
        id='tour-component',
        tour=tour_config,
        customControls=True,
        showCenterDot=False,
        width='100%',
        height='750px',
        autoLoad=True,
        compass=True,
        northOffset=90
    ),
])