|
1 | 1 | <template> |
2 | | - <v-sheet :width="width + 'px'" class="z-scaling-menu" border="md"> |
3 | | - <v-card class="bg-primary pa-0"> |
4 | | - <v-card-title> |
5 | | - <h3 class="mt-4">Z Scaling Control</h3> |
| 2 | + <v-sheet |
| 3 | + :width="width + 'px'" |
| 4 | + class="z-scaling-menu" |
| 5 | + elevation="10" |
| 6 | + rounded="lg" |
| 7 | + > |
| 8 | + <v-card class="bg-primary pa-4" elevation="0"> |
| 9 | + <v-card-title class="d-flex justify-space-between align-center"> |
| 10 | + <h3 class="text-h5 font-weight-bold">Z Scaling Control</h3> |
6 | 11 | </v-card-title> |
7 | | - <v-card-text class="pa-0"> |
| 12 | + <v-card-text class="pt-4"> |
8 | 13 | <v-container> |
9 | 14 | <v-row> |
10 | | - <v-col cols="12" class="py-0"> |
| 15 | + <v-col cols="12" class="py-2"> |
11 | 16 | <v-slider |
12 | 17 | v-model="zScale" |
13 | 18 | :min="0.1" |
14 | 19 | :max="10" |
15 | 20 | :step="0.2" |
16 | 21 | label="Z Scale" |
17 | 22 | thumb-label |
| 23 | + color="white" |
| 24 | + track-color="white" |
18 | 25 | ></v-slider> |
19 | 26 | </v-col> |
20 | 27 | </v-row> |
21 | 28 | <v-row> |
22 | | - <v-col cols="12" class="py-0"> |
| 29 | + <v-col cols="12" class="py-2"> |
23 | 30 | <v-text-field |
24 | | - v-model="zScale" |
| 31 | + v-model.number="zScale" |
25 | 32 | type="number" |
26 | 33 | label="Z Scale Value" |
| 34 | + outlined |
| 35 | + dense |
| 36 | + hide-details |
| 37 | + step="0.1" |
| 38 | + class="custom-number-input" |
27 | 39 | ></v-text-field> |
28 | 40 | </v-col> |
29 | 41 | </v-row> |
30 | 42 | </v-container> |
31 | 43 | </v-card-text> |
32 | | - <v-card-actions justify-center> |
33 | | - <v-btn |
34 | | - variant="outlined" |
35 | | - color="white" |
36 | | - text |
37 | | - @click="emit('close')" |
38 | | - class="ml-8 mb-4" |
39 | | - > |
| 44 | + <v-card-actions class="justify-center pb-4"> |
| 45 | + <v-btn variant="text" color="white" @click="emit('close')" class="px-4"> |
40 | 46 | Close |
41 | 47 | </v-btn> |
42 | 48 | <v-btn |
43 | 49 | variant="outlined" |
44 | | - class="mb-4" |
45 | 50 | color="white" |
46 | | - text |
47 | 51 | @click="updateZScaling" |
| 52 | + class="px-4" |
48 | 53 | > |
49 | 54 | Apply |
50 | 55 | </v-btn> |
|
54 | 59 | </template> |
55 | 60 |
|
56 | 61 | <script setup> |
57 | | - import viewer_schemas from "@geode/opengeodeweb-viewer/schemas.json" |
58 | | -
|
| 62 | + const hybridViewerStore = useHybridViewerStore() |
59 | 63 | const emit = defineEmits(["close"]) |
60 | | -
|
61 | 64 | const props = defineProps({ |
62 | 65 | width: { type: Number, required: false, default: 400 }, |
63 | 66 | }) |
64 | 67 |
|
65 | | - const zScale = ref(1.0) |
| 68 | + const zScale = ref(hybridViewerStore.zScale) |
66 | 69 |
|
67 | | - async function updateZScaling() { |
68 | | - const schema = viewer_schemas?.opengeodeweb_viewer?.viewer?.set_z_scaling |
69 | | - console.log("schema", schema, "z_scale", zScale.value) |
70 | | - await viewer_call({ |
71 | | - schema, |
72 | | - params: { |
73 | | - z_scale: zScale.value, |
74 | | - }, |
75 | | - }) |
| 70 | + watch( |
| 71 | + () => hybridViewerStore.zScale, |
| 72 | + (newVal) => { |
| 73 | + zScale.value = newVal |
| 74 | + }, |
| 75 | + ) |
76 | 76 |
|
| 77 | + async function updateZScaling() { |
| 78 | + await hybridViewerStore.setZScaling(zScale.value) |
77 | 79 | emit("close") |
78 | 80 | } |
79 | 81 | </script> |
|
84 | 86 | z-index: 2; |
85 | 87 | top: 90px; |
86 | 88 | right: 55px; |
| 89 | + border-radius: 12px !important; |
| 90 | + } |
| 91 | +
|
| 92 | + .custom-number-input :deep(.v-input__control) { |
| 93 | + min-height: 48px; |
| 94 | + } |
| 95 | +
|
| 96 | + .v-btn { |
| 97 | + border-radius: 8px; |
| 98 | + text-transform: none; |
| 99 | + font-weight: 500; |
| 100 | + letter-spacing: normal; |
87 | 101 | } |
88 | 102 | </style> |
0 commit comments