Skip to content

Commit

Permalink
Update z2ui5_cl_demo_app_123 new Element (#148)
Browse files Browse the repository at this point in the history
* Update z2ui5_cl_demo_app_123 new Element

Updated a sample for routes and legende

* z2ui5_cl_demo_app_123.clas.abap aktualisieren

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Update src/z2ui5_cl_demo_app_123.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

---------

Co-authored-by: oblomov <[email protected]>
Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 23, 2024
1 parent 0185446 commit 25ad80f
Showing 1 changed file with 98 additions and 30 deletions.
128 changes: 98 additions & 30 deletions src/z2ui5_cl_demo_app_123.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@ CLASS z2ui5_cl_demo_app_123 DEFINITION

DATA check_initialized TYPE abap_bool.

TYPES:
BEGIN OF ty_ROUTE,
position TYPE string,
routetype TYPE string,
lineDash TYPE string,
color TYPE string,
colorborder TYPE string,
linewidth TYPE string,
END OF ty_route .

DATA:
mt_route TYPE TABLE OF ty_ROUTE .

TYPES: BEGIN OF ty_s_legend,
text TYPE string,
color TYPE string,
END OF ty_s_legend.
DATA mt_legend TYPE TABLE OF ty_s_legend.

PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
Expand All @@ -40,6 +59,15 @@ CLASS z2ui5_cl_demo_app_123 IMPLEMENTATION.
( pos = `8.683340000;50.112000000;0` contentoffset = `0;-6` scale = `1;1;1` key = `Frankfurt` tooltip = `Frankfurt` type = `Default` icon = `factory` )
).

mt_route = VALUE #(
( position = '2.3522219;48.856614;0; -74.0059731;40.7143528;0' routetype = 'Geodesic' lineDash = '10;5' color = '92,186,230' colorBorder = 'rgb(255,255,255)' linewidth = '25' )
).


mt_legend = VALUE #(
( text = 'Dashed flight route' color = 'rgb(92,186,230)' )
( text = 'Flight route' color = 'rgb(92,186,35)' )
).
ENDIF.


Expand All @@ -51,36 +79,76 @@ CLASS z2ui5_cl_demo_app_123 IMPLEMENTATION.
ENDCASE.


DATA(view) = z2ui5_cl_xml_view=>factory( ).
client->view_display( view->shell(
)->page(
title = 'abap2UI5 - Map Container'
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(
)->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( ) ).
DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA(page) = view->shell(
)->page(
title = 'abap2UI5 - Map Container'
navbuttonpress = client->_event( val = 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
).

page->header_content(
)->link(
text = 'Source_Code'

target = '_blank'
).

DATA(map) = page->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`
) .



map->vos(
)->spots( client->_bind( mt_spot )
)->spot(
position = `{POS}`
contentoffset = `{CONTENTOFFSET}`
type = `{TYPE}`
scale = `{SCALE}`
tooltip = `{TOOLTIP}`
).


map->routes( client->_bind( mt_route ) )->route(
EXPORTING
* id =
position = `{POSITION}`
routetype = `{ROUTETYPE}`
lineDash = '{LINEDASH}'
color = '{COLOR}'
colorBorder = '{COLORBORDER}'
linewidth = '{LINEWIDTH}'
* RECEIVING
* result =
).


map->legend_area( )->legend(
* EXPORTING
* id =
items = client->_bind( mt_legend )
caption = 'Legend'
* RECEIVING
* result =
)->legenditem(
EXPORTING
* id =
text = '{TEXT}'
color = '{COLOR}'
* RECEIVING
* result =
).
client->view_display( page->stringify( ) ).


ENDMETHOD.
ENDCLASS.

0 comments on commit 25ad80f

Please sign in to comment.