react-native-maps 2.0.0-beta.5 → 2.0.0-beta.7
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/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 -56
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapMarkerManager.java +9 -26
- 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 +24 -131
- 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/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/GoogleMaps/RNMGoogleMapManager.m +274 -0
- package/ios/{AirGoogleMaps/AIRGoogleMapMarker.h → GoogleMaps/RNMGoogleMapMarker.h} +15 -15
- package/ios/{AirGoogleMaps/AIRGoogleMapMarker.m → GoogleMaps/RNMGoogleMapMarker.m} +22 -22
- 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 +380 -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/Maps/RNMMapManager.m +857 -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 +459 -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/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.js +2 -2
- package/lib/MapOverlay.js +2 -2
- package/lib/MapPolygon.js +2 -2
- package/lib/MapPolyline.js +2 -2
- package/lib/MapUrlTile.js +2 -2
- package/lib/MapView.d.ts +7 -8
- package/lib/MapView.js +89 -97
- package/lib/MapView.types.d.ts +8 -2
- package/lib/MapViewNativeComponent.d.ts +2 -7
- package/lib/MapViewNativeComponent.js +0 -5
- 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/package.json +1 -1
- package/react-native-google-maps.podspec +1 -1
- package/react-native-maps.podspec +1 -1
- 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/{AirGoogleMaps → GoogleMaps}/RCTConvert+GMSMapViewType.m +0 -0
- /package/ios/{AirMaps → Maps}/Callout/SMCalloutView.m +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
2
|
+
// RNMMapPolylineRenderer.h
|
|
3
3
|
// mapDemo
|
|
4
4
|
//
|
|
5
5
|
// Created by IjzerenHein on 13-11-21.
|
|
6
6
|
// Copyright (c) 2017 IjzerenHein. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
-
#import "
|
|
9
|
+
#import "RNMMapPolylineRenderer.h"
|
|
10
10
|
|
|
11
|
-
@interface
|
|
11
|
+
@interface RNMMapPolylineRendererSegment : NSObject
|
|
12
12
|
- (id)initWithPoint:(CGPoint)point color:(UIColor*)color;
|
|
13
13
|
- (void) addPoint:(CGPoint)point color:(UIColor*)color;
|
|
14
14
|
@property CGMutablePathRef path;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
@property CGPoint startPoint;
|
|
18
18
|
@property CGPoint endPoint;
|
|
19
19
|
@end
|
|
20
|
-
@implementation
|
|
20
|
+
@implementation RNMMapPolylineRendererSegment
|
|
21
21
|
- (id)initWithPoint:(CGPoint)point color:(UIColor*)color
|
|
22
22
|
{
|
|
23
23
|
self = [super init];
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
@end
|
|
40
40
|
|
|
41
|
-
@implementation
|
|
41
|
+
@implementation RNMMapPolylineRenderer {
|
|
42
42
|
MKPolyline* _polyline;
|
|
43
43
|
NSArray<UIColor *> *_strokeColors;
|
|
44
44
|
MKMapSnapshot* _snapshot;
|
|
@@ -114,14 +114,14 @@
|
|
|
114
114
|
{
|
|
115
115
|
NSMutableArray* segments = [NSMutableArray new];
|
|
116
116
|
if (_polyline.pointCount <= 1) return segments;
|
|
117
|
-
|
|
117
|
+
RNMMapPolylineRendererSegment* segment = nil;
|
|
118
118
|
for (NSUInteger i = 0, n = _polyline.pointCount; i < n; i++){
|
|
119
119
|
CGPoint point = [self pointForIndex:i];
|
|
120
120
|
UIColor* color = [self colorForIndex:i];
|
|
121
121
|
if (segment == nil) {
|
|
122
122
|
|
|
123
123
|
// Start new segment
|
|
124
|
-
segment = [[
|
|
124
|
+
segment = [[RNMMapPolylineRendererSegment alloc] initWithPoint:point color:color];
|
|
125
125
|
[segments addObject:segment];
|
|
126
126
|
}
|
|
127
127
|
else if (((color == nil) && (segment.endColor == nil)) ||
|
|
@@ -139,14 +139,14 @@
|
|
|
139
139
|
else {
|
|
140
140
|
|
|
141
141
|
// Add transition gradient
|
|
142
|
-
segment = [[
|
|
142
|
+
segment = [[RNMMapPolylineRendererSegment alloc] initWithPoint:segment.endPoint color:segment.endColor];
|
|
143
143
|
[segment addPoint:point color:color];
|
|
144
144
|
[segments addObject:segment];
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
// Start new segment
|
|
148
148
|
if (i < (n - 1)) {
|
|
149
|
-
segment = [[
|
|
149
|
+
segment = [[RNMMapPolylineRendererSegment alloc] initWithPoint:point color:color];
|
|
150
150
|
[segments addObject:segment];
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
|
|
200
200
|
NSArray* segments = [self createSegments];
|
|
201
201
|
for (NSUInteger i = 0, n = segments.count; i < n; i++) {
|
|
202
|
-
|
|
202
|
+
RNMMapPolylineRendererSegment* segment = segments[i];
|
|
203
203
|
|
|
204
204
|
CGContextBeginPath(context);
|
|
205
205
|
CGContextAddPath(context, segment.path);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMMapSnapshot.h
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Hein Rutjes on 26/09/16.
|
|
6
6
|
// Copyright © 2016 Christopher. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
-
#ifndef
|
|
10
|
-
#define
|
|
9
|
+
#ifndef RNMMapSnapshot_h
|
|
10
|
+
#define RNMMapSnapshot_h
|
|
11
11
|
|
|
12
|
-
@protocol
|
|
12
|
+
@protocol RNMMapSnapshot <NSObject>
|
|
13
13
|
@optional
|
|
14
14
|
- (void) drawToSnapshot:(MKMapSnapshot *) snapshot context:(CGContextRef) context;
|
|
15
15
|
@end
|
|
16
16
|
|
|
17
|
-
#endif /*
|
|
17
|
+
#endif /* RNMMapSnapshot_h */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMUrlTileOverlay.h
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by cascadian on 3/19/16.
|
|
6
6
|
// Copyright © 2016. All rights reserved.
|
|
@@ -12,25 +12,25 @@
|
|
|
12
12
|
|
|
13
13
|
#import <React/RCTComponent.h>
|
|
14
14
|
#import <React/RCTView.h>
|
|
15
|
-
#import "
|
|
16
|
-
#import "
|
|
17
|
-
#import "RCTConvert+
|
|
18
|
-
#import "
|
|
19
|
-
|
|
20
|
-
@interface
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
#import "RNMMapCoordinate.h"
|
|
16
|
+
#import "RNMMap.h"
|
|
17
|
+
#import "RCTConvert+RNMMap.h"
|
|
18
|
+
#import "RNMMapUrlTileCachedOverlay.h"
|
|
19
|
+
|
|
20
|
+
@interface RNMMapUrlTile : MKAnnotationView <MKOverlay> {
|
|
21
|
+
BOOL _urlTemplateSet;
|
|
22
|
+
BOOL _tileSizeSet;
|
|
23
|
+
BOOL _flipYSet;
|
|
24
|
+
BOOL _tileCachePathSet;
|
|
25
|
+
BOOL _tileCacheMaxAgeSet;
|
|
26
|
+
BOOL _maximumNativeZSet;
|
|
27
|
+
BOOL _cachedOverlayCreated;
|
|
28
|
+
BOOL _opacitySet;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
@property (nonatomic, weak)
|
|
31
|
+
@property (nonatomic, weak) RNMMap *map;
|
|
32
32
|
|
|
33
|
-
@property (nonatomic, strong)
|
|
33
|
+
@property (nonatomic, strong) RNMMapUrlTileCachedOverlay *tileOverlay;
|
|
34
34
|
@property (nonatomic, strong) MKTileOverlayRenderer *renderer;
|
|
35
35
|
@property (nonatomic, copy) NSString *urlTemplate;
|
|
36
36
|
@property NSInteger maximumZ;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMUrlTileOverlay.m
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by cascadian on 3/19/16.
|
|
6
6
|
// Copyright © 2016. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
-
#import "
|
|
9
|
+
#import "RNMMapUrlTile.h"
|
|
10
10
|
#import <React/UIView+React.h>
|
|
11
|
-
#import "
|
|
11
|
+
#import "RNMMapUrlTileCachedOverlay.h"
|
|
12
12
|
|
|
13
|
-
@implementation
|
|
13
|
+
@implementation RNMMapUrlTile
|
|
14
14
|
|
|
15
15
|
- (void)setShouldReplaceMapContent:(BOOL)shouldReplaceMapContent
|
|
16
16
|
{
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
if (!_urlTemplateSet) return;
|
|
123
123
|
if (_tileCachePathSet || _maximumNativeZSet) {
|
|
124
124
|
NSLog(@"tileCache dir %@", _tileCachePath);
|
|
125
|
-
self.tileOverlay = [[
|
|
125
|
+
self.tileOverlay = [[RNMMapUrlTileCachedOverlay alloc] initWithURLTemplate:self.urlTemplate];
|
|
126
126
|
_cachedOverlayCreated = YES;
|
|
127
127
|
if (_tileCachePathSet) {
|
|
128
128
|
NSURL *urlPath = [NSURL URLWithString:[self.tileCachePath stringByAppendingString:@"/"]];
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
[_map removeOverlay:self];
|
|
184
184
|
[_map addOverlay:self level:MKOverlayLevelAboveLabels];
|
|
185
185
|
for (id<MKOverlay> overlay in _map.overlays) {
|
|
186
|
-
if ([overlay isKindOfClass:[
|
|
186
|
+
if ([overlay isKindOfClass:[RNMMapUrlTile class]]) {
|
|
187
187
|
continue;
|
|
188
188
|
}
|
|
189
189
|
[_map removeOverlay:overlay];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMMapUrlTileCachedOverlay.h
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Markus Suomi on 10/04/2021.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
#import <MapKit/MapKit.h>
|
|
9
9
|
|
|
10
|
-
@interface
|
|
10
|
+
@interface RNMMapUrlTileCachedOverlay : MKTileOverlay
|
|
11
11
|
|
|
12
12
|
@property NSInteger maximumNativeZ;
|
|
13
13
|
@property (nonatomic, copy) NSURL *tileCachePath;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMMapUrlTileCachedOverlay.m
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by Markus Suomi on 10/04/2021.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
-
#import "
|
|
8
|
+
#import "RNMMapUrlTileCachedOverlay.h"
|
|
9
9
|
|
|
10
|
-
@interface
|
|
10
|
+
@interface RNMMapUrlTileCachedOverlay ()
|
|
11
11
|
|
|
12
12
|
@end
|
|
13
13
|
|
|
14
|
-
@implementation
|
|
14
|
+
@implementation RNMMapUrlTileCachedOverlay {
|
|
15
15
|
CIContext *_ciContext;
|
|
16
16
|
CGColorSpaceRef _colorspace;
|
|
17
17
|
NSURLSession *_urlSession;
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
NSInteger maximumZ = self.maximumNativeZ ? self.maximumNativeZ : path.z;
|
|
25
25
|
[self scaleIfNeededLowerZoomTile:path maximumZ:maximumZ result:^(NSData *image, NSError *error) {
|
|
26
26
|
if (!image && self.offlineMode && self.tileCachePath) {
|
|
27
|
-
NSInteger zoomLevelToStart = (path.z > maximumZ) ? maximumZ - 1 : path.z - 1;
|
|
27
|
+
NSInteger zoomLevelToStart = (path.z > maximumZ) ? maximumZ - 1 : path.z - 1;
|
|
28
28
|
NSInteger minimumZoomToSearch = self.minimumZ >= zoomLevelToStart - 3 ? self.minimumZ : zoomLevelToStart - 3;
|
|
29
29
|
[self findLowerZoomTileAndScale:path tryZ:zoomLevelToStart minZ:minimumZoomToSearch result:result];
|
|
30
30
|
} else {
|
|
31
31
|
result(image, error);
|
|
32
|
-
}
|
|
32
|
+
}
|
|
33
33
|
}];
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
|
|
80
80
|
NSData *finalImage = [_ciContext PNGRepresentationOfImage:scaledCIImage format:kCIFormatABGR8 colorSpace:_colorspace options:nil];
|
|
81
81
|
result(finalImage, nil);
|
|
82
|
-
}];
|
|
82
|
+
}];
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
- (void)findLowerZoomTileAndScale:(MKTileOverlayPath)path tryZ:(NSInteger)tryZ minZ:(NSInteger)minZ result:(void (^)(NSData *, NSError *))result
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
[[NSFileManager defaultManager] createFileAtPath:[tileCacheFilePath path] contents:data attributes:nil];
|
|
210
210
|
NSLog(@"tileCache File refreshed at %@", [tileCacheFilePath path]);
|
|
211
211
|
}
|
|
212
|
-
}] resume];
|
|
212
|
+
}] resume];
|
|
213
213
|
}
|
|
214
214
|
});
|
|
215
215
|
}
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
- (BOOL)doesFileNeedRefresh:(MKTileOverlayPath)path fromFilePath:(NSURL *)tileCacheFilePath withMaxAge:(NSInteger)tileCacheMaxAge
|
|
219
219
|
{
|
|
220
220
|
NSError *error;
|
|
221
|
-
NSDictionary<NSFileAttributeKey, id> *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[tileCacheFilePath path] error:&error];
|
|
221
|
+
NSDictionary<NSFileAttributeKey, id> *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[tileCacheFilePath path] error:&error];
|
|
222
222
|
|
|
223
223
|
if (fileAttributes) {
|
|
224
224
|
NSDate *modificationDate = fileAttributes[@"NSFileModificationDate"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMMapUrlTileManager.h
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by cascadian on 3/19/16.
|
|
6
6
|
// Copyright © 2016. All rights reserved.
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
#import <React/RCTViewManager.h>
|
|
11
11
|
|
|
12
|
-
@interface
|
|
12
|
+
@interface RNMMapUrlTileManager : RCTViewManager
|
|
13
13
|
|
|
14
14
|
@end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// RNMMapUrlTileManager.m
|
|
3
|
+
// RNMaps
|
|
4
4
|
//
|
|
5
5
|
// Created by cascadian on 3/19/16.
|
|
6
6
|
// Copyright © 2016. All rights reserved.
|
|
@@ -12,23 +12,23 @@
|
|
|
12
12
|
#import <React/RCTEventDispatcher.h>
|
|
13
13
|
#import <React/RCTViewManager.h>
|
|
14
14
|
#import <React/UIView+React.h>
|
|
15
|
-
#import "
|
|
16
|
-
#import "
|
|
15
|
+
#import "RNMMapMarker.h"
|
|
16
|
+
#import "RNMMapUrlTile.h"
|
|
17
17
|
|
|
18
|
-
#import "
|
|
18
|
+
#import "RNMMapUrlTileManager.h"
|
|
19
19
|
|
|
20
|
-
@interface
|
|
20
|
+
@interface RNMMapUrlTileManager()
|
|
21
21
|
|
|
22
22
|
@end
|
|
23
23
|
|
|
24
|
-
@implementation
|
|
24
|
+
@implementation RNMMapUrlTileManager
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
RCT_EXPORT_MODULE()
|
|
27
|
+
RCT_EXPORT_MODULE(RNMMapUrlTile)
|
|
28
28
|
|
|
29
29
|
- (UIView *)view
|
|
30
30
|
{
|
|
31
|
-
|
|
31
|
+
RNMMapUrlTile *tile = [RNMMapUrlTile new];
|
|
32
32
|
return tile;
|
|
33
33
|
}
|
|
34
34
|
|