@@ -47,6 +47,13 @@ function showContextMenuMap(e) {
4747 "</div>" ,
4848 "<ul>" ,
4949 "<li id='contextMenuMapCopyCoords'>Copy Coordinates</li>" ,
50+ Object . keys ( L_ . _toolCopyables ) . map ( ( key , idx ) => {
51+ const c = L_ . _toolCopyables [ key ]
52+ const items = [ ]
53+ if ( c . title && c . copyable )
54+ items . push ( `<li id='contextMenuCopyable' key='${ key } '>${ c . title } </li>` )
55+ return items . join ( '\n' )
56+ } ) . join ( '\n' ) ,
5057 contextMenuActions . map ( ( a , idx ) => {
5158 const items = [ ]
5259 if ( a . for == null ) {
@@ -89,13 +96,26 @@ function showContextMenuMap(e) {
8996 } )
9097
9198 $ ( '#contextMenuMapCopyCoords' ) . on ( 'click' , function ( ) {
92- F_ . copyToClipboard ( JSON . stringify ( Coordinates . getAllCoordinates ( ) ) )
99+ F_ . copyToClipboard (
100+ JSON . stringify ( Coordinates . getAllCoordinates ( ) , null , 2 )
101+ )
93102 $ ( '#contextMenuMapCopyCoords' ) . text ( 'Copied!' )
94103 setTimeout ( function ( ) {
95104 $ ( '#contextMenuMapCopyCoords' ) . text ( 'Copy Coordinates' )
96105 } , 2000 )
97106 } )
98107
108+ $ ( '#contextMenuCopyable' ) . on ( 'click' , function ( ) {
109+ const that = this
110+ const key = $ ( that ) . attr ( 'key' )
111+ const copyable = L_ . _toolCopyables [ key ]
112+ F_ . copyToClipboard ( JSON . stringify ( copyable . copyable , null , 2 ) )
113+ $ ( that ) . text ( 'Copied!' )
114+ setTimeout ( function ( ) {
115+ $ ( that ) . text ( copyable . title )
116+ } , 2000 )
117+ } )
118+
99119 contextMenuActionsFull . forEach ( ( c ) => {
100120 $ ( `#contextMenuAction_${ c . idx } _${ c . idx2 } ` ) . on ( 'click' , function ( ) {
101121 const a = c . contextMenuAction
0 commit comments