@@ -51,9 +51,10 @@ private void initClassMap() {
51
51
* @param param5 additional param
52
52
*/
53
53
@ SuppressWarnings ("unchecked" )
54
- public void functionCalled (String functionName , Object param1 , Object param2 , Object param3 , Object param4 ,
55
- Object param5 ) {
56
- log .debug (String .format ("functionName: %s \t param1: %s \t param2: %s \t param3: %s param4: %s \t param5: %s%n"
54
+ public void functionCalled (String functionName , Object param1 , Object param2 ,
55
+ Object param3 , Object param4 , Object param5 ) {
56
+ log .debug (String .format ("function: %s \t param1: %s \t param2: %s " +
57
+ "\t param3: %s param4: %s \t param5: %s%n"
57
58
, functionName , param1 , param2 , param3 , param4 , param5 ));
58
59
try {
59
60
//get target class of Leaflet layer in JL Application
@@ -80,21 +81,42 @@ public void functionCalled(String functionName, Object param1, Object param2, Ob
80
81
return ;
81
82
82
83
//call listener and exit loop
83
- if (callListenerOnObject (functionName , (JLObject <JLObject <?>>) jlObject , param1 , param2 , param3 , param4 , param5 ))
84
+ if (callListenerOnObject (functionName ,
85
+ (JLObject <JLObject <?>>) jlObject , param1 ,
86
+ param2 , param3 , param4 , param5 ))
84
87
return ;
85
88
}
86
89
}
87
- } else if (param1 .equals ("main_map" ) && mapView .getMapListener ().isPresent ()) {
90
+ } else if (param1 .equals ("main_map" )
91
+ && mapView .getMapListener ().isPresent ()) {
88
92
switch (functionName ) {
89
- case "move" -> mapView .getMapListener ().get ().onAction (new MoveEvent (OnJLMapViewListener .Action .MOVE , gson .fromJson (String .valueOf (param4 ), JLLatLng .class ),
90
- gson .fromJson (String .valueOf (param5 ), JLBounds .class ), Integer .parseInt (String .valueOf (param3 ))));
91
- case "movestart" -> mapView .getMapListener ().get ().onAction (new MoveEvent (OnJLMapViewListener .Action .MOVE_START , gson .fromJson (String .valueOf (param4 ), JLLatLng .class ),
92
- gson .fromJson (String .valueOf (param5 ), JLBounds .class ), Integer .parseInt (String .valueOf (param3 ))));
93
- case "moveend" -> mapView .getMapListener ().get ().onAction (new MoveEvent (OnJLMapViewListener .Action .MOVE_END , gson .fromJson (String .valueOf (param4 ), JLLatLng .class ),
94
- gson .fromJson (String .valueOf (param5 ), JLBounds .class ), Integer .parseInt (String .valueOf (param3 ))));
95
- case "click" -> mapView .getMapListener ().get ().onAction (new ClickEvent (gson .fromJson (String .valueOf (param3 ), JLLatLng .class )));
96
-
97
- case "zoom" -> mapView .getMapListener ().get ().onAction (new ZoomEvent (OnJLMapViewListener .Action .ZOOM , Integer .parseInt (String .valueOf (param3 ))));
93
+ case "move" -> mapView .getMapListener ()
94
+ .get ()
95
+ .onAction (new MoveEvent (OnJLMapViewListener .Action .MOVE ,
96
+ gson .fromJson (String .valueOf (param4 ), JLLatLng .class ),
97
+ gson .fromJson (String .valueOf (param5 ), JLBounds .class ),
98
+ Integer .parseInt (String .valueOf (param3 ))));
99
+ case "movestart" -> mapView .getMapListener ()
100
+ .get ()
101
+ .onAction (new MoveEvent (OnJLMapViewListener .Action .MOVE_START ,
102
+ gson .fromJson (String .valueOf (param4 ), JLLatLng .class ),
103
+ gson .fromJson (String .valueOf (param5 ), JLBounds .class ),
104
+ Integer .parseInt (String .valueOf (param3 ))));
105
+ case "moveend" -> mapView .getMapListener ()
106
+ .get ()
107
+ .onAction (new MoveEvent (OnJLMapViewListener .Action .MOVE_END ,
108
+ gson .fromJson (String .valueOf (param4 ), JLLatLng .class ),
109
+ gson .fromJson (String .valueOf (param5 ), JLBounds .class ),
110
+ Integer .parseInt (String .valueOf (param3 ))));
111
+ case "click" -> mapView .getMapListener ()
112
+ .get ()
113
+ .onAction (new ClickEvent (gson .fromJson (String .valueOf (param3 ),
114
+ JLLatLng .class )));
115
+
116
+ case "zoom" -> mapView .getMapListener ()
117
+ .get ()
118
+ .onAction (new ZoomEvent (OnJLMapViewListener .Action .ZOOM ,
119
+ Integer .parseInt (String .valueOf (param3 ))));
98
120
default -> log .error (functionName + " not implemented!" );
99
121
}
100
122
}
@@ -103,7 +125,8 @@ public void functionCalled(String functionName, Object param1, Object param2, Ob
103
125
}
104
126
}
105
127
106
- private boolean callListenerOnObject (String functionName , JLObject <JLObject <?>> jlObject , Object ... params ) {
128
+ private boolean callListenerOnObject (
129
+ String functionName , JLObject <JLObject <?>> jlObject , Object ... params ) {
107
130
switch (functionName ) {
108
131
case "move" -> {
109
132
jlObject .getOnActionListener ()
0 commit comments