|
14 | 14 | " |
15 | 15 | class="pa-0" |
16 | 16 | @click="get_x_y" |
17 | | - @keydown.esc="viewer_store.toggle_picking_mode(false)" |
| 17 | + @keydown.esc="viewerStore.toggle_picking_mode(false)" |
18 | 18 | /> |
19 | 19 | </div> |
20 | 20 | </ClientOnly> |
|
32 | 32 | viewId: { type: String, default: "-1" }, |
33 | 33 | }) |
34 | 34 |
|
35 | | - const viewer_store = useViewerStore() |
| 35 | + const viewerStore = useViewerStore() |
36 | 36 | const viewer = useTemplateRef("viewer") |
37 | 37 | const { width, height } = useElementSize(viewer) |
38 | 38 |
|
39 | 39 | const { width: windowWidth, height: windowHeight } = useWindowSize() |
40 | 40 |
|
41 | 41 | function get_x_y(event) { |
42 | | - if (viewer_store.picking_mode.value === true) { |
| 42 | + if (viewerStore.picking_mode.value === true) { |
43 | 43 | const { offsetX, offsetY } = event |
44 | | - viewer_store.set_picked_point(offsetX, offsetY) |
45 | | - viewer_call({ |
46 | | - schema: viewer_schemas.opengeodeweb_viewer.viewer.get_point_position, |
47 | | - params: { x: offsetX, y: offsetY }, |
48 | | - }) |
| 44 | + viewerStore.set_picked_point(offsetX, offsetY) |
| 45 | + viewerStore.request( |
| 46 | + viewer_schemas.opengeodeweb_viewer.viewer.get_point_position, |
| 47 | + { x: offsetX, y: offsetY }, |
| 48 | + ) |
49 | 49 | } |
50 | 50 | } |
51 | 51 |
|
|
70 | 70 | }) |
71 | 71 |
|
72 | 72 | watch( |
73 | | - () => viewer_store.picking_mode, |
| 73 | + () => viewerStore.picking_mode, |
74 | 74 | (value) => { |
75 | 75 | const cursor = value ? "crosshair" : "pointer" |
76 | 76 | view.getCanvasView().setCursor(cursor) |
|
82 | 82 | }) |
83 | 83 |
|
84 | 84 | watch( |
85 | | - () => viewer_store.client, |
| 85 | + () => viewerStore.client, |
86 | 86 | () => { |
87 | 87 | connect() |
88 | 88 | }, |
|
99 | 99 | ) |
100 | 100 |
|
101 | 101 | function connect() { |
102 | | - if (viewer_store.status !== Status.CONNECTED) { |
| 102 | + if (viewerStore.status !== Status.CONNECTED) { |
103 | 103 | return |
104 | 104 | } |
105 | | - const session = viewer_store.client.getConnection().getSession() |
| 105 | + const session = viewerStore.client.getConnection().getSession() |
106 | 106 | view.setSession(session) |
107 | 107 | view.setViewId(props.viewId) |
108 | 108 | connected.value = true |
|
0 commit comments