26
26
27
27
public class AirMapManager extends ViewGroupManager <AirMapView > {
28
28
29
- public static final String REACT_CLASS = "AIRMap" ;
30
-
31
- public static final int ANIMATE_TO_REGION = 1 ;
32
- public static final int ANIMATE_TO_COORDINATE = 2 ;
33
- public static final int FIT_TO_ELEMENTS = 3 ;
29
+ private static final String REACT_CLASS = "AIRMap" ;
30
+ private static final int ANIMATE_TO_REGION = 1 ;
31
+ private static final int ANIMATE_TO_COORDINATE = 2 ;
32
+ private static final int FIT_TO_ELEMENTS = 3 ;
34
33
35
34
private final Map <String , Integer > MAP_TYPES = MapBuilder .of (
36
35
"standard" , GoogleMap .MAP_TYPE_NORMAL ,
@@ -41,23 +40,10 @@ public class AirMapManager extends ViewGroupManager<AirMapView> {
41
40
42
41
private ReactContext reactContext ;
43
42
44
- private Context appContext ;
45
- private AirMapMarkerManager markerManager ;
46
- private AirMapPolylineManager polylineManager ;
47
- private AirMapPolygonManager polygonManager ;
48
- private AirMapCircleManager circleManager ;
49
-
50
- public AirMapManager (
51
- Context context ,
52
- AirMapMarkerManager markerManager ,
53
- AirMapPolylineManager polylineManager ,
54
- AirMapPolygonManager polygonManager ,
55
- AirMapCircleManager circleManager ) {
43
+ private final Context appContext ;
44
+
45
+ public AirMapManager (Context context ) {
56
46
this .appContext = context ;
57
- this .markerManager = markerManager ;
58
- this .polylineManager = polylineManager ;
59
- this .polygonManager = polygonManager ;
60
- this .circleManager = circleManager ;
61
47
}
62
48
63
49
@ Override
@@ -71,13 +57,12 @@ protected AirMapView createViewInstance(ThemedReactContext context) {
71
57
72
58
try {
73
59
MapsInitializer .initialize (this .appContext );
74
- } catch (Exception e ) {
60
+ } catch (RuntimeException e ) {
75
61
e .printStackTrace ();
76
62
emitMapError ("Map initialize error" , "map_init_error" );
77
63
}
78
- AirMapView view = new AirMapView (context , this .appContext , this );
79
64
80
- return view ;
65
+ return new AirMapView ( context , this . appContext , this ) ;
81
66
}
82
67
83
68
@ Override
@@ -224,7 +209,7 @@ public void receiveCommand(AirMapView view, int commandId, @Nullable ReadableArr
224
209
@ Override
225
210
@ Nullable
226
211
public Map getExportedCustomDirectEventTypeConstants () {
227
- Map map = MapBuilder .of (
212
+ Map < String , Map < String , String >> map = MapBuilder .of (
228
213
"onMapReady" , MapBuilder .of ("registrationName" , "onMapReady" ),
229
214
"onPress" , MapBuilder .of ("registrationName" , "onPress" ),
230
215
"onLongPress" , MapBuilder .of ("registrationName" , "onLongPress" ),
@@ -286,7 +271,7 @@ public void updateExtraData(AirMapView view, Object extraData) {
286
271
view .updateExtraData (extraData );
287
272
}
288
273
289
- public void pushEvent (View view , String name , WritableMap data ) {
274
+ void pushEvent (View view , String name , WritableMap data ) {
290
275
reactContext .getJSModule (RCTEventEmitter .class )
291
276
.receiveEvent (view .getId (), name , data );
292
277
}
0 commit comments