react-native-maps 2.0.0-beta.1 → 2.0.0-beta.11
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 +34 -11
- package/android/build.gradle +41 -10
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- 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 +9 -83
- 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 +7 -5
- package/android/src/main/java/com/rnmaps/maps/MapUrlTileManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapView.java +66 -157
- package/android/src/main/java/com/rnmaps/maps/MapViewModule.java +598 -0
- 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 → GoogleMaps}/RCTConvert+GMSMapViewType.m +8 -0
- 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} +90 -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/GoogleMaps/RNMGoogleMapManager.m +223 -0
- 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 +385 -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} +25 -8
- package/ios/{AirMaps/AIRMap.h → Maps/RNMMap.h} +8 -8
- package/ios/{AirMaps/AIRMap.m → Maps/RNMMap.m} +60 -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/Maps/RNMMapManager.m +830 -0
- 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 +465 -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 +21 -16
- package/lib/MapView.js +92 -118
- package/lib/MapView.types.d.ts +8 -3
- package/lib/MapViewNativeComponent.d.ts +0 -15
- package/lib/MapViewNativeComponent.js +0 -17
- package/lib/MapWMSTile.js +2 -2
- package/lib/NativeGoogleMapViewModule.d.ts +25 -0
- package/lib/NativeGoogleMapViewModule.js +4 -0
- package/lib/NativeMapViewModule.d.ts +29 -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 +6 -6
- package/react-native-google-maps.podspec +1 -1
- package/react-native-maps.podspec +2 -2
- package/android/src/main/java/com/rnmaps/maps/MapModule.java +0 -380
- package/ios/AirGoogleMaps/AIRGoogleMapCalloutSubviewManager.m +0 -28
- package/ios/AirGoogleMaps/AIRGoogleMapHeatmapManager.h +0 -11
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +0 -597
- package/ios/AirMaps/AIRMapCalloutSubviewManager.h +0 -14
- package/ios/AirMaps/AIRMapCalloutSubviewManager.m +0 -24
- package/ios/AirMaps/AIRMapManager.m +0 -1253
- 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/{AirMaps → Maps}/Callout/SMCalloutView.m +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMDummyView.h
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gil Birman on 10/4/16.
|
|
6
6
|
//
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#import <UIKit/UIKit.h>
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
@interface
|
|
13
|
+
@interface RNMDummyView : UIView
|
|
14
14
|
@property (nonatomic, weak) UIView *view;
|
|
15
15
|
- (instancetype)initWithView:(UIView*)view;
|
|
16
16
|
@end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMDummyView.m
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gil Birman on 10/4/16.
|
|
6
6
|
//
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
#ifdef HAVE_GOOGLE_MAPS
|
|
9
9
|
|
|
10
10
|
#import <Foundation/Foundation.h>
|
|
11
|
-
#import "
|
|
11
|
+
#import "RNMDummyView.h"
|
|
12
12
|
|
|
13
|
-
@implementation
|
|
13
|
+
@implementation RNMDummyView
|
|
14
14
|
- (instancetype)initWithView:(UIView*)view
|
|
15
15
|
{
|
|
16
16
|
if ((self = [super init])) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGMSMarker.h
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gil Birman on 9/5/16.
|
|
6
6
|
//
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
#import <GoogleMaps/GoogleMaps.h>
|
|
11
11
|
#import <React/UIView+React.h>
|
|
12
12
|
|
|
13
|
-
@class
|
|
13
|
+
@class RNMGoogleMapMarker;
|
|
14
14
|
|
|
15
|
-
@interface
|
|
15
|
+
@interface RNMGMSMarker : GMSMarker
|
|
16
16
|
@property (nonatomic, strong) NSString *identifier;
|
|
17
|
-
@property (nonatomic, weak)
|
|
17
|
+
@property (nonatomic, weak) RNMGoogleMapMarker *fakeMarker;
|
|
18
18
|
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
|
19
19
|
@end
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
@protocol
|
|
22
|
+
@protocol RNMGMSMarkerDelegate <NSObject>
|
|
23
23
|
@required
|
|
24
24
|
-(void)didTapMarker;
|
|
25
25
|
@end
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGMSMarker.m
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gil Birman on 9/5/16.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
#ifdef HAVE_GOOGLE_MAPS
|
|
9
9
|
|
|
10
|
-
#import "
|
|
10
|
+
#import "RNMGMSMarker.h"
|
|
11
11
|
|
|
12
|
-
@implementation
|
|
12
|
+
@implementation RNMGMSMarker
|
|
13
13
|
|
|
14
14
|
@end
|
|
15
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGMSPolygon.h
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gerardo Pacheco 02/05/2017.
|
|
6
6
|
//
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
#import <GoogleMaps/GoogleMaps.h>
|
|
11
11
|
#import <React/UIView+React.h>
|
|
12
12
|
|
|
13
|
-
@class
|
|
13
|
+
@class RNMGoogleMapPolygon;
|
|
14
14
|
|
|
15
|
-
@interface
|
|
15
|
+
@interface RNMGMSPolygon : GMSPolygon
|
|
16
16
|
@property (nonatomic, strong) NSString *identifier;
|
|
17
17
|
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
|
18
18
|
@end
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGMSPolygon.m
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gerardo Pacheco 02/05/2017.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
#ifdef HAVE_GOOGLE_MAPS
|
|
9
9
|
|
|
10
|
-
#import "
|
|
10
|
+
#import "RNMGMSPolygon.h"
|
|
11
11
|
|
|
12
|
-
@implementation
|
|
12
|
+
@implementation RNMGMSPolygon
|
|
13
13
|
|
|
14
14
|
@end
|
|
15
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGMSPolyline.h
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Guilherme Pontes 04/05/2017.
|
|
6
6
|
//
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
#import <GoogleMaps/GoogleMaps.h>
|
|
11
11
|
#import <React/UIView+React.h>
|
|
12
12
|
|
|
13
|
-
@class
|
|
13
|
+
@class RNMGoogleMapPolyline;
|
|
14
14
|
|
|
15
|
-
@interface
|
|
15
|
+
@interface RNMGMSPolyline : GMSPolyline
|
|
16
16
|
@property (nonatomic, strong) NSString *identifier;
|
|
17
17
|
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
|
18
18
|
@end
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGMSPolyline.m
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Guilherme Pontes 04/05/2017.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
#ifdef HAVE_GOOGLE_MAPS
|
|
9
9
|
|
|
10
|
-
#import "
|
|
10
|
+
#import "RNMGMSPolyline.h"
|
|
11
11
|
|
|
12
|
-
@implementation
|
|
12
|
+
@implementation RNMGMSPolyline
|
|
13
13
|
@end
|
|
14
14
|
|
|
15
15
|
#endif
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGoogleMap.h
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gil Birman on 9/1/16.
|
|
6
6
|
//
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
#import <React/RCTBridge.h>
|
|
13
13
|
#import <GoogleMaps/GoogleMaps.h>
|
|
14
14
|
#import <MapKit/MapKit.h>
|
|
15
|
-
#import "
|
|
16
|
-
#import "RCTConvert+
|
|
15
|
+
#import "RNMGMSMarker.h"
|
|
16
|
+
#import "RCTConvert+RNMMap.h"
|
|
17
17
|
|
|
18
|
-
@interface
|
|
18
|
+
@interface RNMGoogleMap : GMSMapView
|
|
19
19
|
|
|
20
20
|
// TODO: don't use MK region?
|
|
21
21
|
@property (nonatomic, weak) RCTBridge *bridge;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGoogleMap.m
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gil Birman on 9/1/16.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
#ifdef HAVE_GOOGLE_MAPS
|
|
9
9
|
|
|
10
|
-
#import "
|
|
11
|
-
#import "
|
|
12
|
-
#import "
|
|
13
|
-
#import "
|
|
14
|
-
#import "
|
|
15
|
-
#import "
|
|
16
|
-
#import "
|
|
17
|
-
#import "
|
|
18
|
-
#import "
|
|
19
|
-
#import "
|
|
10
|
+
#import "RNMGoogleMap.h"
|
|
11
|
+
#import "RNMGoogleMapMarker.h"
|
|
12
|
+
#import "RNMGoogleMapMarkerManager.h"
|
|
13
|
+
#import "RNMGoogleMapPolygon.h"
|
|
14
|
+
#import "RNMGoogleMapPolyline.h"
|
|
15
|
+
#import "RNMGoogleMapCircle.h"
|
|
16
|
+
#import "RNMGoogleMapHeatmap.h"
|
|
17
|
+
#import "RNMGoogleMapUrlTile.h"
|
|
18
|
+
#import "RNMGoogleMapWMSTile.h"
|
|
19
|
+
#import "RNMGoogleMapOverlay.h"
|
|
20
20
|
#import <GoogleMaps/GoogleMaps.h>
|
|
21
21
|
#import <MapKit/MapKit.h>
|
|
22
22
|
#import <React/UIView+React.h>
|
|
23
23
|
#import <React/RCTBridge.h>
|
|
24
|
-
#import "RCTConvert+
|
|
24
|
+
#import "RCTConvert+RNMMap.h"
|
|
25
25
|
#import <objc/runtime.h>
|
|
26
26
|
|
|
27
27
|
#ifdef HAVE_GOOGLE_MAPS_UTILS
|
|
@@ -49,7 +49,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
@interface
|
|
52
|
+
@interface RNMGoogleMap () <GMSIndoorDisplayDelegate>
|
|
53
53
|
|
|
54
54
|
- (id)eventFromCoordinate:(CLLocationCoordinate2D)coordinate;
|
|
55
55
|
|
|
@@ -57,7 +57,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
57
57
|
|
|
58
58
|
@end
|
|
59
59
|
|
|
60
|
-
@implementation
|
|
60
|
+
@implementation RNMGoogleMap
|
|
61
61
|
{
|
|
62
62
|
NSMutableArray<UIView *> *_reactSubviews;
|
|
63
63
|
MKCoordinateRegion _initialRegion;
|
|
@@ -132,36 +132,36 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
132
132
|
- (void)insertReactSubview:(id<RCTComponent>)subview atIndex:(NSInteger)atIndex {
|
|
133
133
|
// Our desired API is to pass up markers/overlays as children to the mapview component.
|
|
134
134
|
// This is where we intercept them and do the appropriate underlying mapview action.
|
|
135
|
-
if ([subview isKindOfClass:[
|
|
136
|
-
|
|
135
|
+
if ([subview isKindOfClass:[RNMGoogleMapMarker class]]) {
|
|
136
|
+
RNMGoogleMapMarker *marker = (RNMGoogleMapMarker*)subview;
|
|
137
137
|
marker.realMarker.map = self;
|
|
138
138
|
[self.markers addObject:marker];
|
|
139
|
-
} else if ([subview isKindOfClass:[
|
|
140
|
-
|
|
139
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapPolygon class]]) {
|
|
140
|
+
RNMGoogleMapPolygon *polygon = (RNMGoogleMapPolygon*)subview;
|
|
141
141
|
polygon.polygon.map = self;
|
|
142
142
|
[self.polygons addObject:polygon];
|
|
143
|
-
} else if ([subview isKindOfClass:[
|
|
144
|
-
|
|
143
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapPolyline class]]) {
|
|
144
|
+
RNMGoogleMapPolyline *polyline = (RNMGoogleMapPolyline*)subview;
|
|
145
145
|
polyline.polyline.map = self;
|
|
146
146
|
[self.polylines addObject:polyline];
|
|
147
|
-
} else if ([subview isKindOfClass:[
|
|
148
|
-
|
|
147
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapCircle class]]) {
|
|
148
|
+
RNMGoogleMapCircle *circle = (RNMGoogleMapCircle*)subview;
|
|
149
149
|
circle.circle.map = self;
|
|
150
150
|
[self.circles addObject:circle];
|
|
151
|
-
} else if ([subview isKindOfClass:[
|
|
152
|
-
|
|
151
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapUrlTile class]]) {
|
|
152
|
+
RNMGoogleMapUrlTile *tile = (RNMGoogleMapUrlTile*)subview;
|
|
153
153
|
tile.tileLayer.map = self;
|
|
154
154
|
[self.tiles addObject:tile];
|
|
155
|
-
} else if ([subview isKindOfClass:[
|
|
156
|
-
|
|
155
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapWMSTile class]]) {
|
|
156
|
+
RNMGoogleMapWMSTile *tile = (RNMGoogleMapWMSTile*)subview;
|
|
157
157
|
tile.tileLayer.map = self;
|
|
158
158
|
[self.tiles addObject:tile];
|
|
159
|
-
} else if ([subview isKindOfClass:[
|
|
160
|
-
|
|
159
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapOverlay class]]) {
|
|
160
|
+
RNMGoogleMapOverlay *overlay = (RNMGoogleMapOverlay*)subview;
|
|
161
161
|
overlay.overlay.map = self;
|
|
162
162
|
[self.overlays addObject:overlay];
|
|
163
|
-
} else if ([subview isKindOfClass:[
|
|
164
|
-
|
|
163
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapHeatmap class]]){
|
|
164
|
+
RNMGoogleMapHeatmap *heatmap = (RNMGoogleMapHeatmap*)subview;
|
|
165
165
|
heatmap.heatmap.map = self;
|
|
166
166
|
[self.heatmaps addObject:heatmap];
|
|
167
167
|
} else {
|
|
@@ -180,36 +180,36 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
180
180
|
- (void)removeReactSubview:(id<RCTComponent>)subview {
|
|
181
181
|
// similarly, when the children are being removed we have to do the appropriate
|
|
182
182
|
// underlying mapview action here.
|
|
183
|
-
if ([subview isKindOfClass:[
|
|
184
|
-
|
|
183
|
+
if ([subview isKindOfClass:[RNMGoogleMapMarker class]]) {
|
|
184
|
+
RNMGoogleMapMarker *marker = (RNMGoogleMapMarker*)subview;
|
|
185
185
|
marker.realMarker.map = nil;
|
|
186
186
|
[self.markers removeObject:marker];
|
|
187
|
-
} else if ([subview isKindOfClass:[
|
|
188
|
-
|
|
187
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapPolygon class]]) {
|
|
188
|
+
RNMGoogleMapPolygon *polygon = (RNMGoogleMapPolygon*)subview;
|
|
189
189
|
polygon.polygon.map = nil;
|
|
190
190
|
[self.polygons removeObject:polygon];
|
|
191
|
-
} else if ([subview isKindOfClass:[
|
|
192
|
-
|
|
191
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapPolyline class]]) {
|
|
192
|
+
RNMGoogleMapPolyline *polyline = (RNMGoogleMapPolyline*)subview;
|
|
193
193
|
polyline.polyline.map = nil;
|
|
194
194
|
[self.polylines removeObject:polyline];
|
|
195
|
-
} else if ([subview isKindOfClass:[
|
|
196
|
-
|
|
195
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapCircle class]]) {
|
|
196
|
+
RNMGoogleMapCircle *circle = (RNMGoogleMapCircle*)subview;
|
|
197
197
|
circle.circle.map = nil;
|
|
198
198
|
[self.circles removeObject:circle];
|
|
199
|
-
} else if ([subview isKindOfClass:[
|
|
200
|
-
|
|
199
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapUrlTile class]]) {
|
|
200
|
+
RNMGoogleMapUrlTile *tile = (RNMGoogleMapUrlTile*)subview;
|
|
201
201
|
tile.tileLayer.map = nil;
|
|
202
202
|
[self.tiles removeObject:tile];
|
|
203
|
-
} else if ([subview isKindOfClass:[
|
|
204
|
-
|
|
203
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapWMSTile class]]) {
|
|
204
|
+
RNMGoogleMapWMSTile *tile = (RNMGoogleMapWMSTile*)subview;
|
|
205
205
|
tile.tileLayer.map = nil;
|
|
206
206
|
[self.tiles removeObject:tile];
|
|
207
|
-
} else if ([subview isKindOfClass:[
|
|
208
|
-
|
|
207
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapOverlay class]]) {
|
|
208
|
+
RNMGoogleMapOverlay *overlay = (RNMGoogleMapOverlay*)subview;
|
|
209
209
|
overlay.overlay.map = nil;
|
|
210
210
|
[self.overlays removeObject:overlay];
|
|
211
|
-
} else if ([subview isKindOfClass:[
|
|
212
|
-
|
|
211
|
+
} else if ([subview isKindOfClass:[RNMGoogleMapHeatmap class]]){
|
|
212
|
+
RNMGoogleMapHeatmap *heatmap = (RNMGoogleMapHeatmap*)subview;
|
|
213
213
|
heatmap.heatmap.map = nil;
|
|
214
214
|
[self.heatmaps removeObject:heatmap];
|
|
215
215
|
} else {
|
|
@@ -260,18 +260,18 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
260
260
|
}
|
|
261
261
|
else if (_initialRegion.span.latitudeDelta != 0.0 &&
|
|
262
262
|
_initialRegion.span.longitudeDelta != 0.0) {
|
|
263
|
-
self.camera = [
|
|
263
|
+
self.camera = [RNMGoogleMap makeGMSCameraPositionFromMap:self andMKCoordinateRegion:_initialRegion];
|
|
264
264
|
_initialRegionSet = true;
|
|
265
265
|
} else if (_region.span.latitudeDelta != 0.0 &&
|
|
266
266
|
_region.span.longitudeDelta != 0.0) {
|
|
267
|
-
self.camera = [
|
|
267
|
+
self.camera = [RNMGoogleMap makeGMSCameraPositionFromMap:self andMKCoordinateRegion:_region];
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
- (void)setInitialRegion:(MKCoordinateRegion)initialRegion {
|
|
272
272
|
_initialRegion = initialRegion;
|
|
273
273
|
if(!_initialRegionSet && _didLayoutSubviews){
|
|
274
|
-
self.camera = [
|
|
274
|
+
self.camera = [RNMGoogleMap makeGMSCameraPositionFromMap:self andMKCoordinateRegion:initialRegion];
|
|
275
275
|
_initialRegionSet = true;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
@@ -288,7 +288,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
288
288
|
// TODO: The JS component is repeatedly setting region unnecessarily. We might want to deal with that in here.
|
|
289
289
|
_region = region;
|
|
290
290
|
if(_didLayoutSubviews) {
|
|
291
|
-
self.camera = [
|
|
291
|
+
self.camera = [RNMGoogleMap makeGMSCameraPositionFromMap:self andMKCoordinateRegion:region];
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
|
|
@@ -305,6 +305,19 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
+
- (void)setBoundary:(GMSCoordinateBounds*)boundary {
|
|
309
|
+
self.cameraTargetBounds = boundary;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
- (void)setIndoorActiveLevelIndex:(NSInteger)index {
|
|
313
|
+
if (!self.indoorDisplay) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
if ( index < [self.indoorDisplay.activeBuilding.levels count]) {
|
|
317
|
+
self.indoorDisplay.activeLevel = self.indoorDisplay.activeBuilding.levels[index];
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
308
321
|
- (void)didPrepareMap {
|
|
309
322
|
UIView* mapView = [self valueForKey:@"mapView"]; //GMSVectorMapView
|
|
310
323
|
[self overrideGestureRecognizersForView:mapView];
|
|
@@ -321,17 +334,17 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
321
334
|
}
|
|
322
335
|
|
|
323
336
|
- (BOOL)didTapMarker:(GMSMarker *)marker {
|
|
324
|
-
|
|
337
|
+
RNMGMSMarker *rnmMarker = (RNMGMSMarker *)marker;
|
|
325
338
|
|
|
326
339
|
id event = @{@"action": @"marker-press",
|
|
327
|
-
@"id":
|
|
340
|
+
@"id": rnmMarker.identifier ?: @"unknown",
|
|
328
341
|
@"coordinate": @{
|
|
329
|
-
@"latitude": @(
|
|
330
|
-
@"longitude": @(
|
|
342
|
+
@"latitude": @(rnmMarker.position.latitude),
|
|
343
|
+
@"longitude": @(rnmMarker.position.longitude)
|
|
331
344
|
}
|
|
332
345
|
};
|
|
333
346
|
|
|
334
|
-
if (
|
|
347
|
+
if (rnmMarker.onPress) rnmMarker.onPress(event);
|
|
335
348
|
if (self.onMarkerPress) self.onMarkerPress(event);
|
|
336
349
|
|
|
337
350
|
// TODO: not sure why this is necessary
|
|
@@ -340,23 +353,23 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
340
353
|
}
|
|
341
354
|
|
|
342
355
|
- (void)didTapPolyline:(GMSOverlay *)polyline {
|
|
343
|
-
|
|
356
|
+
RNMGMSPolyline *rnmPolyline = (RNMGMSPolyline *)polyline;
|
|
344
357
|
|
|
345
358
|
id event = @{@"action": @"polyline-press",
|
|
346
|
-
@"id":
|
|
359
|
+
@"id": rnmPolyline.identifier ?: @"unknown",
|
|
347
360
|
};
|
|
348
361
|
|
|
349
|
-
if (
|
|
362
|
+
if (rnmPolyline.onPress) rnmPolyline.onPress(event);
|
|
350
363
|
}
|
|
351
364
|
|
|
352
365
|
- (void)didTapPolygon:(GMSOverlay *)polygon {
|
|
353
|
-
|
|
366
|
+
RNMGMSPolygon *rnmPolygon = (RNMGMSPolygon *)polygon;
|
|
354
367
|
|
|
355
368
|
id event = @{@"action": @"polygon-press",
|
|
356
|
-
@"id":
|
|
369
|
+
@"id": rnmPolygon.identifier ?: @"unknown",
|
|
357
370
|
};
|
|
358
371
|
|
|
359
|
-
if (
|
|
372
|
+
if (rnmPolygon.onPress) rnmPolygon.onPress(event);
|
|
360
373
|
}
|
|
361
374
|
|
|
362
375
|
- (void)didTapAtCoordinate:(CLLocationCoordinate2D)coordinate {
|
|
@@ -371,7 +384,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
371
384
|
|
|
372
385
|
- (void)didChangeCameraPosition:(GMSCameraPosition *)position isGesture:(BOOL)isGesture{
|
|
373
386
|
id event = @{@"continuous": @YES,
|
|
374
|
-
@"region": regionAsJSON([
|
|
387
|
+
@"region": regionAsJSON([RNMGoogleMap makeGMSCameraPositionFromMap:self andGMSCameraPosition:position]),
|
|
375
388
|
@"isGesture": [NSNumber numberWithBool:isGesture],
|
|
376
389
|
};
|
|
377
390
|
|
|
@@ -394,7 +407,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
394
407
|
|
|
395
408
|
- (void)idleAtCameraPosition:(GMSCameraPosition *)position isGesture:(BOOL)isGesture{
|
|
396
409
|
id event = @{@"continuous": @NO,
|
|
397
|
-
@"region": regionAsJSON([
|
|
410
|
+
@"region": regionAsJSON([RNMGoogleMap makeGMSCameraPositionFromMap:self andGMSCameraPosition:position]),
|
|
398
411
|
@"isGesture": [NSNumber numberWithBool:isGesture],
|
|
399
412
|
};
|
|
400
413
|
if (self.onChange) self.onChange(event); // complete
|
|
@@ -601,7 +614,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
601
614
|
|
|
602
615
|
#pragma mark - Utils
|
|
603
616
|
|
|
604
|
-
- (CGRect) frameForMarker:(
|
|
617
|
+
- (CGRect) frameForMarker:(RNMGoogleMapMarker*) mrkView {
|
|
605
618
|
CGPoint mrkAnchor = mrkView.realMarker.groundAnchor;
|
|
606
619
|
CGPoint mrkPoint = [self.projection pointForCoordinate:mrkView.coordinate];
|
|
607
620
|
CGSize mrkSize = mrkView.realMarker.iconView ? mrkView.realMarker.iconView.bounds.size : CGSizeMake(20, 30);
|
|
@@ -613,7 +626,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
613
626
|
|
|
614
627
|
- (NSDictionary*) getMarkersFramesWithOnlyVisible:(BOOL)onlyVisible {
|
|
615
628
|
NSMutableDictionary* markersFrames = [NSMutableDictionary new];
|
|
616
|
-
for (
|
|
629
|
+
for (RNMGoogleMapMarker* mrkView in self.markers) {
|
|
617
630
|
CGRect frame = [self frameForMarker:mrkView];
|
|
618
631
|
CGPoint point = [self.projection pointForCoordinate:mrkView.coordinate];
|
|
619
632
|
NSDictionary* frameDict = @{
|
|
@@ -635,9 +648,9 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
635
648
|
return markersFrames;
|
|
636
649
|
}
|
|
637
650
|
|
|
638
|
-
- (
|
|
639
|
-
|
|
640
|
-
for (
|
|
651
|
+
- (RNMGoogleMapMarker*) markerAtPoint:(CGPoint)point {
|
|
652
|
+
RNMGoogleMapMarker* mrk = nil;
|
|
653
|
+
for (RNMGoogleMapMarker* mrkView in self.markers) {
|
|
641
654
|
CGRect frame = [self frameForMarker:mrkView];
|
|
642
655
|
if (CGRectContainsPoint(frame, point)) {
|
|
643
656
|
mrk = mrkView;
|
|
@@ -739,9 +752,9 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
739
752
|
}
|
|
740
753
|
if (isTapInsideBubble) {
|
|
741
754
|
//find bubble's marker
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
for (
|
|
755
|
+
RNMGoogleMapMarker* markerView = nil;
|
|
756
|
+
RNMGMSMarker* marker = nil;
|
|
757
|
+
for (RNMGoogleMapMarker* mrk in self.markers) {
|
|
745
758
|
if ([mrk.calloutView isEqual:bubbleView]) {
|
|
746
759
|
markerView = mrk;
|
|
747
760
|
marker = markerView.realMarker;
|
|
@@ -751,12 +764,12 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
751
764
|
|
|
752
765
|
//find real tap target subview
|
|
753
766
|
UIView* realSubview = [(RCTView*)bubbleView hitTest:tapPointInBubble withEvent:nil];
|
|
754
|
-
|
|
767
|
+
RNMGoogleMapCalloutSubview* realPressableSubview = nil;
|
|
755
768
|
if (realSubview) {
|
|
756
769
|
UIView* tmp = realSubview;
|
|
757
770
|
while (tmp && tmp != win && tmp != bubbleView) {
|
|
758
771
|
if ([tmp respondsToSelector:@selector(onPress)]) {
|
|
759
|
-
realPressableSubview = (
|
|
772
|
+
realPressableSubview = (RNMGoogleMapCalloutSubview*) tmp;
|
|
760
773
|
break;
|
|
761
774
|
}
|
|
762
775
|
tmp = tmp.superview;
|
|
@@ -768,7 +781,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
768
781
|
if (isInsideCallout) {
|
|
769
782
|
[markerView didTapInfoWindowOfMarker:marker subview:realPressableSubview point:tapPointInBubble frame:bubbleFrame];
|
|
770
783
|
} else {
|
|
771
|
-
|
|
784
|
+
RNMGoogleMapMarker* markerAtTapPoint = [self markerAtPoint:tapPoint];
|
|
772
785
|
if (markerAtTapPoint != nil) {
|
|
773
786
|
[self didTapMarker:markerAtTapPoint.realMarker];
|
|
774
787
|
} else {
|
|
@@ -874,7 +887,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
874
887
|
|
|
875
888
|
CLLocationCoordinate2D location =((GMUPoint *) place.geometry).coordinate;
|
|
876
889
|
|
|
877
|
-
|
|
890
|
+
RNMGoogleMapMarker *marker = (RNMGoogleMapMarker *)[[RNMGoogleMapMarkerManager alloc] view];
|
|
878
891
|
if (!marker.bridge) {
|
|
879
892
|
marker.bridge = _bridge;
|
|
880
893
|
}
|
|
@@ -883,7 +896,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
883
896
|
marker.title = place.title;
|
|
884
897
|
marker.subtitle = place.snippet;
|
|
885
898
|
marker.pinColor = place.style.fillColor;
|
|
886
|
-
marker.imageSrc = [
|
|
899
|
+
marker.imageSrc = [RNMGoogleMap GetIconUrl:place parser:parser];
|
|
887
900
|
marker.layer.backgroundColor = [UIColor clearColor].CGColor;
|
|
888
901
|
marker.layer.position = CGPointZero;
|
|
889
902
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGoogleMapCallout.h
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gil Birman on 9/6/16.
|
|
6
6
|
//
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#import <UIKit/UIKit.h>
|
|
12
12
|
#import <React/RCTView.h>
|
|
13
13
|
|
|
14
|
-
@interface
|
|
14
|
+
@interface RNMGoogleMapCallout : UIView
|
|
15
15
|
@property (nonatomic, assign) BOOL tooltip;
|
|
16
16
|
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
|
17
17
|
@property (nonatomic, assign) BOOL alphaHitTest;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGoogleMapCallout.m
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gil Birman on 9/6/16.
|
|
6
6
|
//
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
#ifdef HAVE_GOOGLE_MAPS
|
|
10
10
|
|
|
11
|
-
#import "
|
|
11
|
+
#import "RNMGoogleMapCallout.h"
|
|
12
12
|
#import <React/RCTUtils.h>
|
|
13
13
|
#import <React/RCTView.h>
|
|
14
14
|
#import <React/RCTBridge.h>
|
|
15
15
|
|
|
16
|
-
@implementation
|
|
16
|
+
@implementation RNMGoogleMapCallout
|
|
17
17
|
|
|
18
18
|
- (BOOL) isPointInside:(CGPoint)pointInCallout {
|
|
19
19
|
if (!self.alphaHitTest)
|
package/ios/{AirGoogleMaps/AIRGoogleMapCalloutManager.h → GoogleMaps/RNMGoogleMapCalloutManager.h}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGoogleMapCalloutManager.h
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gil Birman on 9/6/16.
|
|
6
6
|
//
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
#import <React/RCTViewManager.h>
|
|
12
12
|
|
|
13
|
-
@interface
|
|
13
|
+
@interface RNMGoogleMapCalloutManager : RCTViewManager
|
|
14
14
|
|
|
15
15
|
@end
|
|
16
16
|
|
package/ios/{AirGoogleMaps/AIRGoogleMapCalloutManager.m → GoogleMaps/RNMGoogleMapCalloutManager.m}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMGoogleMapCalloutManager.m
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Gil Birman on 9/6/16.
|
|
6
6
|
//
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
|
|
9
9
|
#ifdef HAVE_GOOGLE_MAPS
|
|
10
10
|
|
|
11
|
-
#import "
|
|
12
|
-
#import "
|
|
11
|
+
#import "RNMGoogleMapCalloutManager.h"
|
|
12
|
+
#import "RNMGoogleMapCallout.h"
|
|
13
13
|
#import <React/RCTView.h>
|
|
14
14
|
|
|
15
|
-
@implementation
|
|
16
|
-
RCT_EXPORT_MODULE()
|
|
15
|
+
@implementation RNMGoogleMapCalloutManager
|
|
16
|
+
RCT_EXPORT_MODULE(RNMGoogleMapCallout)
|
|
17
17
|
|
|
18
18
|
- (UIView *)view
|
|
19
19
|
{
|
|
20
|
-
|
|
20
|
+
RNMGoogleMapCallout *callout = [RNMGoogleMapCallout new];
|
|
21
21
|
return callout;
|
|
22
22
|
}
|
|
23
23
|
|