react-native-maps 2.0.0-beta.4 → 2.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -5
- package/android/src/main/java/com/rnmaps/maps/MapCalloutManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapCircleManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapGradientPolyline.java +4 -4
- package/android/src/main/java/com/rnmaps/maps/MapGradientPolylineManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapHeatmapManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapLiteManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapLocalTile.java +4 -4
- package/android/src/main/java/com/rnmaps/maps/MapLocalTileManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +2 -2
- package/android/src/main/java/com/rnmaps/maps/MapMarkerManager.java +10 -27
- package/android/src/main/java/com/rnmaps/maps/MapOverlayManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapPolygonManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapPolylineManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapTileProvider.java +4 -4
- package/android/src/main/java/com/rnmaps/maps/MapUrlTileManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapView.java +9 -9
- package/android/src/main/java/com/rnmaps/maps/{MapModule.java → MapViewModule.java} +18 -18
- package/android/src/main/java/com/rnmaps/maps/MapWMSTile.java +6 -6
- package/android/src/main/java/com/rnmaps/maps/MapWMSTileManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapsPackage.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/SizeReportingShadowNode.java +1 -1
- package/ios/{AirGoogleMaps/AIRDummyView.h → GoogleMaps/RNMDummyView.h} +3 -3
- package/ios/{AirGoogleMaps/AIRDummyView.m → GoogleMaps/RNMDummyView.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGMSMarker.h → GoogleMaps/RNMGMSMarker.h} +6 -6
- package/ios/{AirGoogleMaps/AIRGMSMarker.m → GoogleMaps/RNMGMSMarker.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGMSPolygon.h → GoogleMaps/RNMGMSPolygon.h} +4 -4
- package/ios/{AirGoogleMaps/AIRGMSPolygon.m → GoogleMaps/RNMGMSPolygon.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGMSPolyline.h → GoogleMaps/RNMGMSPolyline.h} +4 -4
- package/ios/{AirGoogleMaps/AIRGMSPolyline.m → GoogleMaps/RNMGMSPolyline.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGoogleMap.h → GoogleMaps/RNMGoogleMap.h} +5 -5
- package/ios/{AirGoogleMaps/AIRGoogleMap.m → GoogleMaps/RNMGoogleMap.m} +77 -77
- package/ios/{AirGoogleMaps/AIRGoogleMapCallout.h → GoogleMaps/RNMGoogleMapCallout.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapCallout.m → GoogleMaps/RNMGoogleMapCallout.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGoogleMapCalloutManager.h → GoogleMaps/RNMGoogleMapCalloutManager.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapCalloutManager.m → GoogleMaps/RNMGoogleMapCalloutManager.m} +7 -7
- package/ios/{AirGoogleMaps/AIRGoogleMapCalloutSubview.h → GoogleMaps/RNMGoogleMapCalloutSubview.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapCalloutSubview.m → GoogleMaps/RNMGoogleMapCalloutSubview.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGoogleMapCalloutSubviewManager.h → GoogleMaps/RNMGoogleMapCalloutSubviewManager.h} +3 -3
- package/ios/GoogleMaps/RNMGoogleMapCalloutSubviewManager.m +28 -0
- package/ios/{AirGoogleMaps/AIRGoogleMapCircle.h → GoogleMaps/RNMGoogleMapCircle.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapCircle.m → GoogleMaps/RNMGoogleMapCircle.m} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapCircleManager.h → GoogleMaps/RNMGoogleMapCircleManager.h} +2 -2
- package/ios/{AirGoogleMaps/AIRGoogleMapCircleManager.m → GoogleMaps/RNMGoogleMapCircleManager.m} +7 -7
- package/ios/{AirGoogleMaps/AIRGoogleMapHeatmap.h → GoogleMaps/RNMGoogleMapHeatmap.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapHeatmap.m → GoogleMaps/RNMGoogleMapHeatmap.m} +4 -4
- package/ios/GoogleMaps/RNMGoogleMapHeatmapManager.h +11 -0
- package/ios/{AirGoogleMaps/AIRGoogleMapHeatmapManager.m → GoogleMaps/RNMGoogleMapHeatmapManager.m} +9 -9
- package/ios/{AirGoogleMaps/AIRGoogleMapManager.h → GoogleMaps/RNMGoogleMapManager.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapManager.m → GoogleMaps/RNMGoogleMapManager.m} +63 -229
- package/ios/{AirGoogleMaps/AIRGoogleMapMarker.h → GoogleMaps/RNMGoogleMapMarker.h} +15 -15
- package/ios/{AirGoogleMaps/AIRGoogleMapMarker.m → GoogleMaps/RNMGoogleMapMarker.m} +23 -23
- package/ios/{AirGoogleMaps/AIRGoogleMapMarkerManager.h → GoogleMaps/RNMGoogleMapMarkerManager.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapMarkerManager.m → GoogleMaps/RNMGoogleMapMarkerManager.m} +20 -20
- package/ios/{AirGoogleMaps/AIRGoogleMapOverlay.h → GoogleMaps/RNMGoogleMapOverlay.h} +4 -4
- package/ios/{AirGoogleMaps/AIRGoogleMapOverlay.m → GoogleMaps/RNMGoogleMapOverlay.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGoogleMapOverlayManager.h → GoogleMaps/RNMGoogleMapOverlayManager.h} +2 -2
- package/ios/{AirGoogleMaps/AIRGoogleMapOverlayManager.m → GoogleMaps/RNMGoogleMapOverlayManager.m} +6 -6
- package/ios/{AirGoogleMaps/AIRGoogleMapPolygon.h → GoogleMaps/RNMGoogleMapPolygon.h} +7 -7
- package/ios/{AirGoogleMaps/AIRGoogleMapPolygon.m → GoogleMaps/RNMGoogleMapPolygon.m} +7 -7
- package/ios/{AirGoogleMaps/AIRGoogleMapPolylineManager.h → GoogleMaps/RNMGoogleMapPolygonManager.h} +2 -2
- package/ios/{AirGoogleMaps/AIRGoogleMapPolygonManager.m → GoogleMaps/RNMGoogleMapPolygonManager.m} +10 -10
- package/ios/{AirGoogleMaps/AIRGoogleMapPolyline.h → GoogleMaps/RNMGoogleMapPolyline.h} +7 -7
- package/ios/{AirGoogleMaps/AIRGoogleMapPolyline.m → GoogleMaps/RNMGoogleMapPolyline.m} +9 -9
- package/ios/{AirGoogleMaps/AIRGoogleMapPolygonManager.h → GoogleMaps/RNMGoogleMapPolylineManager.h} +2 -2
- package/ios/{AirGoogleMaps/AIRGoogleMapPolylineManager.m → GoogleMaps/RNMGoogleMapPolylineManager.m} +9 -9
- package/ios/{AirGoogleMaps/AIRGoogleMapUrlTile.h → GoogleMaps/RNMGoogleMapUrlTile.h} +2 -2
- package/ios/{AirGoogleMaps/AIRGoogleMapUrlTile.m → GoogleMaps/RNMGoogleMapUrlTile.m} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapUrlTileManager.h → GoogleMaps/RNMGoogleMapUrlTileManager.h} +2 -2
- package/ios/{AirGoogleMaps/AIRGoogleMapURLTileManager.m → GoogleMaps/RNMGoogleMapUrlTileManager.m} +7 -7
- package/ios/GoogleMaps/RNMGoogleMapViewModule.h +5 -0
- package/ios/GoogleMaps/RNMGoogleMapViewModule.m +183 -0
- package/ios/{AirGoogleMaps/AIRGoogleMapWMSTile.h → GoogleMaps/RNMGoogleMapWMSTile.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapWMSTile.m → GoogleMaps/RNMGoogleMapWMSTile.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGoogleMapWMSTileManager.h → GoogleMaps/RNMGoogleMapWMSTileManager.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapWMSTileManager.m → GoogleMaps/RNMGoogleMapWMSTileManager.m} +8 -8
- package/ios/{AirMaps → Maps}/Callout/SMCalloutView.h +4 -4
- package/ios/{AirMaps/RCTConvert+AirMap.h → Maps/RCTConvert+RNMMap.h} +1 -1
- package/ios/{AirMaps/RCTConvert+AirMap.m → Maps/RCTConvert+RNMMap.m} +8 -8
- package/ios/{AirMaps/AIRMap.h → Maps/RNMMap.h} +8 -8
- package/ios/{AirMaps/AIRMap.m → Maps/RNMMap.m} +56 -56
- package/ios/{AirMaps/AIRMapCallout.h → Maps/RNMMapCallout.h} +1 -1
- package/ios/{AirMaps/AIRMapCallout.m → Maps/RNMMapCallout.m} +2 -2
- package/ios/{AirMaps/AIRMapCircleManager.h → Maps/RNMMapCalloutManager.h} +2 -2
- package/ios/{AirMaps/AIRMapCalloutManager.m → Maps/RNMMapCalloutManager.m} +7 -7
- package/ios/{AirMaps/AIRMapCalloutSubview.h → Maps/RNMMapCalloutSubview.h} +3 -3
- package/ios/{AirMaps/AIRMapCalloutSubview.m → Maps/RNMMapCalloutSubview.m} +4 -4
- package/ios/Maps/RNMMapCalloutSubviewManager.h +14 -0
- package/ios/Maps/RNMMapCalloutSubviewManager.m +24 -0
- package/ios/{AirMaps/AIRMapCircle.h → Maps/RNMMapCircle.h} +5 -5
- package/ios/{AirMaps/AIRMapCircle.m → Maps/RNMMapCircle.m} +3 -3
- package/ios/{AirMaps/AIRMapCalloutManager.h → Maps/RNMMapCircleManager.h} +2 -2
- package/ios/{AirMaps/AIRMapCircleManager.m → Maps/RNMMapCircleManager.m} +7 -7
- package/ios/{AirMaps/AIRMapCoordinate.h → Maps/RNMMapCoordinate.h} +2 -2
- package/ios/{AirMaps/AIRMapCoordinate.m → Maps/RNMMapCoordinate.m} +3 -3
- package/ios/{AirMaps/AIRMapLocalTile.h → Maps/RNMMapLocalTile.h} +7 -7
- package/ios/{AirMaps/AIRMapLocalTile.m → Maps/RNMMapLocalTile.m} +6 -6
- package/ios/{AirMaps/AIRMapLocalTileManager.h → Maps/RNMMapLocalTileManager.h} +3 -3
- package/ios/{AirMaps/AIRMapLocalTileManager.m → Maps/RNMMapLocalTileManager.m} +9 -9
- package/ios/{AirMaps/AIRMapLocalTileOverlay.h → Maps/RNMMapLocalTileOverlay.h} +2 -2
- package/ios/{AirMaps/AIRMapLocalTileOverlay.m → Maps/RNMMapLocalTileOverlay.m} +5 -5
- package/ios/{AirMaps/AIRMapManager.h → Maps/RNMMapManager.h} +6 -6
- package/ios/{AirMaps/AIRMapManager.m → Maps/RNMMapManager.m} +168 -445
- package/ios/{AirMaps/AIRMapMarker.h → Maps/RNMMapMarker.h} +8 -8
- package/ios/{AirMaps/AIRMapMarker.m → Maps/RNMMapMarker.m} +13 -13
- package/ios/{AirMaps/AIRMapMarkerManager.h → Maps/RNMMapMarkerManager.h} +1 -1
- package/ios/{AirMaps/AIRMapMarkerManager.m → Maps/RNMMapMarkerManager.m} +14 -14
- package/ios/{AirMaps/AIRMapOverlay.h → Maps/RNMMapOverlay.h} +7 -7
- package/ios/{AirMaps/AIRMapOverlay.m → Maps/RNMMapOverlay.m} +4 -4
- package/ios/Maps/RNMMapOverlayManager.h +5 -0
- package/ios/{AirMaps/AIRMapOverlayManager.m → Maps/RNMMapOverlayManager.m} +6 -6
- package/ios/{AirMaps/AIRMapOverlayRenderer.h → Maps/RNMMapOverlayRenderer.h} +1 -1
- package/ios/{AirMaps/AIRMapOverlayRenderer.m → Maps/RNMMapOverlayRenderer.m} +5 -5
- package/ios/{AirMaps/AIRMapPolygon.h → Maps/RNMMapPolygon.h} +7 -7
- package/ios/{AirMaps/AIRMapPolygon.m → Maps/RNMMapPolygon.m} +4 -4
- package/ios/{AirMaps/AIRMapPolygonManager.h → Maps/RNMMapPolygonManager.h} +2 -2
- package/ios/{AirMaps/AIRMapPolygonManager.m → Maps/RNMMapPolygonManager.m} +10 -10
- package/ios/{AirMaps/AIRMapPolyline.h → Maps/RNMMapPolyline.h} +6 -6
- package/ios/{AirMaps/AIRMapPolyline.m → Maps/RNMMapPolyline.m} +11 -11
- package/ios/{AirMaps/AIRMapPolylineManager.h → Maps/RNMMapPolylineManager.h} +2 -2
- package/ios/{AirMaps/AIRMapPolylineManager.m → Maps/RNMMapPolylineManager.m} +9 -9
- package/ios/{AirMaps/AIRMapPolylineRenderer.h → Maps/RNMMapPolylineRenderer.h} +2 -2
- package/ios/{AirMaps/AIRMapPolylineRenderer.m → Maps/RNMMapPolylineRenderer.m} +10 -10
- package/ios/{AirMaps/AIRMapSnapshot.h → Maps/RNMMapSnapshot.h} +6 -6
- package/ios/{AirMaps/AIRMapUrlTile.h → Maps/RNMMapUrlTile.h} +18 -18
- package/ios/{AirMaps/AIRMapUrlTile.m → Maps/RNMMapUrlTile.m} +7 -7
- package/ios/{AirMaps/AIRMapUrlTileCachedOverlay.h → Maps/RNMMapUrlTileCachedOverlay.h} +3 -3
- package/ios/{AirMaps/AIRMapUrlTileCachedOverlay.m → Maps/RNMMapUrlTileCachedOverlay.m} +10 -10
- package/ios/{AirMaps/AIRMapUrlTileManager.h → Maps/RNMMapUrlTileManager.h} +3 -3
- package/ios/{AirMaps/AIRMapUrlTileManager.m → Maps/RNMMapUrlTileManager.m} +9 -9
- package/ios/Maps/RNMMapViewModule.h +5 -0
- package/ios/Maps/RNMMapViewModule.m +297 -0
- package/ios/{AirMaps/AIRMapWMSTile.h → Maps/RNMMapWMSTile.h} +11 -11
- package/ios/{AirMaps/AIRMapWMSTile.m → Maps/RNMMapWMSTile.m} +15 -15
- package/ios/{AirMaps/AIRMapWMSTileManager.h → Maps/RNMMapWMSTileManager.h} +3 -3
- package/ios/{AirMaps/AIRMapWMSTileManager.m → Maps/RNMMapWMSTileManager.m} +9 -9
- package/ios/RNMaps.xcodeproj/project.pbxproj +647 -0
- package/lib/Geojson.d.ts +1 -1
- package/lib/MapCallout.js +2 -2
- package/lib/MapCalloutSubview.js +2 -2
- package/lib/MapCircle.js +2 -2
- package/lib/MapHeatmap.js +2 -2
- package/lib/MapLocalTile.js +2 -2
- package/lib/MapMarker.d.ts +2 -3
- package/lib/MapMarker.js +2 -4
- package/lib/MapOverlay.d.ts +1 -2
- package/lib/MapOverlay.js +2 -4
- package/lib/MapPolygon.js +2 -2
- package/lib/MapPolyline.js +2 -2
- package/lib/MapUrlTile.js +2 -2
- package/lib/MapView.d.ts +4 -9
- package/lib/MapView.js +74 -90
- package/lib/MapView.types.d.ts +7 -1
- package/lib/MapWMSTile.js +2 -2
- package/lib/NativeGoogleMapViewModule.d.ts +20 -0
- package/lib/NativeGoogleMapViewModule.js +4 -0
- package/lib/NativeMapViewModule.d.ts +24 -0
- package/lib/NativeMapViewModule.js +4 -0
- package/lib/decorateMapComponent.d.ts +1 -1
- package/lib/decorateMapComponent.js +3 -3
- package/lib/index.d.ts +14 -21
- package/lib/index.js +10 -38
- package/package.json +1 -1
- package/react-native-google-maps.podspec +1 -1
- package/react-native-maps.podspec +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapCalloutSubviewManager.m +0 -28
- package/ios/AirGoogleMaps/AIRGoogleMapHeatmapManager.h +0 -11
- package/ios/AirMaps/AIRMapCalloutSubviewManager.h +0 -14
- package/ios/AirMaps/AIRMapCalloutSubviewManager.m +0 -24
- package/ios/AirMaps/AIRMapOverlayManager.h +0 -5
- package/ios/AirMaps/AIRWeakMapReference.h +0 -24
- package/ios/AirMaps/AIRWeakMapReference.m +0 -23
- package/ios/AirMaps/AIRWeakTimerReference.h +0 -21
- package/ios/AirMaps/AIRWeakTimerReference.m +0 -42
- package/ios/AirMaps.xcodeproj/project.pbxproj +0 -587
- /package/ios/{AirGoogleMaps → GoogleMaps}/RCTConvert+GMSMapViewType.h +0 -0
- /package/ios/{AirGoogleMaps → GoogleMaps}/RCTConvert+GMSMapViewType.m +0 -0
- /package/ios/{AirMaps → Maps}/Callout/SMCalloutView.m +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGoogleMapManager.m
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gil Birman on 9/1/16.
|
|
6
6
|
//
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
#ifdef HAVE_GOOGLE_MAPS
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
#import "
|
|
11
|
+
#import "RNMGoogleMapManager.h"
|
|
12
12
|
#import <React/RCTViewManager.h>
|
|
13
13
|
#import <React/RCTBridge.h>
|
|
14
14
|
#import <React/RCTUIManager.h>
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
#import <React/RCTConvert.h>
|
|
19
19
|
#import <React/UIView+React.h>
|
|
20
20
|
#import "RCTConvert+GMSMapViewType.h"
|
|
21
|
-
#import "
|
|
22
|
-
#import "
|
|
23
|
-
#import "
|
|
24
|
-
#import "
|
|
25
|
-
#import "
|
|
21
|
+
#import "RNMGoogleMap.h"
|
|
22
|
+
#import "RNMMapMarker.h"
|
|
23
|
+
#import "RNMMapPolyline.h"
|
|
24
|
+
#import "RNMMapPolygon.h"
|
|
25
|
+
#import "RNMMapCircle.h"
|
|
26
26
|
#import "SMCalloutView.h"
|
|
27
|
-
#import "
|
|
28
|
-
#import "RCTConvert+
|
|
27
|
+
#import "RNMGoogleMapMarker.h"
|
|
28
|
+
#import "RCTConvert+RNMMap.h"
|
|
29
29
|
|
|
30
30
|
#import <MapKit/MapKit.h>
|
|
31
31
|
#import <QuartzCore/QuartzCore.h>
|
|
@@ -33,21 +33,21 @@
|
|
|
33
33
|
static NSString *const RCTMapViewKey = @"MapView";
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
@interface
|
|
36
|
+
@interface RNMGoogleMapManager() <GMSMapViewDelegate>
|
|
37
37
|
{
|
|
38
38
|
BOOL didCallOnMapReady;
|
|
39
39
|
}
|
|
40
40
|
@end
|
|
41
41
|
|
|
42
|
-
@implementation
|
|
42
|
+
@implementation RNMGoogleMapManager
|
|
43
43
|
|
|
44
|
-
RCT_EXPORT_MODULE()
|
|
44
|
+
RCT_EXPORT_MODULE(RNMGoogleMap)
|
|
45
45
|
|
|
46
46
|
- (UIView *)view
|
|
47
47
|
{
|
|
48
48
|
[GMSServices setMetalRendererEnabled:YES];
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
RNMGoogleMap *map = [RNMGoogleMap new];
|
|
51
51
|
map.bridge = self.bridge;
|
|
52
52
|
map.delegate = self;
|
|
53
53
|
map.isAccessibilityElement = NO;
|
|
@@ -107,38 +107,15 @@ RCT_EXPORT_VIEW_PROPERTY(minZoomLevel, CGFloat)
|
|
|
107
107
|
RCT_EXPORT_VIEW_PROPERTY(maxZoomLevel, CGFloat)
|
|
108
108
|
RCT_EXPORT_VIEW_PROPERTY(kmlSrc, NSString)
|
|
109
109
|
|
|
110
|
-
RCT_EXPORT_METHOD(getCamera:(nonnull NSNumber *)reactTag
|
|
111
|
-
resolver: (RCTPromiseResolveBlock)resolve
|
|
112
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
113
|
-
{
|
|
114
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
115
|
-
id view = viewRegistry[reactTag];
|
|
116
|
-
if (![view isKindOfClass:[AIRGoogleMap class]]) {
|
|
117
|
-
reject(@"Invalid argument", [NSString stringWithFormat:@"Invalid view returned from registry, expecting AIRGoogleMap, got: %@", view], NULL);
|
|
118
|
-
} else {
|
|
119
|
-
AIRGoogleMap *mapView = (AIRGoogleMap *)view;
|
|
120
|
-
resolve(@{
|
|
121
|
-
@"center": @{
|
|
122
|
-
@"latitude": @(mapView.camera.target.latitude),
|
|
123
|
-
@"longitude": @(mapView.camera.target.longitude),
|
|
124
|
-
},
|
|
125
|
-
@"pitch": @(mapView.camera.viewingAngle),
|
|
126
|
-
@"heading": @(mapView.camera.bearing),
|
|
127
|
-
@"zoom": @(mapView.camera.zoom),
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}];
|
|
131
|
-
}
|
|
132
|
-
|
|
133
110
|
RCT_EXPORT_METHOD(setCamera:(nonnull NSNumber *)reactTag
|
|
134
111
|
camera:(id)json)
|
|
135
112
|
{
|
|
136
113
|
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
137
114
|
id view = viewRegistry[reactTag];
|
|
138
|
-
if (![view isKindOfClass:[
|
|
139
|
-
RCTLogError(@"Invalid view returned from registry, expecting
|
|
115
|
+
if (![view isKindOfClass:[RNMGoogleMap class]]) {
|
|
116
|
+
RCTLogError(@"Invalid view returned from registry, expecting RNMGoogleMap, got: %@", view);
|
|
140
117
|
} else {
|
|
141
|
-
|
|
118
|
+
RNMGoogleMap *mapView = (RNMGoogleMap *)view;
|
|
142
119
|
GMSCameraPosition *camera = [RCTConvert GMSCameraPositionWithDefaults:json existingCamera:[mapView camera]];
|
|
143
120
|
[mapView setCamera:camera];
|
|
144
121
|
}
|
|
@@ -152,12 +129,12 @@ RCT_EXPORT_METHOD(animateCamera:(nonnull NSNumber *)reactTag
|
|
|
152
129
|
{
|
|
153
130
|
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
154
131
|
id view = viewRegistry[reactTag];
|
|
155
|
-
if (![view isKindOfClass:[
|
|
156
|
-
RCTLogError(@"Invalid view returned from registry, expecting
|
|
132
|
+
if (![view isKindOfClass:[RNMGoogleMap class]]) {
|
|
133
|
+
RCTLogError(@"Invalid view returned from registry, expecting RNMGoogleMap, got: %@", view);
|
|
157
134
|
} else {
|
|
158
135
|
[CATransaction begin];
|
|
159
136
|
[CATransaction setAnimationDuration:duration/1000];
|
|
160
|
-
|
|
137
|
+
RNMGoogleMap *mapView = (RNMGoogleMap *)view;
|
|
161
138
|
GMSCameraPosition *camera = [RCTConvert GMSCameraPositionWithDefaults:json existingCamera:[mapView camera]];
|
|
162
139
|
[mapView animateToCameraPosition:camera];
|
|
163
140
|
[CATransaction commit];
|
|
@@ -171,15 +148,15 @@ RCT_EXPORT_METHOD(animateToRegion:(nonnull NSNumber *)reactTag
|
|
|
171
148
|
{
|
|
172
149
|
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
173
150
|
id view = viewRegistry[reactTag];
|
|
174
|
-
if (![view isKindOfClass:[
|
|
175
|
-
RCTLogError(@"Invalid view returned from registry, expecting
|
|
151
|
+
if (![view isKindOfClass:[RNMGoogleMap class]]) {
|
|
152
|
+
RCTLogError(@"Invalid view returned from registry, expecting RNMGoogleMap, got: %@", view);
|
|
176
153
|
} else {
|
|
177
154
|
// Core Animation must be used to control the animation's duration
|
|
178
155
|
// See http://stackoverflow.com/a/15663039/171744
|
|
179
156
|
[CATransaction begin];
|
|
180
157
|
[CATransaction setAnimationDuration:duration/1000];
|
|
181
|
-
|
|
182
|
-
GMSCameraPosition *camera = [
|
|
158
|
+
RNMGoogleMap *mapView = (RNMGoogleMap *)view;
|
|
159
|
+
GMSCameraPosition *camera = [RNMGoogleMap makeGMSCameraPositionFromMap:mapView andMKCoordinateRegion:region];
|
|
183
160
|
[mapView animateToCameraPosition:camera];
|
|
184
161
|
[CATransaction commit];
|
|
185
162
|
}
|
|
@@ -192,15 +169,15 @@ RCT_EXPORT_METHOD(fitToElements:(nonnull NSNumber *)reactTag
|
|
|
192
169
|
{
|
|
193
170
|
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
194
171
|
id view = viewRegistry[reactTag];
|
|
195
|
-
if (![view isKindOfClass:[
|
|
196
|
-
RCTLogError(@"Invalid view returned from registry, expecting
|
|
172
|
+
if (![view isKindOfClass:[RNMGoogleMap class]]) {
|
|
173
|
+
RCTLogError(@"Invalid view returned from registry, expecting RNMGoogleMap, got: %@", view);
|
|
197
174
|
} else {
|
|
198
|
-
|
|
175
|
+
RNMGoogleMap *mapView = (RNMGoogleMap *)view;
|
|
199
176
|
|
|
200
|
-
CLLocationCoordinate2D myLocation = ((
|
|
177
|
+
CLLocationCoordinate2D myLocation = ((RNMGoogleMapMarker *)(mapView.markers.firstObject)).realMarker.position;
|
|
201
178
|
GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithCoordinate:myLocation coordinate:myLocation];
|
|
202
179
|
|
|
203
|
-
for (
|
|
180
|
+
for (RNMGoogleMapMarker *marker in mapView.markers)
|
|
204
181
|
bounds = [bounds includingCoordinate:marker.realMarker.position];
|
|
205
182
|
|
|
206
183
|
GMSCameraUpdate* cameraUpdate;
|
|
@@ -232,22 +209,22 @@ RCT_EXPORT_METHOD(fitToSuppliedMarkers:(nonnull NSNumber *)reactTag
|
|
|
232
209
|
{
|
|
233
210
|
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
234
211
|
id view = viewRegistry[reactTag];
|
|
235
|
-
if (![view isKindOfClass:[
|
|
236
|
-
RCTLogError(@"Invalid view returned from registry, expecting
|
|
212
|
+
if (![view isKindOfClass:[RNMGoogleMap class]]) {
|
|
213
|
+
RCTLogError(@"Invalid view returned from registry, expecting RNMGoogleMap, got: %@", view);
|
|
237
214
|
} else {
|
|
238
|
-
|
|
215
|
+
RNMGoogleMap *mapView = (RNMGoogleMap *)view;
|
|
239
216
|
|
|
240
217
|
NSPredicate *filterMarkers = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
|
|
241
|
-
|
|
242
|
-
return [marker isKindOfClass:[
|
|
218
|
+
RNMGoogleMapMarker *marker = (RNMGoogleMapMarker *)evaluatedObject;
|
|
219
|
+
return [marker isKindOfClass:[RNMGoogleMapMarker class]] && [markers containsObject:marker.identifier];
|
|
243
220
|
}];
|
|
244
221
|
|
|
245
222
|
NSArray *filteredMarkers = [mapView.markers filteredArrayUsingPredicate:filterMarkers];
|
|
246
223
|
|
|
247
|
-
CLLocationCoordinate2D myLocation = ((
|
|
224
|
+
CLLocationCoordinate2D myLocation = ((RNMGoogleMapMarker *)(filteredMarkers.firstObject)).realMarker.position;
|
|
248
225
|
GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithCoordinate:myLocation coordinate:myLocation];
|
|
249
226
|
|
|
250
|
-
for (
|
|
227
|
+
for (RNMGoogleMapMarker *marker in filteredMarkers)
|
|
251
228
|
bounds = [bounds includingCoordinate:marker.realMarker.position];
|
|
252
229
|
|
|
253
230
|
// Set Map viewport
|
|
@@ -268,21 +245,21 @@ RCT_EXPORT_METHOD(fitToSuppliedMarkers:(nonnull NSNumber *)reactTag
|
|
|
268
245
|
}
|
|
269
246
|
|
|
270
247
|
RCT_EXPORT_METHOD(fitToCoordinates:(nonnull NSNumber *)reactTag
|
|
271
|
-
coordinates:(nonnull NSArray<
|
|
248
|
+
coordinates:(nonnull NSArray<RNMMapCoordinate *> *)coordinates
|
|
272
249
|
edgePadding:(nonnull NSDictionary *)edgePadding
|
|
273
250
|
animated:(BOOL)animated)
|
|
274
251
|
{
|
|
275
252
|
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
276
253
|
id view = viewRegistry[reactTag];
|
|
277
|
-
if (![view isKindOfClass:[
|
|
278
|
-
RCTLogError(@"Invalid view returned from registry, expecting
|
|
254
|
+
if (![view isKindOfClass:[RNMGoogleMap class]]) {
|
|
255
|
+
RCTLogError(@"Invalid view returned from registry, expecting RNMGoogleMap, got: %@", view);
|
|
279
256
|
} else {
|
|
280
|
-
|
|
257
|
+
RNMGoogleMap *mapView = (RNMGoogleMap *)view;
|
|
281
258
|
|
|
282
259
|
CLLocationCoordinate2D myLocation = coordinates.firstObject.coordinate;
|
|
283
260
|
GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithCoordinate:myLocation coordinate:myLocation];
|
|
284
261
|
|
|
285
|
-
for (
|
|
262
|
+
for (RNMMapCoordinate *coordinate in coordinates)
|
|
286
263
|
bounds = [bounds includingCoordinate:coordinate.coordinate];
|
|
287
264
|
|
|
288
265
|
// Set Map viewport
|
|
@@ -302,159 +279,16 @@ RCT_EXPORT_METHOD(fitToCoordinates:(nonnull NSNumber *)reactTag
|
|
|
302
279
|
}];
|
|
303
280
|
}
|
|
304
281
|
|
|
305
|
-
RCT_EXPORT_METHOD(takeSnapshot:(nonnull NSNumber *)reactTag
|
|
306
|
-
withWidth:(nonnull NSNumber *)width
|
|
307
|
-
withHeight:(nonnull NSNumber *)height
|
|
308
|
-
withRegion:(MKCoordinateRegion)region
|
|
309
|
-
format:(nonnull NSString *)format
|
|
310
|
-
quality:(nonnull NSNumber *)quality
|
|
311
|
-
result:(nonnull NSString *)result
|
|
312
|
-
withCallback:(RCTResponseSenderBlock)callback)
|
|
313
|
-
{
|
|
314
|
-
NSTimeInterval timeStamp = [[NSDate date] timeIntervalSince1970];
|
|
315
|
-
NSString *pathComponent = [NSString stringWithFormat:@"Documents/snapshot-%.20lf.%@", timeStamp, format];
|
|
316
|
-
NSString *filePath = [NSHomeDirectory() stringByAppendingPathComponent: pathComponent];
|
|
317
|
-
|
|
318
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
319
|
-
id view = viewRegistry[reactTag];
|
|
320
|
-
if (![view isKindOfClass:[AIRGoogleMap class]]) {
|
|
321
|
-
RCTLogError(@"Invalid view returned from registry, expecting AIRMap, got: %@", view);
|
|
322
|
-
} else {
|
|
323
|
-
AIRGoogleMap *mapView = (AIRGoogleMap *)view;
|
|
324
|
-
|
|
325
|
-
// TODO: currently we are ignoring width, height, region
|
|
326
|
-
|
|
327
|
-
UIGraphicsBeginImageContextWithOptions(mapView.frame.size, YES, 0.0f);
|
|
328
|
-
[mapView.layer renderInContext:UIGraphicsGetCurrentContext()];
|
|
329
|
-
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
|
|
330
|
-
|
|
331
|
-
NSData *data;
|
|
332
|
-
if ([format isEqualToString:@"png"]) {
|
|
333
|
-
data = UIImagePNGRepresentation(image);
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
else if([format isEqualToString:@"jpg"]) {
|
|
337
|
-
data = UIImageJPEGRepresentation(image, quality.floatValue);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
if ([result isEqualToString:@"file"]) {
|
|
341
|
-
[data writeToFile:filePath atomically:YES];
|
|
342
|
-
callback(@[[NSNull null], filePath]);
|
|
343
|
-
}
|
|
344
|
-
else if ([result isEqualToString:@"base64"]) {
|
|
345
|
-
callback(@[[NSNull null], [data base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]]);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
UIGraphicsEndImageContext();
|
|
349
|
-
}];
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
RCT_EXPORT_METHOD(pointForCoordinate:(nonnull NSNumber *)reactTag
|
|
353
|
-
coordinate:(NSDictionary *)coordinate
|
|
354
|
-
resolver: (RCTPromiseResolveBlock)resolve
|
|
355
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
356
|
-
{
|
|
357
|
-
CLLocationCoordinate2D coord =
|
|
358
|
-
CLLocationCoordinate2DMake(
|
|
359
|
-
[coordinate[@"latitude"] doubleValue],
|
|
360
|
-
[coordinate[@"longitude"] doubleValue]
|
|
361
|
-
);
|
|
362
|
-
|
|
363
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
364
|
-
id view = viewRegistry[reactTag];
|
|
365
|
-
if (![view isKindOfClass:[AIRGoogleMap class]]) {
|
|
366
|
-
RCTLogError(@"Invalid view returned from registry, expecting AIRMap, got: %@", view);
|
|
367
|
-
} else {
|
|
368
|
-
AIRGoogleMap *mapView = (AIRGoogleMap *)view;
|
|
369
|
-
|
|
370
|
-
CGPoint touchPoint = [mapView.projection pointForCoordinate:coord];
|
|
371
|
-
|
|
372
|
-
resolve(@{
|
|
373
|
-
@"x": @(touchPoint.x),
|
|
374
|
-
@"y": @(touchPoint.y),
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
}];
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
RCT_EXPORT_METHOD(coordinateForPoint:(nonnull NSNumber *)reactTag
|
|
381
|
-
point:(NSDictionary *)point
|
|
382
|
-
resolver: (RCTPromiseResolveBlock)resolve
|
|
383
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
384
|
-
{
|
|
385
|
-
CGPoint pt = CGPointMake(
|
|
386
|
-
[point[@"x"] doubleValue],
|
|
387
|
-
[point[@"y"] doubleValue]
|
|
388
|
-
);
|
|
389
|
-
|
|
390
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
391
|
-
id view = viewRegistry[reactTag];
|
|
392
|
-
if (![view isKindOfClass:[AIRGoogleMap class]]) {
|
|
393
|
-
RCTLogError(@"Invalid view returned from registry, expecting AIRMap, got: %@", view);
|
|
394
|
-
} else {
|
|
395
|
-
AIRGoogleMap *mapView = (AIRGoogleMap *)view;
|
|
396
|
-
|
|
397
|
-
CLLocationCoordinate2D coordinate = [mapView.projection coordinateForPoint:pt];
|
|
398
|
-
|
|
399
|
-
resolve(@{
|
|
400
|
-
@"latitude": @(coordinate.latitude),
|
|
401
|
-
@"longitude": @(coordinate.longitude),
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
}];
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
RCT_EXPORT_METHOD(getMarkersFrames:(nonnull NSNumber *)reactTag
|
|
408
|
-
onlyVisible:(BOOL)onlyVisible
|
|
409
|
-
resolver: (RCTPromiseResolveBlock)resolve
|
|
410
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
411
|
-
{
|
|
412
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
413
|
-
id view = viewRegistry[reactTag];
|
|
414
|
-
if (![view isKindOfClass:[AIRGoogleMap class]]) {
|
|
415
|
-
RCTLogError(@"Invalid view returned from registry, expecting AIRMap, got: %@", view);
|
|
416
|
-
} else {
|
|
417
|
-
AIRGoogleMap *mapView = (AIRGoogleMap *)view;
|
|
418
|
-
resolve([mapView getMarkersFramesWithOnlyVisible:onlyVisible]);
|
|
419
|
-
}
|
|
420
|
-
}];
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
RCT_EXPORT_METHOD(getMapBoundaries:(nonnull NSNumber *)reactTag
|
|
424
|
-
resolver:(RCTPromiseResolveBlock)resolve
|
|
425
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
426
|
-
{
|
|
427
|
-
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
428
|
-
id view = viewRegistry[reactTag];
|
|
429
|
-
if (![view isKindOfClass:[AIRGoogleMap class]]) {
|
|
430
|
-
RCTLogError(@"Invalid view returned from registry, expecting AIRGoogleMap, got: %@", view);
|
|
431
|
-
} else {
|
|
432
|
-
NSArray *boundingBox = [view getMapBoundaries];
|
|
433
|
-
|
|
434
|
-
resolve(@{
|
|
435
|
-
@"northEast" : @{
|
|
436
|
-
@"longitude" : boundingBox[0][0],
|
|
437
|
-
@"latitude" : boundingBox[0][1]
|
|
438
|
-
},
|
|
439
|
-
@"southWest" : @{
|
|
440
|
-
@"longitude" : boundingBox[1][0],
|
|
441
|
-
@"latitude" : boundingBox[1][1]
|
|
442
|
-
}
|
|
443
|
-
});
|
|
444
|
-
}
|
|
445
|
-
}];
|
|
446
|
-
}
|
|
447
|
-
|
|
448
282
|
RCT_EXPORT_METHOD(setMapBoundaries:(nonnull NSNumber *)reactTag
|
|
449
283
|
northEast:(CLLocationCoordinate2D)northEast
|
|
450
284
|
southWest:(CLLocationCoordinate2D)southWest)
|
|
451
285
|
{
|
|
452
286
|
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
453
287
|
id view = viewRegistry[reactTag];
|
|
454
|
-
if (![view isKindOfClass:[
|
|
455
|
-
RCTLogError(@"Invalid view returned from registry, expecting
|
|
288
|
+
if (![view isKindOfClass:[RNMGoogleMap class]]) {
|
|
289
|
+
RCTLogError(@"Invalid view returned from registry, expecting RNMGoogleMap, got: %@", view);
|
|
456
290
|
} else {
|
|
457
|
-
|
|
291
|
+
RNMGoogleMap *mapView = (RNMGoogleMap *)view;
|
|
458
292
|
|
|
459
293
|
GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithCoordinate:northEast coordinate:southWest];
|
|
460
294
|
|
|
@@ -468,10 +302,10 @@ RCT_EXPORT_METHOD(setIndoorActiveLevelIndex:(nonnull NSNumber *)reactTag
|
|
|
468
302
|
{
|
|
469
303
|
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
470
304
|
id view = viewRegistry[reactTag];
|
|
471
|
-
if (![view isKindOfClass:[
|
|
472
|
-
RCTLogError(@"Invalid view returned from registry, expecting
|
|
305
|
+
if (![view isKindOfClass:[RNMGoogleMap class]]) {
|
|
306
|
+
RCTLogError(@"Invalid view returned from registry, expecting RNMGoogleMap, got: %@", view);
|
|
473
307
|
} else {
|
|
474
|
-
|
|
308
|
+
RNMGoogleMap *mapView = (RNMGoogleMap *)view;
|
|
475
309
|
if (!mapView.indoorDisplay) {
|
|
476
310
|
return;
|
|
477
311
|
}
|
|
@@ -495,71 +329,71 @@ RCT_EXPORT_METHOD(setIndoorActiveLevelIndex:(nonnull NSNumber *)reactTag
|
|
|
495
329
|
}
|
|
496
330
|
|
|
497
331
|
- (void)mapViewDidStartTileRendering:(GMSMapView *)mapView {
|
|
498
|
-
|
|
332
|
+
RNMGoogleMap *googleMapView = (RNMGoogleMap *)mapView;
|
|
499
333
|
[googleMapView didPrepareMap];
|
|
500
334
|
}
|
|
501
335
|
|
|
502
336
|
- (void)mapViewDidFinishTileRendering:(GMSMapView *)mapView {
|
|
503
|
-
|
|
337
|
+
RNMGoogleMap *googleMapView = (RNMGoogleMap *)mapView;
|
|
504
338
|
[googleMapView mapViewDidFinishTileRendering];
|
|
505
339
|
}
|
|
506
340
|
|
|
507
341
|
- (BOOL)mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)marker {
|
|
508
|
-
|
|
342
|
+
RNMGoogleMap *googleMapView = (RNMGoogleMap *)mapView;
|
|
509
343
|
return [googleMapView didTapMarker:marker];
|
|
510
344
|
}
|
|
511
345
|
|
|
512
346
|
- (void)mapView:(GMSMapView *)mapView didTapOverlay:(GMSPolygon *)polygon {
|
|
513
|
-
|
|
347
|
+
RNMGoogleMap *googleMapView = (RNMGoogleMap *)mapView;
|
|
514
348
|
[googleMapView didTapPolygon:polygon];
|
|
515
349
|
}
|
|
516
350
|
|
|
517
351
|
- (void)mapView:(GMSMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D)coordinate {
|
|
518
|
-
|
|
352
|
+
RNMGoogleMap *googleMapView = (RNMGoogleMap *)mapView;
|
|
519
353
|
[googleMapView didTapAtCoordinate:coordinate];
|
|
520
354
|
}
|
|
521
355
|
|
|
522
356
|
- (void)mapView:(GMSMapView *)mapView didLongPressAtCoordinate:(CLLocationCoordinate2D)coordinate {
|
|
523
|
-
|
|
357
|
+
RNMGoogleMap *googleMapView = (RNMGoogleMap *)mapView;
|
|
524
358
|
[googleMapView didLongPressAtCoordinate:coordinate];
|
|
525
359
|
}
|
|
526
360
|
|
|
527
361
|
- (void)mapView:(GMSMapView *)mapView didChangeCameraPosition:(GMSCameraPosition *)position {
|
|
528
|
-
|
|
362
|
+
RNMGoogleMap *googleMapView = (RNMGoogleMap *)mapView;
|
|
529
363
|
[googleMapView didChangeCameraPosition:position isGesture:self.isGesture];
|
|
530
364
|
}
|
|
531
365
|
|
|
532
366
|
- (void)mapView:(GMSMapView *)mapView idleAtCameraPosition:(GMSCameraPosition *)position {
|
|
533
|
-
|
|
367
|
+
RNMGoogleMap *googleMapView = (RNMGoogleMap *)mapView;
|
|
534
368
|
[googleMapView idleAtCameraPosition:position isGesture:self.isGesture];
|
|
535
369
|
}
|
|
536
370
|
|
|
537
371
|
- (UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker {
|
|
538
|
-
|
|
372
|
+
RNMGMSMarker *aMarker = (RNMGMSMarker *)marker;
|
|
539
373
|
return [aMarker.fakeMarker markerInfoWindow];}
|
|
540
374
|
|
|
541
375
|
- (UIView *)mapView:(GMSMapView *)mapView markerInfoContents:(GMSMarker *)marker {
|
|
542
|
-
|
|
376
|
+
RNMGMSMarker *aMarker = (RNMGMSMarker *)marker;
|
|
543
377
|
return [aMarker.fakeMarker markerInfoContents];
|
|
544
378
|
}
|
|
545
379
|
|
|
546
380
|
- (void)mapView:(GMSMapView *)mapView didTapInfoWindowOfMarker:(GMSMarker *)marker {
|
|
547
|
-
|
|
381
|
+
RNMGMSMarker *aMarker = (RNMGMSMarker *)marker;
|
|
548
382
|
[aMarker.fakeMarker didTapInfoWindowOfMarker:aMarker];
|
|
549
383
|
}
|
|
550
384
|
|
|
551
385
|
- (void)mapView:(GMSMapView *)mapView didBeginDraggingMarker:(GMSMarker *)marker {
|
|
552
|
-
|
|
386
|
+
RNMGMSMarker *aMarker = (RNMGMSMarker *)marker;
|
|
553
387
|
[aMarker.fakeMarker didBeginDraggingMarker:aMarker];
|
|
554
388
|
}
|
|
555
389
|
|
|
556
390
|
- (void)mapView:(GMSMapView *)mapView didEndDraggingMarker:(GMSMarker *)marker {
|
|
557
|
-
|
|
391
|
+
RNMGMSMarker *aMarker = (RNMGMSMarker *)marker;
|
|
558
392
|
[aMarker.fakeMarker didEndDraggingMarker:aMarker];
|
|
559
393
|
}
|
|
560
394
|
|
|
561
395
|
- (void)mapView:(GMSMapView *)mapView didDragMarker:(GMSMarker *)marker {
|
|
562
|
-
|
|
396
|
+
RNMGMSMarker *aMarker = (RNMGMSMarker *)marker;
|
|
563
397
|
[aMarker.fakeMarker didDragMarker:aMarker];
|
|
564
398
|
}
|
|
565
399
|
|
|
@@ -567,14 +401,14 @@ RCT_EXPORT_METHOD(setIndoorActiveLevelIndex:(nonnull NSNumber *)reactTag
|
|
|
567
401
|
didTapPOIWithPlaceID:(NSString *)placeID
|
|
568
402
|
name:(NSString *)name
|
|
569
403
|
location:(CLLocationCoordinate2D)location {
|
|
570
|
-
|
|
404
|
+
RNMGoogleMap *googleMapView = (RNMGoogleMap *)mapView;
|
|
571
405
|
[googleMapView didTapPOIWithPlaceID:placeID name:name location:location];
|
|
572
406
|
}
|
|
573
407
|
|
|
574
408
|
#pragma mark Gesture Recognizer Handlers
|
|
575
409
|
|
|
576
410
|
- (void)handleMapDrag:(UIPanGestureRecognizer*)recognizer {
|
|
577
|
-
|
|
411
|
+
RNMGoogleMap *map = (RNMGoogleMap *)recognizer.view;
|
|
578
412
|
if (!map.onPanDrag) return;
|
|
579
413
|
|
|
580
414
|
CGPoint touchPoint = [recognizer locationInView:map];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGoogleMapMarker.h
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gil Birman on 9/2/16.
|
|
6
6
|
//
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
|
|
10
10
|
#import <GoogleMaps/GoogleMaps.h>
|
|
11
11
|
#import <React/RCTBridge.h>
|
|
12
|
-
#import "
|
|
13
|
-
#import "
|
|
14
|
-
#import "
|
|
15
|
-
#import "
|
|
12
|
+
#import "RNMGMSMarker.h"
|
|
13
|
+
#import "RNMGoogleMap.h"
|
|
14
|
+
#import "RNMGoogleMapCallout.h"
|
|
15
|
+
#import "RNMGoogleMapCalloutSubview.h"
|
|
16
16
|
|
|
17
|
-
@interface
|
|
17
|
+
@interface RNMGoogleMapMarker : UIView
|
|
18
18
|
|
|
19
19
|
@property (nonatomic, weak) RCTBridge *bridge;
|
|
20
|
-
@property (nonatomic, strong)
|
|
20
|
+
@property (nonatomic, strong) RNMGoogleMapCallout *calloutView;
|
|
21
21
|
@property (nonatomic, strong) NSString *identifier;
|
|
22
22
|
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
|
|
23
23
|
@property (nonatomic, assign) CLLocationDegrees rotation;
|
|
24
|
-
@property (nonatomic, strong)
|
|
24
|
+
@property (nonatomic, strong) RNMGMSMarker* realMarker;
|
|
25
25
|
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
|
26
26
|
@property (nonatomic, copy) RCTDirectEventBlock onDragStart;
|
|
27
27
|
@property (nonatomic, copy) RCTDirectEventBlock onDrag;
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
- (void)redraw;
|
|
46
46
|
- (UIView *)markerInfoContents;
|
|
47
47
|
- (UIView *)markerInfoWindow;
|
|
48
|
-
- (void)didTapInfoWindowOfMarker:(
|
|
49
|
-
- (void)didTapInfoWindowOfMarker:(
|
|
50
|
-
- (void)didTapInfoWindowOfMarker:(
|
|
51
|
-
- (void)didBeginDraggingMarker:(
|
|
52
|
-
- (void)didEndDraggingMarker:(
|
|
53
|
-
- (void)didDragMarker:(
|
|
48
|
+
- (void)didTapInfoWindowOfMarker:(RNMGMSMarker *)marker;
|
|
49
|
+
- (void)didTapInfoWindowOfMarker:(RNMGMSMarker *)marker point:(CGPoint)point frame:(CGRect)frame;
|
|
50
|
+
- (void)didTapInfoWindowOfMarker:(RNMGMSMarker *)marker subview:(RNMGoogleMapCalloutSubview*)subview point:(CGPoint)point frame:(CGRect)frame;
|
|
51
|
+
- (void)didBeginDraggingMarker:(RNMGMSMarker *)marker;
|
|
52
|
+
- (void)didEndDraggingMarker:(RNMGMSMarker *)marker;
|
|
53
|
+
- (void)didDragMarker:(RNMGMSMarker *)marker;
|
|
54
54
|
@end
|
|
55
55
|
|
|
56
56
|
#endif
|