react-native-maps 1.4.0-beta.1 → 1.4.0
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/build.gradle +4 -3
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/{rnmaps/maps/MapCallout.java → airbnb/android/react/maps/AirMapCallout.java} +3 -3
- package/android/src/main/java/com/{rnmaps/maps/MapCalloutManager.java → airbnb/android/react/maps/AirMapCalloutManager.java} +6 -6
- package/android/src/main/java/com/{rnmaps/maps/MapCircle.java → airbnb/android/react/maps/AirMapCircle.java} +3 -3
- package/android/src/main/java/com/{rnmaps/maps/MapCircleManager.java → airbnb/android/react/maps/AirMapCircleManager.java} +11 -11
- package/android/src/main/java/com/{rnmaps/maps/MapFeature.java → airbnb/android/react/maps/AirMapFeature.java} +3 -3
- package/android/src/main/java/com/{rnmaps/maps/MapGradientPolyline.java → airbnb/android/react/maps/AirMapGradientPolyline.java} +3 -3
- package/android/src/main/java/com/{rnmaps/maps/MapGradientPolylineManager.java → airbnb/android/react/maps/AirMapGradientPolylineManager.java} +9 -9
- package/android/src/main/java/com/{rnmaps/maps/MapHeatmap.java → airbnb/android/react/maps/AirMapHeatmap.java} +3 -3
- package/android/src/main/java/com/{rnmaps/maps/MapHeatmapManager.java → airbnb/android/react/maps/AirMapHeatmapManager.java} +8 -8
- package/android/src/main/java/com/{rnmaps/maps/MapLiteManager.java → airbnb/android/react/maps/AirMapLiteManager.java} +3 -3
- package/android/src/main/java/com/{rnmaps/maps/MapLocalTile.java → airbnb/android/react/maps/AirMapLocalTile.java} +5 -5
- package/android/src/main/java/com/{rnmaps/maps/MapLocalTileManager.java → airbnb/android/react/maps/AirMapLocalTileManager.java} +9 -9
- package/android/src/main/java/com/{rnmaps/maps/MapManager.java → airbnb/android/react/maps/AirMapManager.java} +48 -48
- package/android/src/main/java/com/{rnmaps/maps/MapMarker.java → airbnb/android/react/maps/AirMapMarker.java} +12 -12
- package/android/src/main/java/com/{rnmaps/maps/MapMarkerManager.java → airbnb/android/react/maps/AirMapMarkerManager.java} +30 -30
- package/android/src/main/java/com/{rnmaps/maps/MapModule.java → airbnb/android/react/maps/AirMapModule.java} +10 -10
- package/android/src/main/java/com/{rnmaps/maps/MapOverlay.java → airbnb/android/react/maps/AirMapOverlay.java} +3 -3
- package/android/src/main/java/com/{rnmaps/maps/MapOverlayManager.java → airbnb/android/react/maps/AirMapOverlayManager.java} +11 -11
- package/android/src/main/java/com/{rnmaps/maps/MapPolygon.java → airbnb/android/react/maps/AirMapPolygon.java} +3 -3
- package/android/src/main/java/com/{rnmaps/maps/MapPolygonManager.java → airbnb/android/react/maps/AirMapPolygonManager.java} +13 -13
- package/android/src/main/java/com/{rnmaps/maps/MapPolyline.java → airbnb/android/react/maps/AirMapPolyline.java} +3 -3
- package/android/src/main/java/com/{rnmaps/maps/MapPolylineManager.java → airbnb/android/react/maps/AirMapPolylineManager.java} +13 -13
- package/android/src/main/java/com/{rnmaps/maps/MapTileProvider.java → airbnb/android/react/maps/AirMapTileProvider.java} +10 -10
- package/android/src/main/java/com/{rnmaps/maps/MapTileWorker.java → airbnb/android/react/maps/AirMapTileWorker.java} +3 -3
- package/android/src/main/java/com/{rnmaps/maps/MapUrlTile.java → airbnb/android/react/maps/AirMapUrlTile.java} +5 -5
- package/android/src/main/java/com/{rnmaps/maps/MapUrlTileManager.java → airbnb/android/react/maps/AirMapUrlTileManager.java} +17 -17
- package/android/src/main/java/com/{rnmaps/maps/MapView.java → airbnb/android/react/maps/AirMapView.java} +63 -62
- package/android/src/main/java/com/{rnmaps/maps/MapWMSTile.java → airbnb/android/react/maps/AirMapWMSTile.java} +6 -6
- package/android/src/main/java/com/{rnmaps/maps/MapWMSTileManager.java → airbnb/android/react/maps/AirMapWMSTileManager.java} +15 -15
- package/android/src/main/java/com/{rnmaps → airbnb/android/react}/maps/FileUtil.java +1 -1
- package/android/src/main/java/com/{rnmaps → airbnb/android/react}/maps/FusedLocationSource.java +1 -1
- package/android/src/main/java/com/{rnmaps → airbnb/android/react}/maps/ImageReadable.java +1 -1
- package/android/src/main/java/com/{rnmaps → airbnb/android/react}/maps/ImageReader.java +1 -1
- package/android/src/main/java/com/{rnmaps → airbnb/android/react}/maps/ImageUtil.java +2 -1
- package/android/src/main/java/com/{rnmaps → airbnb/android/react}/maps/LatLngBoundsUtils.java +1 -1
- package/android/src/main/java/com/airbnb/android/react/maps/MapsPackage.java +65 -0
- package/android/src/main/java/com/{rnmaps → airbnb/android/react}/maps/RegionChangeEvent.java +1 -1
- package/android/src/main/java/com/{rnmaps → airbnb/android/react}/maps/SizeReportingShadowNode.java +1 -1
- package/android/src/main/java/com/{rnmaps → airbnb/android/react}/maps/ViewAttacherGroup.java +1 -1
- package/android/src/main/java/com/{rnmaps → airbnb/android/react}/maps/ViewChangesTracker.java +7 -7
- package/lib/AnimatedRegion.d.ts +1 -1
- package/lib/Geojson.d.ts +5 -5
- package/lib/MapCallout.d.ts +2 -2
- package/lib/MapCalloutSubview.d.ts +3 -3
- package/lib/MapCircle.d.ts +2 -2
- package/lib/MapHeatmap.d.ts +3 -3
- package/lib/MapLocalTile.d.ts +2 -2
- package/lib/MapMarker.d.ts +3 -3
- package/lib/MapMarkerNativeComponent.d.ts +1 -1
- package/lib/MapOverlay.d.ts +4 -4
- package/lib/MapPolygon.d.ts +3 -3
- package/lib/MapPolyline.d.ts +3 -3
- package/lib/MapUrlTile.d.ts +2 -2
- package/lib/MapView.d.ts +4 -4
- package/lib/MapView.types.d.ts +24 -24
- package/lib/MapViewNativeComponent.d.ts +1 -1
- package/lib/MapWMSTile.d.ts +2 -2
- package/lib/decorateMapComponent.d.ts +7 -7
- package/lib/sharedTypes.d.ts +14 -14
- package/lib/sharedTypesInternal.d.ts +1 -1
- package/package.json +14 -14
- package/react-native-google-maps.podspec +1 -2
- package/android/src/main/java/com/rnmaps/maps/MapsPackage.java +0 -46
package/android/build.gradle
CHANGED
|
@@ -20,11 +20,11 @@ buildscript {
|
|
|
20
20
|
apply plugin: 'com.android.library'
|
|
21
21
|
|
|
22
22
|
android {
|
|
23
|
-
compileSdkVersion safeExtGet('compileSdkVersion',
|
|
23
|
+
compileSdkVersion safeExtGet('compileSdkVersion', 30)
|
|
24
24
|
|
|
25
25
|
defaultConfig {
|
|
26
26
|
minSdkVersion safeExtGet('minSdkVersion', 21)
|
|
27
|
-
targetSdkVersion safeExtGet('targetSdkVersion',
|
|
27
|
+
targetSdkVersion safeExtGet('targetSdkVersion', 30)
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -43,10 +43,11 @@ repositories {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
dependencies {
|
|
46
|
+
def work_version = safeExtGet('targetSdkVersion', 27) < 31 ? "2.5.0" : "2.7.1"
|
|
46
47
|
implementation 'com.facebook.react:react-native:+'
|
|
47
48
|
implementation "com.google.android.gms:play-services-base:${safeExtGet('playServicesVersion', '18.1.0')}"
|
|
48
49
|
implementation "com.google.android.gms:play-services-maps:${safeExtGet('playServicesVersion', '18.0.2')}"
|
|
49
50
|
implementation "com.google.android.gms:play-services-location:20.0.0"
|
|
50
51
|
implementation 'com.google.maps.android:android-maps-utils:0.5'
|
|
51
|
-
implementation "androidx.work:work-runtime
|
|
52
|
+
implementation "androidx.work:work-runtime:$work_version"
|
|
52
53
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
5
|
import com.facebook.react.views.view.ReactViewGroup;
|
|
6
6
|
|
|
7
|
-
public class
|
|
7
|
+
public class AirMapCallout extends ReactViewGroup {
|
|
8
8
|
private boolean tooltip = false;
|
|
9
9
|
public int width;
|
|
10
10
|
public int height;
|
|
11
11
|
|
|
12
|
-
public
|
|
12
|
+
public AirMapCallout(Context context) {
|
|
13
13
|
super(context);
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import androidx.annotation.Nullable;
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ import com.facebook.react.uimanager.annotations.ReactProp;
|
|
|
10
10
|
|
|
11
11
|
import java.util.Map;
|
|
12
12
|
|
|
13
|
-
public class
|
|
13
|
+
public class AirMapCalloutManager extends ViewGroupManager<AirMapCallout> {
|
|
14
14
|
|
|
15
15
|
@Override
|
|
16
16
|
public String getName() {
|
|
@@ -18,12 +18,12 @@ public class MapCalloutManager extends ViewGroupManager<MapCallout> {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
@Override
|
|
21
|
-
public
|
|
22
|
-
return new
|
|
21
|
+
public AirMapCallout createViewInstance(ThemedReactContext context) {
|
|
22
|
+
return new AirMapCallout(context);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
@ReactProp(name = "tooltip", defaultBoolean = false)
|
|
26
|
-
public void setTooltip(
|
|
26
|
+
public void setTooltip(AirMapCallout view, boolean tooltip) {
|
|
27
27
|
view.setTooltip(tooltip);
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -42,7 +42,7 @@ public class MapCalloutManager extends ViewGroupManager<MapCallout> {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
@Override
|
|
45
|
-
public void updateExtraData(
|
|
45
|
+
public void updateExtraData(AirMapCallout view, Object extraData) {
|
|
46
46
|
// This method is called from the shadow node with the width/height of the rendered
|
|
47
47
|
// marker view.
|
|
48
48
|
//noinspection unchecked
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@ import com.google.android.gms.maps.model.Circle;
|
|
|
7
7
|
import com.google.android.gms.maps.model.CircleOptions;
|
|
8
8
|
import com.google.android.gms.maps.model.LatLng;
|
|
9
9
|
|
|
10
|
-
public class
|
|
10
|
+
public class AirMapCircle extends AirMapFeature {
|
|
11
11
|
|
|
12
12
|
private CircleOptions circleOptions;
|
|
13
13
|
private Circle circle;
|
|
@@ -19,7 +19,7 @@ public class MapCircle extends MapFeature {
|
|
|
19
19
|
private float strokeWidth;
|
|
20
20
|
private float zIndex;
|
|
21
21
|
|
|
22
|
-
public
|
|
22
|
+
public AirMapCircle(Context context) {
|
|
23
23
|
super(context);
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
import android.graphics.Color;
|
|
@@ -12,10 +12,10 @@ import com.facebook.react.uimanager.ViewGroupManager;
|
|
|
12
12
|
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
13
13
|
import com.google.android.gms.maps.model.LatLng;
|
|
14
14
|
|
|
15
|
-
public class
|
|
15
|
+
public class AirMapCircleManager extends ViewGroupManager<AirMapCircle> {
|
|
16
16
|
private final DisplayMetrics metrics;
|
|
17
17
|
|
|
18
|
-
public
|
|
18
|
+
public AirMapCircleManager(ReactApplicationContext reactContext) {
|
|
19
19
|
super();
|
|
20
20
|
metrics = new DisplayMetrics();
|
|
21
21
|
((WindowManager) reactContext.getSystemService(Context.WINDOW_SERVICE))
|
|
@@ -29,38 +29,38 @@ public class MapCircleManager extends ViewGroupManager<MapCircle> {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
@Override
|
|
32
|
-
public
|
|
33
|
-
return new
|
|
32
|
+
public AirMapCircle createViewInstance(ThemedReactContext context) {
|
|
33
|
+
return new AirMapCircle(context);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
@ReactProp(name = "center")
|
|
37
|
-
public void setCenter(
|
|
37
|
+
public void setCenter(AirMapCircle view, ReadableMap center) {
|
|
38
38
|
view.setCenter(new LatLng(center.getDouble("latitude"), center.getDouble("longitude")));
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
@ReactProp(name = "radius", defaultDouble = 0)
|
|
42
|
-
public void setRadius(
|
|
42
|
+
public void setRadius(AirMapCircle view, double radius) {
|
|
43
43
|
view.setRadius(radius);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
@ReactProp(name = "strokeWidth", defaultFloat = 1f)
|
|
47
|
-
public void setStrokeWidth(
|
|
47
|
+
public void setStrokeWidth(AirMapCircle view, float widthInPoints) {
|
|
48
48
|
float widthInScreenPx = metrics.density * widthInPoints; // done for parity with iOS
|
|
49
49
|
view.setStrokeWidth(widthInScreenPx);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
@ReactProp(name = "fillColor", defaultInt = Color.RED, customType = "Color")
|
|
53
|
-
public void setFillColor(
|
|
53
|
+
public void setFillColor(AirMapCircle view, int color) {
|
|
54
54
|
view.setFillColor(color);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
@ReactProp(name = "strokeColor", defaultInt = Color.RED, customType = "Color")
|
|
58
|
-
public void setStrokeColor(
|
|
58
|
+
public void setStrokeColor(AirMapCircle view, int color) {
|
|
59
59
|
view.setStrokeColor(color);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
@ReactProp(name = "zIndex", defaultFloat = 1.0f)
|
|
63
|
-
public void setZIndex(
|
|
63
|
+
public void setZIndex(AirMapCircle view, float zIndex) {
|
|
64
64
|
view.setZIndex(zIndex);
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
5
|
import com.facebook.react.views.view.ReactViewGroup;
|
|
6
6
|
import com.google.android.gms.maps.GoogleMap;
|
|
7
7
|
|
|
8
|
-
public abstract class
|
|
9
|
-
public
|
|
8
|
+
public abstract class AirMapFeature extends ReactViewGroup {
|
|
9
|
+
public AirMapFeature(Context context) {
|
|
10
10
|
super(context);
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
import android.graphics.Bitmap;
|
|
@@ -30,7 +30,7 @@ import java.util.List;
|
|
|
30
30
|
* from Dagothig/ColoredPolylineOverlay
|
|
31
31
|
* (https://gist.github.com/Dagothig/5f9cf0a4a7a42901a7b2)
|
|
32
32
|
*/
|
|
33
|
-
public class
|
|
33
|
+
public class AirMapGradientPolyline extends AirMapFeature {
|
|
34
34
|
private List<LatLng> points;
|
|
35
35
|
private int[] colors;
|
|
36
36
|
private float zIndex;
|
|
@@ -41,7 +41,7 @@ public class MapGradientPolyline extends MapFeature {
|
|
|
41
41
|
private TileOverlay tileOverlay;
|
|
42
42
|
protected final Context context;
|
|
43
43
|
|
|
44
|
-
public
|
|
44
|
+
public AirMapGradientPolyline(Context context) {
|
|
45
45
|
super(context);
|
|
46
46
|
this.context = context;
|
|
47
47
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
import android.util.DisplayMetrics;
|
|
@@ -15,10 +15,10 @@ import com.google.android.gms.maps.model.LatLng;
|
|
|
15
15
|
import java.util.List;
|
|
16
16
|
import java.util.ArrayList;
|
|
17
17
|
|
|
18
|
-
public class
|
|
18
|
+
public class AirMapGradientPolylineManager extends ViewGroupManager<AirMapGradientPolyline> {
|
|
19
19
|
private final DisplayMetrics metrics;
|
|
20
20
|
|
|
21
|
-
public
|
|
21
|
+
public AirMapGradientPolylineManager(ReactApplicationContext reactContext) {
|
|
22
22
|
super();
|
|
23
23
|
metrics = new DisplayMetrics();
|
|
24
24
|
((WindowManager) reactContext.getSystemService(Context.WINDOW_SERVICE))
|
|
@@ -32,12 +32,12 @@ public class MapGradientPolylineManager extends ViewGroupManager<MapGradientPoly
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
@Override
|
|
35
|
-
public
|
|
36
|
-
return new
|
|
35
|
+
public AirMapGradientPolyline createViewInstance(ThemedReactContext context) {
|
|
36
|
+
return new AirMapGradientPolyline(context);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
@ReactProp(name = "coordinates")
|
|
40
|
-
public void setCoordinates(
|
|
40
|
+
public void setCoordinates(AirMapGradientPolyline view, ReadableArray coordinates) {
|
|
41
41
|
List<LatLng> p = new ArrayList<LatLng>();
|
|
42
42
|
for (int i = 0; i < coordinates.size(); i++) {
|
|
43
43
|
ReadableMap point = coordinates.getMap(i);
|
|
@@ -48,7 +48,7 @@ public class MapGradientPolylineManager extends ViewGroupManager<MapGradientPoly
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
@ReactProp(name = "strokeColors", customType = "ColorArray")
|
|
51
|
-
public void setStrokeColors(
|
|
51
|
+
public void setStrokeColors(AirMapGradientPolyline view, ReadableArray colors) {
|
|
52
52
|
if (colors != null) {
|
|
53
53
|
if (colors.size() == 0) {
|
|
54
54
|
int[] colorValues = {0,0};
|
|
@@ -70,13 +70,13 @@ public class MapGradientPolylineManager extends ViewGroupManager<MapGradientPoly
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
@ReactProp(name = "zIndex", defaultFloat = 1.0f)
|
|
73
|
-
public void setZIndex(
|
|
73
|
+
public void setZIndex(AirMapGradientPolyline view, float zIndex) {
|
|
74
74
|
view.setZIndex(zIndex);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
@ReactProp(name = "strokeWidth", defaultFloat = 1f)
|
|
79
|
-
public void setStrokeWidth(
|
|
79
|
+
public void setStrokeWidth(AirMapGradientPolyline view, float widthInPoints) {
|
|
80
80
|
float widthInScreenPx = metrics.density * widthInPoints; // done for parity with iOS
|
|
81
81
|
view.setWidth(widthInScreenPx);
|
|
82
82
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
import android.util.Log;
|
|
@@ -13,7 +13,7 @@ import com.google.maps.android.heatmaps.Gradient;
|
|
|
13
13
|
import java.util.Arrays;
|
|
14
14
|
import java.util.List;
|
|
15
15
|
|
|
16
|
-
public class
|
|
16
|
+
public class AirMapHeatmap extends AirMapFeature {
|
|
17
17
|
|
|
18
18
|
private TileOverlayOptions heatmapOptions;
|
|
19
19
|
private TileOverlay heatmap;
|
|
@@ -24,7 +24,7 @@ public class MapHeatmap extends MapFeature {
|
|
|
24
24
|
private Double opacity;
|
|
25
25
|
private Integer radius;
|
|
26
26
|
|
|
27
|
-
public
|
|
27
|
+
public AirMapHeatmap(Context context) {
|
|
28
28
|
super(context);
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.ReadableArray;
|
|
4
4
|
import com.facebook.react.bridge.ReadableMap;
|
|
@@ -11,7 +11,7 @@ import com.google.maps.android.heatmaps.WeightedLatLng;
|
|
|
11
11
|
import com.google.maps.android.heatmaps.Gradient;
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
public class
|
|
14
|
+
public class AirMapHeatmapManager extends ViewGroupManager<AirMapHeatmap> {
|
|
15
15
|
|
|
16
16
|
@Override
|
|
17
17
|
public String getName() {
|
|
@@ -19,12 +19,12 @@ public class MapHeatmapManager extends ViewGroupManager<MapHeatmap> {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
@Override
|
|
22
|
-
public
|
|
23
|
-
return new
|
|
22
|
+
public AirMapHeatmap createViewInstance(ThemedReactContext context) {
|
|
23
|
+
return new AirMapHeatmap(context);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
@ReactProp(name = "points")
|
|
27
|
-
public void setPoints(
|
|
27
|
+
public void setPoints(AirMapHeatmap view, ReadableArray points) {
|
|
28
28
|
WeightedLatLng[] p = new WeightedLatLng[points.size()];
|
|
29
29
|
for (int i = 0; i < points.size(); i++) {
|
|
30
30
|
ReadableMap point = points.getMap(i);
|
|
@@ -41,7 +41,7 @@ public class MapHeatmapManager extends ViewGroupManager<MapHeatmap> {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
@ReactProp(name = "gradient")
|
|
44
|
-
public void setGradient(
|
|
44
|
+
public void setGradient(AirMapHeatmap view, ReadableMap gradient) {
|
|
45
45
|
ReadableArray srcColors = gradient.getArray("colors");
|
|
46
46
|
int[] colors = new int[srcColors.size()];
|
|
47
47
|
for (int i = 0; i < srcColors.size(); i++) {
|
|
@@ -63,12 +63,12 @@ public class MapHeatmapManager extends ViewGroupManager<MapHeatmap> {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
@ReactProp(name = "opacity")
|
|
66
|
-
public void setOpacity(
|
|
66
|
+
public void setOpacity(AirMapHeatmap view, double opacity) {
|
|
67
67
|
view.setOpacity(opacity);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
@ReactProp(name = "radius")
|
|
71
|
-
public void setRadius(
|
|
71
|
+
public void setRadius(AirMapHeatmap view, int radius) {
|
|
72
72
|
view.setRadius(radius);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
4
|
import com.google.android.gms.maps.GoogleMapOptions;
|
|
5
5
|
|
|
6
|
-
public class
|
|
6
|
+
public class AirMapLiteManager extends AirMapManager {
|
|
7
7
|
|
|
8
8
|
private static final String REACT_CLASS = "AIRMapLite";
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ public class MapLiteManager extends MapManager {
|
|
|
12
12
|
return REACT_CLASS;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
public
|
|
15
|
+
public AirMapLiteManager(ReactApplicationContext context) {
|
|
16
16
|
super(context);
|
|
17
17
|
this.googleMapOptions = new GoogleMapOptions().liteMode(true);
|
|
18
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
@@ -13,7 +13,7 @@ import java.io.FileInputStream;
|
|
|
13
13
|
import java.io.IOException;
|
|
14
14
|
import java.io.InputStream;
|
|
15
15
|
|
|
16
|
-
public class
|
|
16
|
+
public class AirMapLocalTile extends AirMapFeature {
|
|
17
17
|
|
|
18
18
|
class AIRMapLocalTileProvider implements TileProvider {
|
|
19
19
|
private static final int BUFFER_SIZE = 16 * 1024;
|
|
@@ -80,14 +80,14 @@ public class MapLocalTile extends MapFeature {
|
|
|
80
80
|
|
|
81
81
|
private TileOverlayOptions tileOverlayOptions;
|
|
82
82
|
private TileOverlay tileOverlay;
|
|
83
|
-
private
|
|
83
|
+
private AirMapLocalTile.AIRMapLocalTileProvider tileProvider;
|
|
84
84
|
|
|
85
85
|
private String pathTemplate;
|
|
86
86
|
private float tileSize;
|
|
87
87
|
private float zIndex;
|
|
88
88
|
private boolean useAssets;
|
|
89
89
|
|
|
90
|
-
public
|
|
90
|
+
public AirMapLocalTile(Context context) {
|
|
91
91
|
super(context);
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -129,7 +129,7 @@ public class MapLocalTile extends MapFeature {
|
|
|
129
129
|
private TileOverlayOptions createTileOverlayOptions() {
|
|
130
130
|
TileOverlayOptions options = new TileOverlayOptions();
|
|
131
131
|
options.zIndex(zIndex);
|
|
132
|
-
this.tileProvider = new
|
|
132
|
+
this.tileProvider = new AirMapLocalTile.AIRMapLocalTileProvider((int)this.tileSize, this.pathTemplate, this.useAssets);
|
|
133
133
|
options.tileProvider(this.tileProvider);
|
|
134
134
|
return options;
|
|
135
135
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
import android.util.DisplayMetrics;
|
|
@@ -12,9 +12,9 @@ import com.facebook.react.uimanager.annotations.ReactProp;
|
|
|
12
12
|
/**
|
|
13
13
|
* Created by zavadpe on 30/11/2017.
|
|
14
14
|
*/
|
|
15
|
-
public class
|
|
15
|
+
public class AirMapLocalTileManager extends ViewGroupManager<AirMapLocalTile> {
|
|
16
16
|
|
|
17
|
-
public
|
|
17
|
+
public AirMapLocalTileManager(ReactApplicationContext reactContext) {
|
|
18
18
|
super();
|
|
19
19
|
DisplayMetrics metrics = new DisplayMetrics();
|
|
20
20
|
((WindowManager) reactContext.getSystemService(Context.WINDOW_SERVICE))
|
|
@@ -28,27 +28,27 @@ public class MapLocalTileManager extends ViewGroupManager<MapLocalTile> {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
@Override
|
|
31
|
-
public
|
|
32
|
-
return new
|
|
31
|
+
public AirMapLocalTile createViewInstance(ThemedReactContext context) {
|
|
32
|
+
return new AirMapLocalTile(context);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
@ReactProp(name = "pathTemplate")
|
|
36
|
-
public void setPathTemplate(
|
|
36
|
+
public void setPathTemplate(AirMapLocalTile view, String pathTemplate) {
|
|
37
37
|
view.setPathTemplate(pathTemplate);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
@ReactProp(name = "tileSize", defaultFloat = 256f)
|
|
41
|
-
public void setTileSize(
|
|
41
|
+
public void setTileSize(AirMapLocalTile view, float tileSize) {
|
|
42
42
|
view.setTileSize(tileSize);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
@ReactProp(name = "zIndex", defaultFloat = -1.0f)
|
|
46
|
-
public void setZIndex(
|
|
46
|
+
public void setZIndex(AirMapLocalTile view, float zIndex) {
|
|
47
47
|
view.setZIndex(zIndex);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
@ReactProp(name = "useAssets", defaultBoolean = false)
|
|
51
|
-
public void setUseAssets(
|
|
51
|
+
public void setUseAssets(AirMapLocalTile view, boolean useAssets) {
|
|
52
52
|
view.setUseAssets(useAssets);
|
|
53
53
|
}
|
|
54
54
|
}
|