-
Notifications
You must be signed in to change notification settings - Fork 12
/
z2ui5_cl_demo_app_120.clas.abap
158 lines (136 loc) · 6.99 KB
/
z2ui5_cl_demo_app_120.clas.abap
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
CLASS z2ui5_cl_demo_app_120 DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES z2ui5_if_app .
DATA longitude TYPE string.
DATA latitude TYPE string.
DATA altitude TYPE string.
DATA speed TYPE string.
DATA altitudeaccuracy TYPE string.
DATA accuracy TYPE string.
DATA check_initialized TYPE abap_bool .
TYPES:
BEGIN OF ty_spot,
tooltip TYPE string,
type TYPE string,
pos TYPE string,
scale TYPE string,
contentoffset TYPE string,
key TYPE string,
icon TYPE string,
END OF ty_spot.
DATA mt_spot TYPE TABLE OF ty_spot.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_demo_app_120 IMPLEMENTATION.
METHOD z2ui5_if_app~main.
IF check_initialized = abap_false.
check_initialized = abap_true.
DATA(view) = z2ui5_cl_xml_view=>factory( ).
client->view_display( view->shell(
)->page(
title = 'abap2UI5 - Device Capabilities'
navbuttonpress = client->_event( val = 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
)->header_content(
)->link(
text = 'Source_Code'
target = '_blank'
)->get_parent(
)->_z2ui5( )->geolocation(
finished = client->_event( `GEOLOCATION_LOADED` )
longitude = client->_bind_edit( longitude )
latitude = client->_bind_edit( latitude )
altitude = client->_bind_edit( altitude )
altitudeaccuracy = client->_bind_edit( altitudeaccuracy )
accuracy = client->_bind_edit( accuracy )
speed = client->_bind_edit( speed )
)->simple_form( title = 'Geolocation' editable = abap_true
)->content( 'form'
)->label( 'Longitude'
)->input( client->_bind_edit( longitude )
)->label( `Latitude`
)->input( client->_bind_edit( latitude )
)->label( `Altitude`
)->input( client->_bind_edit( altitude )
)->label( `Accuracy`
)->input( client->_bind_edit( accuracy )
)->label( `AltitudeAccuracy`
)->input( client->_bind_edit( altitudeaccuracy )
)->label( `Speed`
)->input( client->_bind_edit( speed )
)->label( `MapContainer`
)->button( text = `Display` press = client->_event( `MAP_CONTAINER_DISPLAY` )
)->stringify( ) ).
* client->view_display( z2ui5_cl_xml_view=>factory( client
* )->_z2ui5( )->timer( client->_event( `GEOLOCATION_LOADED` )
* )->_cc( )->geolocation( )->load_cc( )->stringify( ) ).
RETURN.
ENDIF.
CASE client->get( )-event.
WHEN 'MAP_CONTAINER_DISPLAY'.
IF longitude IS NOT INITIAL.
mt_spot = VALUE #( ( pos = longitude && `;` && latitude && `;0` type = `Default` contentoffset = `0;-6` scale = `1;1;1` key = `Your Position` tooltip = `Your Position` ) ).
ENDIF.
view = z2ui5_cl_xml_view=>factory( ).
client->view_display( view->shell(
)->page(
title = 'abap2UI5 - Device Capabilities'
navbuttonpress = client->_event( val = 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
)->header_content(
)->link(
text = 'Source_Code'
target = '_blank'
)->get_parent(
)->_z2ui5( )->geolocation(
finished = client->_event( )
longitude = client->_bind_edit( longitude )
latitude = client->_bind_edit( latitude )
altitude = client->_bind_edit( altitude )
altitudeaccuracy = client->_bind_edit( altitudeaccuracy )
accuracy = client->_bind_edit( accuracy )
speed = client->_bind_edit( speed )
)->simple_form( title = 'Geolocation' editable = abap_true
)->content( 'form'
)->label( 'Longitude'
)->input( client->_bind_edit( longitude )
)->label( `Latitude`
)->input( client->_bind_edit( latitude )
)->label( `Altitude`
)->input( client->_bind_edit( altitude )
)->label( `Accuracy`
)->input( client->_bind_edit( accuracy )
)->label( `AltitudeAccuracy`
)->input( client->_bind_edit( altitudeaccuracy )
)->label( `Speed`
)->input( client->_bind_edit( speed )
)->label( `MapContainer`
)->button( text = `Display` press = client->_event( `MAP_CONTAINER_DISPLAY` )
)->get_parent( )->get_parent(
)->map_container( autoadjustheight = abap_true
)->content( ns = `vk`
)->container_content(
title = `Analytic Map`
icon = `sap-icon://geographic-bubble-chart`
)->content( ns = `vk`
)->analytic_map(
initialposition = `9.933573;50;0`
initialzoom = `6`
)->vos(
)->spots( client->_bind( mt_spot )
)->spot(
position = `{POS}`
contentoffset = `{CONTENTOFFSET}`
type = `{TYPE}`
scale = `{SCALE}`
tooltip = `{TOOLTIP}`
)->stringify( ) ).
WHEN 'BACK'.
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).
RETURN.
ENDCASE.
ENDMETHOD.
ENDCLASS.