From bf5f0a3f5ba51e8f5044f6f72680d71a677e7c26 Mon Sep 17 00:00:00 2001 From: Leland Richardson Date: Tue, 4 Apr 2017 18:19:39 -0700 Subject: [PATCH 01/24] Fix getResources() null crash in mapview --- .../airbnb/android/react/maps/AirMapView.java | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java b/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java index 0c8604f26..772627e4a 100644 --- a/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java +++ b/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java @@ -1,5 +1,7 @@ package com.airbnb.android.react.maps; +import android.app.Activity; +import android.content.Context; import android.content.pm.PackageManager; import android.content.res.ColorStateList; import android.graphics.Bitmap; @@ -85,9 +87,38 @@ public class AirMapView extends MapView implements GoogleMap.InfoWindowAdapter, private final ThemedReactContext context; private final EventDispatcher eventDispatcher; + private static boolean contextHasBug(Context context) { + return context == null || + context.getResources() == null || + context.getResources().getConfiguration() == null; + } + + // We do this to fix this bug: + // https://github.com/airbnb/react-native-maps/issues/271 + // + // which conflicts with another bug regarding the passed in context: + // https://github.com/airbnb/react-native-maps/issues/1147 + // + // Doing this allows us to avoid both bugs. + private static Context getNonBuggyContext(ThemedReactContext reactContext) { + Context superContext = reactContext; + + if (contextHasBug(superContext)) { + // we have the bug! let's try to find a better context to use + if (!contextHasBug(reactContext.getCurrentActivity())) { + superContext = reactContext.getCurrentActivity(); + } else if (!contextHasBug(reactContext.getApplicationContext())) { + superContext = reactContext.getApplicationContext(); + } else { + // ¯\_(ツ)_/¯ + } + } + return superContext; + } + public AirMapView(ThemedReactContext reactContext, AirMapManager manager, GoogleMapOptions googleMapOptions) { - super(reactContext, googleMapOptions); + super(getNonBuggyContext(reactContext), googleMapOptions); this.manager = manager; this.context = reactContext; From 4849de52b2af70225c8bf3393fc3452f186acd07 Mon Sep 17 00:00:00 2001 From: Leland Richardson Date: Tue, 4 Apr 2017 18:41:01 -0700 Subject: [PATCH 02/24] v0.14.0 --- CHANGELOG.md | 43 +++++++++++++++++++++++++++++++++++ lib/android/gradle.properties | 2 +- package.json | 2 +- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6e3ab5c3..5c13e5ba0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,48 @@ # Change Log +## 0.14.0 (April 4, 2017) + +## Enhancements + +* Restructure project #1164 + +* Add showsIndoorLevelPicker -> setIndoorLevelPickerEnabled to MapView #1019 +[#1188](https://github.com/airbnb/react-native-maps/pull/1188) + +* iOS - Added onPress support for Polygons on Google Maps +[#1024](https://github.com/airbnb/react-native-maps/pull/1024) + +* Add customized user location annotation text +[#1049](https://github.com/airbnb/react-native-maps/pull/1049) + +* iOS - Google Maps - Add `showsMyLocationButton` support +[#1157](https://github.com/airbnb/react-native-maps/pull/1157) + + +## Patches + +* Fix getResources() null crash in mapview +[#1188](https://github.com/airbnb/react-native-maps/pull/1188) + +* Rename MapKit category to avoid conflicts with the one in RN +[#1172](https://github.com/airbnb/react-native-maps/pull/1172) + +* Upgrade GMS dependencies to 10.2.0 +[#1169](https://github.com/airbnb/react-native-maps/pull/1169) + +* fix multiple-instance memory leak +[#1130](https://github.com/airbnb/react-native-maps/pull/1130) + +* fix onSelected event for markers with custom view +[#1079](https://github.com/airbnb/react-native-maps/pull/1079) + +* Crash in our App fix +[#1096](https://github.com/airbnb/react-native-maps/pull/1096) + +* Use local RCTConvert+MapKit instead of the one in React Native +[#1138](https://github.com/airbnb/react-native-maps/pull/1138) + + ## 0.13.1 (March 21, 2017) diff --git a/lib/android/gradle.properties b/lib/android/gradle.properties index cfe4fd7d4..9a87aa52e 100644 --- a/lib/android/gradle.properties +++ b/lib/android/gradle.properties @@ -1,5 +1,5 @@ VERSION_CODE=4 -VERSION_NAME=0.13.1 +VERSION_NAME=0.14.0 GROUP=com.airbnb.android POM_DESCRIPTION=React Native Map view component for Android diff --git a/package.json b/package.json index 70224da44..9bbc2e1dd 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "React Native Mapview component for iOS + Android", "main": "index.js", "author": "Leland Richardson ", - "version": "0.13.1", + "version": "0.14.0", "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "run:packager": "./node_modules/react-native/packager/packager.sh", From 4b861c949a079a393f48a485943d3a506a151ac0 Mon Sep 17 00:00:00 2001 From: Rob Hogan Date: Thu, 4 May 2017 20:23:41 +0100 Subject: [PATCH 03/24] pbxproj: RCTConvert+MapKit -> RCTConvert+AirMap (#1195) --- lib/ios/AirMaps.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ios/AirMaps.xcodeproj/project.pbxproj b/lib/ios/AirMaps.xcodeproj/project.pbxproj index 39b1256e2..ac641aff7 100644 --- a/lib/ios/AirMaps.xcodeproj/project.pbxproj +++ b/lib/ios/AirMaps.xcodeproj/project.pbxproj @@ -21,7 +21,7 @@ 1125B2E51C4AD3DA007D0023 /* AIRMapPolyline.m in Sources */ = {isa = PBXBuildFile; fileRef = 1125B2D41C4AD3DA007D0023 /* AIRMapPolyline.m */; }; 1125B2E61C4AD3DA007D0023 /* AIRMapPolylineManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1125B2D61C4AD3DA007D0023 /* AIRMapPolylineManager.m */; }; 1125B2F21C4AD445007D0023 /* SMCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1125B2F11C4AD445007D0023 /* SMCalloutView.m */; }; - 19DABC7F1E7C9D3C00F41150 /* RCTConvert+MapKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DABC7E1E7C9D3C00F41150 /* RCTConvert+MapKit.m */; }; + 19DABC7F1E7C9D3C00F41150 /* RCTConvert+AirMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DABC7E1E7C9D3C00F41150 /* RCTConvert+AirMap.m */; }; DA6C26381C9E2AFE0035349F /* AIRMapUrlTile.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6C26371C9E2AFE0035349F /* AIRMapUrlTile.m */; }; DA6C263E1C9E324A0035349F /* AIRMapUrlTileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6C263D1C9E324A0035349F /* AIRMapUrlTileManager.m */; }; /* End PBXBuildFile section */ @@ -68,8 +68,8 @@ 1125B2F01C4AD445007D0023 /* SMCalloutView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SMCalloutView.h; path = AirMaps/Callout/SMCalloutView.h; sourceTree = SOURCE_ROOT; }; 1125B2F11C4AD445007D0023 /* SMCalloutView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SMCalloutView.m; path = AirMaps/Callout/SMCalloutView.m; sourceTree = SOURCE_ROOT; }; 11FA5C511C4A1296003AC2EE /* libAirMaps.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAirMaps.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 19DABC7D1E7C9D3C00F41150 /* RCTConvert+MapKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+MapKit.h"; sourceTree = ""; }; - 19DABC7E1E7C9D3C00F41150 /* RCTConvert+MapKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+MapKit.m"; sourceTree = ""; }; + 19DABC7D1E7C9D3C00F41150 /* RCTConvert+AirMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+AirMap.h"; sourceTree = ""; }; + 19DABC7E1E7C9D3C00F41150 /* RCTConvert+AirMap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+AirMap.m"; sourceTree = ""; }; DA6C26361C9E2AFE0035349F /* AIRMapUrlTile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AIRMapUrlTile.h; sourceTree = ""; }; DA6C26371C9E2AFE0035349F /* AIRMapUrlTile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AIRMapUrlTile.m; sourceTree = ""; }; DA6C263C1C9E324A0035349F /* AIRMapUrlTileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AIRMapUrlTileManager.h; sourceTree = ""; }; @@ -134,8 +134,8 @@ 1125B2D61C4AD3DA007D0023 /* AIRMapPolylineManager.m */, 1125B2F01C4AD445007D0023 /* SMCalloutView.h */, 1125B2F11C4AD445007D0023 /* SMCalloutView.m */, - 19DABC7D1E7C9D3C00F41150 /* RCTConvert+MapKit.h */, - 19DABC7E1E7C9D3C00F41150 /* RCTConvert+MapKit.m */, + 19DABC7D1E7C9D3C00F41150 /* RCTConvert+AirMap.h */, + 19DABC7E1E7C9D3C00F41150 /* RCTConvert+AirMap.m */, DA6C26361C9E2AFE0035349F /* AIRMapUrlTile.h */, DA6C26371C9E2AFE0035349F /* AIRMapUrlTile.m */, DA6C263C1C9E324A0035349F /* AIRMapUrlTileManager.h */, @@ -206,7 +206,7 @@ 1125B2E01C4AD3DA007D0023 /* AIRMapManager.m in Sources */, 1125B2E61C4AD3DA007D0023 /* AIRMapPolylineManager.m in Sources */, 1125B2DD1C4AD3DA007D0023 /* AIRMapCircle.m in Sources */, - 19DABC7F1E7C9D3C00F41150 /* RCTConvert+MapKit.m in Sources */, + 19DABC7F1E7C9D3C00F41150 /* RCTConvert+AirMap.m in Sources */, 1125B2E51C4AD3DA007D0023 /* AIRMapPolyline.m in Sources */, DA6C263E1C9E324A0035349F /* AIRMapUrlTileManager.m in Sources */, 1125B2DA1C4AD3DA007D0023 /* AIRMap.m in Sources */, From fe906e51511fb70d6087411f4af25f7754c1d160 Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Thu, 4 May 2017 15:24:47 -0400 Subject: [PATCH 04/24] Add the `lib` folder in the docs (#1293) --- docs/installation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index d3b6c331c..c2e1dc488 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -25,9 +25,9 @@ react-native link react-native-maps (If you do not need `GoogleMaps` support for iOS, then you can probably completely skip this step.) 1. Open your project in Xcode workspace 1. If you need `GoogleMaps` support also - - Drag this folder `node_modules/react-native-maps/ios/AirGoogleMaps/` into your project, and choose `Create groups` in the popup window. + - Drag this folder `node_modules/react-native-maps/lib/ios/AirGoogleMaps/` into your project, and choose `Create groups` in the popup window. - In `AppDelegate.m`, add `@import GoogleMaps;` before `@implementation AppDelegate`. In `- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions`, add `[GMSServices provideAPIKey:@"YOUR_GOOGLE_MAP_API_KEY"];` - - In your project's `Build Settings` > `Header Search Paths`, double click the value field. In the popup, add `$(SRCROOT)/../node_modules/react-native-maps/ios/AirMaps` and change `non-recursive` to `recursive`. (Dragging the folder `node_modules/react-native-maps/ios/AirMaps/` into your project introduces duplicate symbols. We should not do it.) + - In your project's `Build Settings` > `Header Search Paths`, double click the value field. In the popup, add `$(SRCROOT)/../node_modules/react-native-maps/lib/ios/AirMaps` and change `non-recursive` to `recursive`. (Dragging the folder `node_modules/react-native-maps/lib/ios/AirMaps/` into your project introduces duplicate symbols. We should not do it.) Note: We recommend using a version of React Native >= .40. Newer versions (>= .40) require `package.json` to be set to `"react-native-maps": "^0.13.0"`, while older versions require `"react-native-maps": "^0.12.4"`. From 78a38cd67aef57b8da8e9a63848be87a5cfa6bb1 Mon Sep 17 00:00:00 2001 From: Todd Williams Date: Thu, 4 May 2017 12:25:56 -0700 Subject: [PATCH 05/24] Update path in android installation (#1249) I was having trouble compiling the android version but updating the project directory resolved it for me. --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index c2e1dc488..31c69cf43 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -98,7 +98,7 @@ After your `Podfile` is setup properly, run `pod install`. ```groovy ... include ':react-native-maps' - project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/android') + project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android') ``` 1. Specify your Google Maps API Key: From 1478c04b228c3381b82c6e9738962c6ef872dc22 Mon Sep 17 00:00:00 2001 From: Sam Corcos Date: Thu, 4 May 2017 12:27:23 -0700 Subject: [PATCH 06/24] Update docs to specify how to access event data (#1178) resolves #1136 --- docs/mapview.md | 8 +++++--- docs/marker.md | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/mapview.md b/docs/mapview.md index 8e73a0773..3df5640c3 100644 --- a/docs/mapview.md +++ b/docs/mapview.md @@ -9,7 +9,7 @@ | `initialRegion` | `Region` | | The initial region to be displayed by the map. Use this prop instead of `region` only if you don't want to control the viewport of the map besides the initial region.

Changing this prop after the component has mounted will not result in a region change.

This is similar to the `initialValue` prop of a text input. | `liteMode` | `Boolean` | `false` | Enable lite mode. **Note**: Android only. | `mapType` | `String` | `"standard"` | The map type to be displayed.

- standard: standard road map (default)
- satellite: satellite view
- hybrid: satellite view with roads and points of interest overlayed
- terrain: (Android only) topographic view -| `customMapStyle` | `Array` | | Adds custom styling to the map component. See [README](https://github.com/airbnb/react-native-maps#customizing-the-map-style) for more information. +| `customMapStyle` | `Array` | | Adds custom styling to the map component. See [README](https://github.com/airbnb/react-native-maps#customizing-the-map-style) for more information. | `showsUserLocation` | `Boolean` | `false` | If `true` the app will ask for the user's location. **NOTE**: You need to add `NSLocationWhenInUseUsageDescription` key in Info.plist to enable geolocation, otherwise it is going to *fail silently*! | `userLocationAnnotationTitle` | `String` | | The title of the annotation for current user location. This only works if `showsUserLocation` is true. There is a default value `My Location` set by MapView. **Note**: iOS only. | `followsUserLocation` | `Boolean` | `false` | If `true` the map will focus on the user's location. This only works if `showsUserLocation` is true and the user has shared their location. **Note**: iOS only. @@ -36,6 +36,8 @@ ## Events +To access event data, you will need to use `e.nativeEvent`. For example, `onPress={e => console.log(e.nativeEvent)}` will log the entire event object to your console. + | Event Name | Returns | Notes |---|---|---| | `onRegionChange` | `Region` | Callback that is called continuously when the region changes, such as when a user is dragging the map. @@ -59,9 +61,9 @@ |---|---|---| | `animateToRegion` | `region: Region`, `duration: Number` | | `animateToCoordinate` | `coordinate: LatLng`, `duration: Number` | -| `fitToElements` | `animated: Boolean` | +| `fitToElements` | `animated: Boolean` | | `fitToSuppliedMarkers` | `markerIDs: String[]`, `animated: Boolean` | If you need to use this in `ComponentDidMount`, make sure you put it in a timeout or it will cause performance problems. -| `fitToCoordinates` | `coordinates: Array, options: { edgePadding: EdgePadding, animated: Boolean }` | If called in `ComponentDidMount` in android, it will cause an exception. It is recommended to call it from the MapView `onLayout` event. +| `fitToCoordinates` | `coordinates: Array, options: { edgePadding: EdgePadding, animated: Boolean }` | If called in `ComponentDidMount` in android, it will cause an exception. It is recommended to call it from the MapView `onLayout` event. diff --git a/docs/marker.md b/docs/marker.md index 4246befc3..16ad49f40 100644 --- a/docs/marker.md +++ b/docs/marker.md @@ -20,6 +20,8 @@ ## Events +To access event data, you will need to use `e.nativeEvent`. For example, `onPress={e => console.log(e.nativeEvent)}` will log the entire event object to your console. + | Event Name | Returns | Notes |---|---|---| | `onPress` | `{ coordinate: LatLng, position: Point }` | Callback that is called when the user presses on the marker From e4a657e568f8beb15cfd715aa49795e24df7c627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Pomyka=C5=82a?= Date: Thu, 4 May 2017 21:27:56 +0200 Subject: [PATCH 07/24] Update installation.md (#1179) --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 31c69cf43..4edb9bfb1 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -203,7 +203,7 @@ Enter the name of the API key and create it. 1. Clean the cache : ``` watchman watch-del-all - npm cache clean + npm clean cache ``` 1. When starting emulator, make sure you have enabled `Wipe user data`. From 36a36917e4897c934b5bfe9cbaf1a63f87637e8e Mon Sep 17 00:00:00 2001 From: Yang Li Date: Fri, 5 May 2017 03:29:06 +0800 Subject: [PATCH 08/24] Add babelrc to npmignore (#1246) --- .npmignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.npmignore b/.npmignore index 33a9488b1..4ce7bc58b 100644 --- a/.npmignore +++ b/.npmignore @@ -1 +1,2 @@ example +.babelrc From 0eb1933e665348a315fbe2756ae962f112d96e75 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Fri, 5 May 2017 02:29:36 +0700 Subject: [PATCH 09/24] Fixed path in `android/settings.gradle` (#1230) From 8f6d866c7b0dbd1b1373b2d821c4149373806677 Mon Sep 17 00:00:00 2001 From: Aaron Leonard Date: Thu, 4 May 2017 12:29:51 -0700 Subject: [PATCH 10/24] Update installation.md (#1226) Update the paths to the `android` and `ios` folders to match the new structure --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 4edb9bfb1..49cf6d447 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -52,7 +52,7 @@ After your `Podfile` is setup properly, run `pod install`. >This was already done for you if you ran "react-native link" 1. Open your project in Xcode, right click on `Libraries` and click `Add - Files to "Your Project Name"` Look under `node_modules/react-native-maps/ios` and add `AIRMaps.xcodeproj`. + Files to "Your Project Name"` Look under `node_modules/react-native-maps/lib/ios` and add `AIRMaps.xcodeproj`. 1. Add `libAIRMaps.a` to `Build Phases -> Link Binary With Libraries. 1. Click on `AIRMaps.xcodeproj` in `Libraries` and go the `Build Settings` tab. Double click the text to the right of `Header Search From 88a732fc518fcc0a5a58d03fff56de9761bc04a1 Mon Sep 17 00:00:00 2001 From: Golam Rabbani Date: Fri, 5 May 2017 01:31:29 +0600 Subject: [PATCH 11/24] small typo fixed (#1211) --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 49cf6d447..27614b6ff 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -213,7 +213,7 @@ Enter the name of the API key and create it. 1. If you encounter `com.android.dex.DexException: Multiple dex files define Landroid/support/v7/appcompat/R$anim`, then clear build folder. ``` cd android - gradlew clean + ./gradlew clean cd .. ``` From 1bbdcb7a2c10d55b0fc0944038fa18840b93c107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Caba=C5=82a?= Date: Thu, 4 May 2017 21:40:22 +0200 Subject: [PATCH 12/24] fixing code snippet (#1196) the path to project dir is no longer up-to-date From 0dcdebdfe20c292bcf6d66401afda1d559ee6f09 Mon Sep 17 00:00:00 2001 From: Felipe Lima Date: Mon, 8 May 2017 11:27:07 -0700 Subject: [PATCH 13/24] v0.15.0 (#1305) * Prepare for v0.15 release * Add changelog * Fix link to PR --- CHANGELOG.md | 5 +++++ build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- lib/android/build.gradle | 4 ++-- lib/android/gradle.properties | 2 +- package.json | 2 +- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c13e5ba0..0af766a02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 0.15.0 (May 8, 2017) + +* iOS: [#1195]((https://github.com/airbnb/react-native-maps/pull/1195) Rename project file to fix iOS build error +* Android: Update Google Play Services to version `10.2.4` + ## 0.14.0 (April 4, 2017) ## Enhancements diff --git a/build.gradle b/build.gradle index f89d2c594..8a3e2453e 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.0' + classpath 'com.android.tools.build:gradle:2.3.1' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3b6c26cf7..c21e471fc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Mar 02 17:03:11 PST 2017 +#Mon May 08 11:03:28 PDT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip diff --git a/lib/android/build.gradle b/lib/android/build.gradle index 85cb5b4d2..434e63e72 100644 --- a/lib/android/build.gradle +++ b/lib/android/build.gradle @@ -35,6 +35,6 @@ android { dependencies { provided "com.facebook.react:react-native:+" - compile "com.google.android.gms:play-services-base:10.2.0" - compile "com.google.android.gms:play-services-maps:10.2.0" + compile "com.google.android.gms:play-services-base:10.2.4" + compile "com.google.android.gms:play-services-maps:10.2.4" } diff --git a/lib/android/gradle.properties b/lib/android/gradle.properties index 9a87aa52e..2d7a31b06 100644 --- a/lib/android/gradle.properties +++ b/lib/android/gradle.properties @@ -1,5 +1,5 @@ VERSION_CODE=4 -VERSION_NAME=0.14.0 +VERSION_NAME=0.15.0 GROUP=com.airbnb.android POM_DESCRIPTION=React Native Map view component for Android diff --git a/package.json b/package.json index 9bbc2e1dd..de8063b3b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "React Native Mapview component for iOS + Android", "main": "index.js", "author": "Leland Richardson ", - "version": "0.14.0", + "version": "0.15.0", "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "run:packager": "./node_modules/react-native/packager/packager.sh", From 7bba6f939f425865cf917fc3b65fdf63533dcbd1 Mon Sep 17 00:00:00 2001 From: frmdstryr Date: Thu, 11 May 2017 12:45:49 -0400 Subject: [PATCH 14/24] Fix overlay issues in Android introduced in 0.13.1 (#1311) * Update AirMapView.java * Update AirMapManager.java * Update AirMapView.java --- .../airbnb/android/react/maps/AirMapManager.java | 2 +- .../com/airbnb/android/react/maps/AirMapView.java | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapManager.java b/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapManager.java index 3ac1f4de7..b6a975b77 100644 --- a/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapManager.java +++ b/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapManager.java @@ -59,7 +59,7 @@ public String getName() { @Override protected AirMapView createViewInstance(ThemedReactContext context) { - return new AirMapView(context, this, googleMapOptions); + return new AirMapView(context, this.appContext, this, googleMapOptions); } private void emitMapError(ThemedReactContext context, String message, String type) { diff --git a/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java b/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java index 772627e4a..3225bf1ff 100644 --- a/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java +++ b/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java @@ -22,6 +22,7 @@ import android.widget.RelativeLayout; import com.facebook.react.bridge.LifecycleEventListener; +import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.WritableMap; @@ -100,10 +101,12 @@ private static boolean contextHasBug(Context context) { // https://github.com/airbnb/react-native-maps/issues/1147 // // Doing this allows us to avoid both bugs. - private static Context getNonBuggyContext(ThemedReactContext reactContext) { + private static Context getNonBuggyContext(ThemedReactContext reactContext, + ReactApplicationContext appContext) { Context superContext = reactContext; - - if (contextHasBug(superContext)) { + if (!contextHasBug(appContext.getCurrentActivity())) { + superContext = appContext.getCurrentActivity(); + } else if (contextHasBug(superContext)) { // we have the bug! let's try to find a better context to use if (!contextHasBug(reactContext.getCurrentActivity())) { superContext = reactContext.getCurrentActivity(); @@ -116,9 +119,9 @@ private static Context getNonBuggyContext(ThemedReactContext reactContext) { return superContext; } - public AirMapView(ThemedReactContext reactContext, AirMapManager manager, - GoogleMapOptions googleMapOptions) { - super(getNonBuggyContext(reactContext), googleMapOptions); + public AirMapView(ThemedReactContext reactContext, ReactApplicationContext appContext, AirMapManager manager, + GoogleMapOptions googleMapOptions) { + super(getNonBuggyContext(reactContext, appContext), googleMapOptions); this.manager = manager; this.context = reactContext; From 65d27913bbae2570c7e7b3dc28a55c8bfdd09d99 Mon Sep 17 00:00:00 2001 From: Ulydev Date: Thu, 11 May 2017 18:47:03 +0200 Subject: [PATCH 15/24] Update license date (#1316) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 41139a4a0..13d793926 100644 --- a/README.md +++ b/README.md @@ -494,7 +494,7 @@ Good: License -------- - Copyright (c) 2015 Airbnb + Copyright (c) 2017 Airbnb Licensed under the The MIT License (MIT) (the "License"); you may not use this file except in compliance with the License. From ca7eee1b59182ea02fd0f92b1cbbdc9bff7b9b8c Mon Sep 17 00:00:00 2001 From: Christopher Dro Date: Thu, 11 May 2017 09:48:21 -0700 Subject: [PATCH 16/24] [rnpm] Fix sourceDir for Android (#1313) Overlooked this change closing out a few PR's last week. Follow up for #1200 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index de8063b3b..766c2a967 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ }, "rnpm": { "android": { - "sourceDir": "./android" + "sourceDir": "./lib/android" } } } From 535f599c5d823f5f6cfe9d1c78f147371156dcce Mon Sep 17 00:00:00 2001 From: Guilherme Pontes Date: Fri, 19 May 2017 18:45:48 +0200 Subject: [PATCH 17/24] [iOS] Added onPress support for Polyline on Google Maps (#1194) --- example/examples/EventListener.js | 1 + lib/components/MapPolyline.js | 5 +++++ lib/ios/AirGoogleMaps/AIRGMSPolyline.h | 16 ++++++++++++++++ lib/ios/AirGoogleMaps/AIRGMSPolyline.m | 11 +++++++++++ lib/ios/AirGoogleMaps/AIRGoogleMap.h | 1 + lib/ios/AirGoogleMaps/AIRGoogleMap.m | 10 ++++++++++ lib/ios/AirGoogleMaps/AIRGoogleMapPolyline.h | 9 ++++++++- lib/ios/AirGoogleMaps/AIRGoogleMapPolyline.m | 17 ++++++++++++++--- .../AirGoogleMaps/AIRGoogleMapPolylineManager.m | 3 +++ lib/ios/AirMaps.xcodeproj/project.pbxproj | 6 ++++++ 10 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 lib/ios/AirGoogleMaps/AIRGMSPolyline.h create mode 100644 lib/ios/AirGoogleMaps/AIRGMSPolyline.m diff --git a/example/examples/EventListener.js b/example/examples/EventListener.js index 005894a0d..c8d3e937f 100644 --- a/example/examples/EventListener.js +++ b/example/examples/EventListener.js @@ -145,6 +145,7 @@ class EventListener extends React.Component { +#import "UIView+React.h" + +@class AIRGoogleMapPolyline; + +@interface AIRGMSPolyline : GMSPolyline +@property (nonatomic, strong) NSString *identifier; +@property (nonatomic, copy) RCTBubblingEventBlock onPress; +@end diff --git a/lib/ios/AirGoogleMaps/AIRGMSPolyline.m b/lib/ios/AirGoogleMaps/AIRGMSPolyline.m new file mode 100644 index 000000000..86e7ac055 --- /dev/null +++ b/lib/ios/AirGoogleMaps/AIRGMSPolyline.m @@ -0,0 +1,11 @@ +// +// AIRGMSPolyline.m +// AirMaps +// +// Created by Guilherme Pontes 04/05/2017. +// + +#import "AIRGMSPolyline.h" + +@implementation AIRGMSPolyline +@end diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMap.h b/lib/ios/AirGoogleMaps/AIRGoogleMap.h index 9e6ae8b79..0e9554eb6 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMap.h +++ b/lib/ios/AirGoogleMaps/AIRGoogleMap.h @@ -41,6 +41,7 @@ @property (nonatomic, assign) BOOL showsMyLocationButton; - (BOOL)didTapMarker:(GMSMarker *)marker; +- (void)didTapPolyline:(GMSPolyline *)polyline; - (void)didTapPolygon:(GMSPolygon *)polygon; - (void)didTapAtCoordinate:(CLLocationCoordinate2D)coordinate; - (void)didLongPressAtCoordinate:(CLLocationCoordinate2D)coordinate; diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMap.m b/lib/ios/AirGoogleMaps/AIRGoogleMap.m index ca15da04e..ef73067b6 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMap.m +++ b/lib/ios/AirGoogleMaps/AIRGoogleMap.m @@ -170,6 +170,16 @@ - (BOOL)didTapMarker:(GMSMarker *)marker { return NO; } +- (void)didTapPolyline:(GMSOverlay *)polyline { + AIRGMSPolyline *airPolyline = (AIRGMSPolyline *)polyline; + + id event = @{@"action": @"polyline-press", + @"id": airPolyline.identifier ?: @"unknown", + }; + + if (airPolyline.onPress) airPolyline.onPress(event); +} + - (void)didTapPolygon:(GMSOverlay *)polygon { AIRGMSPolygon *airPolygon = (AIRGMSPolygon *)polygon; diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMapPolyline.h b/lib/ios/AirGoogleMaps/AIRGoogleMapPolyline.h index b127567a5..adebc40d6 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMapPolyline.h +++ b/lib/ios/AirGoogleMaps/AIRGoogleMapPolyline.h @@ -5,18 +5,25 @@ // #import #import +#import +#import "AIRGMSPolyline.h" #import "AIRMapCoordinate.h" #import "AIRGoogleMapMarker.h" @interface AIRGoogleMapPolyline : UIView -@property (nonatomic, strong) GMSPolyline* polyline; +@property (nonatomic, weak) RCTBridge *bridge; +@property (nonatomic, strong) NSString *identifier; +@property (nonatomic, strong) AIRGMSPolyline *polyline; @property (nonatomic, strong) NSArray *coordinates; +@property (nonatomic, copy) RCTBubblingEventBlock onPress; + @property (nonatomic, strong) UIColor *strokeColor; @property (nonatomic, assign) double strokeWidth; @property (nonatomic, assign) UIColor *fillColor; @property (nonatomic, assign) BOOL geodesic; @property (nonatomic, assign) NSString *title; @property (nonatomic, assign) int zIndex; +@property (nonatomic, assign) BOOL tappable; @end diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMapPolyline.m b/lib/ios/AirGoogleMaps/AIRGoogleMapPolyline.m index 009d90bfb..881f17be6 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMapPolyline.m +++ b/lib/ios/AirGoogleMaps/AIRGoogleMapPolyline.m @@ -5,6 +5,7 @@ // #import #import "AIRGoogleMapPolyline.h" +#import "AIRGMSPolyline.h" #import "AIRMapCoordinate.h" #import "AIRGoogleMapMarker.h" #import "AIRGoogleMapMarkerManager.h" @@ -16,7 +17,7 @@ @implementation AIRGoogleMapPolyline - (instancetype)init { if (self = [super init]) { - _polyline = [[GMSPolyline alloc] init]; + _polyline = [[AIRGMSPolyline alloc] init]; } return self; } @@ -24,13 +25,13 @@ - (instancetype)init -(void)setCoordinates:(NSArray *)coordinates { _coordinates = coordinates; - + GMSMutablePath *path = [GMSMutablePath path]; for(int i = 0; i < coordinates.count; i++) { [path addCoordinate:coordinates[i].coordinate]; } - + _polyline.path = path; } @@ -70,4 +71,14 @@ -(void) setZIndex:(int)zIndex _polyline.zIndex = zIndex; } +-(void)setTappable:(BOOL)tappable +{ + _tappable = tappable; + _polyline.tappable = tappable; +} + +- (void)setOnPress:(RCTBubblingEventBlock)onPress { + _polyline.onPress = onPress; +} + @end diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m b/lib/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m index acad1631b..a7515c207 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m +++ b/lib/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m @@ -26,6 +26,7 @@ @implementation AIRGoogleMapPolylineManager - (UIView *)view { AIRGoogleMapPolyline *polyline = [AIRGoogleMapPolyline new]; + polyline.bridge = self.bridge; return polyline; } @@ -35,5 +36,7 @@ - (UIView *)view RCT_EXPORT_VIEW_PROPERTY(strokeWidth, double) RCT_EXPORT_VIEW_PROPERTY(geodesic, BOOL) RCT_EXPORT_VIEW_PROPERTY(zIndex, int) +RCT_EXPORT_VIEW_PROPERTY(tappable, BOOL) +RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock) @end diff --git a/lib/ios/AirMaps.xcodeproj/project.pbxproj b/lib/ios/AirMaps.xcodeproj/project.pbxproj index ac641aff7..19a7213ff 100644 --- a/lib/ios/AirMaps.xcodeproj/project.pbxproj +++ b/lib/ios/AirMaps.xcodeproj/project.pbxproj @@ -22,6 +22,7 @@ 1125B2E61C4AD3DA007D0023 /* AIRMapPolylineManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1125B2D61C4AD3DA007D0023 /* AIRMapPolylineManager.m */; }; 1125B2F21C4AD445007D0023 /* SMCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1125B2F11C4AD445007D0023 /* SMCalloutView.m */; }; 19DABC7F1E7C9D3C00F41150 /* RCTConvert+AirMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DABC7E1E7C9D3C00F41150 /* RCTConvert+AirMap.m */; }; + 9B0F3F7C1E9526A30001804F /* AIRGMSPolyline.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0F3F7B1E9526A30001804F /* AIRGMSPolyline.m */; }; DA6C26381C9E2AFE0035349F /* AIRMapUrlTile.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6C26371C9E2AFE0035349F /* AIRMapUrlTile.m */; }; DA6C263E1C9E324A0035349F /* AIRMapUrlTileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6C263D1C9E324A0035349F /* AIRMapUrlTileManager.m */; }; /* End PBXBuildFile section */ @@ -70,6 +71,8 @@ 11FA5C511C4A1296003AC2EE /* libAirMaps.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAirMaps.a; sourceTree = BUILT_PRODUCTS_DIR; }; 19DABC7D1E7C9D3C00F41150 /* RCTConvert+AirMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+AirMap.h"; sourceTree = ""; }; 19DABC7E1E7C9D3C00F41150 /* RCTConvert+AirMap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+AirMap.m"; sourceTree = ""; }; + 9B0F3F7A1E9526460001804F /* AIRGMSPolyline.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AIRGMSPolyline.h; sourceTree = ""; }; + 9B0F3F7B1E9526A30001804F /* AIRGMSPolyline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AIRGMSPolyline.m; sourceTree = ""; }; DA6C26361C9E2AFE0035349F /* AIRMapUrlTile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AIRMapUrlTile.h; sourceTree = ""; }; DA6C26371C9E2AFE0035349F /* AIRMapUrlTile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AIRMapUrlTile.m; sourceTree = ""; }; DA6C263C1C9E324A0035349F /* AIRMapUrlTileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AIRMapUrlTileManager.h; sourceTree = ""; }; @@ -140,6 +143,8 @@ DA6C26371C9E2AFE0035349F /* AIRMapUrlTile.m */, DA6C263C1C9E324A0035349F /* AIRMapUrlTileManager.h */, DA6C263D1C9E324A0035349F /* AIRMapUrlTileManager.m */, + 9B0F3F7A1E9526460001804F /* AIRGMSPolyline.h */, + 9B0F3F7B1E9526A30001804F /* AIRGMSPolyline.m */, ); path = AirMaps; sourceTree = ""; @@ -202,6 +207,7 @@ files = ( 1125B2E31C4AD3DA007D0023 /* AIRMapPolygon.m in Sources */, 1125B2E41C4AD3DA007D0023 /* AIRMapPolygonManager.m in Sources */, + 9B0F3F7C1E9526A30001804F /* AIRGMSPolyline.m in Sources */, 1125B2DB1C4AD3DA007D0023 /* AIRMapCallout.m in Sources */, 1125B2E01C4AD3DA007D0023 /* AIRMapManager.m in Sources */, 1125B2E61C4AD3DA007D0023 /* AIRMapPolylineManager.m in Sources */, From 76fa0b491effabcd861e4dc2f0cc0a7a76a9c6c8 Mon Sep 17 00:00:00 2001 From: Helge Silset Date: Fri, 19 May 2017 18:46:07 +0200 Subject: [PATCH 18/24] Update README: Use callback in `ref` attribute (#1345) `this.refs`/string as ref is deprecated. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 13d793926..49d65ac72 100644 --- a/README.md +++ b/README.md @@ -405,7 +405,7 @@ getInitialState() { takeSnapshot () { // 'takeSnapshot' takes a config object with the // following options - const snapshot = this.refs.map.takeSnapshot({ + const snapshot = this.map.takeSnapshot({ width: 300, // optional, when omitted the view-width is used height: 300, // optional, when omitted the view-height is used region: {..}, // iOS only, optional region to render @@ -421,7 +421,7 @@ takeSnapshot () { render() { return ( - + { this.map = map }}> From 9676c9cf2ae049bf01a39cc8f4219566858d28e3 Mon Sep 17 00:00:00 2001 From: Taminder Bariana Date: Fri, 19 May 2017 09:47:09 -0700 Subject: [PATCH 19/24] Fixing reference to AirMapsExplorer in installation docs (#1328) --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 27614b6ff..12842d7c6 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -21,7 +21,7 @@ react-native link react-native-maps ### Option 1: CocoaPods - Same as the included AirMapsExplorer example -1. Setup your `Podfile` like the included [example/ios/Podfile](../example/ios/Podfile), replace all references to `AirMapExplorer` with your project name, and then run `pod install`. +1. Setup your `Podfile` like the included [example/ios/Podfile](../example/ios/Podfile), replace all references to `AirMapsExplorer` with your project name, and then run `pod install`. (If you do not need `GoogleMaps` support for iOS, then you can probably completely skip this step.) 1. Open your project in Xcode workspace 1. If you need `GoogleMaps` support also From 4ee7277ebf5c90c53c2d7d591f8f484ef2cd6d02 Mon Sep 17 00:00:00 2001 From: Yann Pringault Date: Fri, 19 May 2017 18:47:51 +0200 Subject: [PATCH 20/24] Add Marker rotation for Google Maps on iOS (#1326) --- docs/marker.md | 2 +- lib/ios/AirGoogleMaps/AIRGoogleMapMarker.h | 1 + lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m | 8 ++++++++ lib/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/marker.md b/docs/marker.md index 16ad49f40..4214e4d6e 100644 --- a/docs/marker.md +++ b/docs/marker.md @@ -15,7 +15,7 @@ | `calloutAnchor` | `Point` | | Specifies the point in the marker image at which to anchor the callout when it is displayed. This is specified in the same coordinate system as the anchor. See the `anchor` prop for more details.

The default is the top middle of the image.

For ios, see the `calloutOffset` prop. | `flat` | `Boolean` | | Sets whether this marker should be flat against the map true or a billboard facing the camera false. | `identifier` | `String` | | An identifier used to reference this marker at a later date. -| `rotation` | `Float` | | A float number indicating marker's rotation angle. +| `rotation` | `Float` | | A float number indicating marker's rotation angle, in degrees. | `draggable` | `` | | This is a non-value based prop. Adding this allows the marker to be draggable (re-positioned). ## Events diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.h b/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.h index 36190e7cb..298884f7d 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.h +++ b/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.h @@ -17,6 +17,7 @@ @property (nonatomic, strong) AIRGoogleMapCallout *calloutView; @property (nonatomic, strong) NSString *identifier; @property (nonatomic, assign) CLLocationCoordinate2D coordinate; +@property (nonatomic, assign) CLLocationDegrees rotation; @property (nonatomic, strong) AIRGMSMarker* realMarker; @property (nonatomic, copy) RCTBubblingEventBlock onPress; @property (nonatomic, copy) RCTDirectEventBlock onDragStart; diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m b/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m index 2c6080e9e..c41be55bb 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m +++ b/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m @@ -157,6 +157,14 @@ - (CLLocationCoordinate2D)coordinate { return _realMarker.position; } +- (void)setRotation:(CLLocationDegrees)rotation { + _realMarker.rotation = rotation; +} + +- (CLLocationDegrees)rotation { + return _realMarker.rotation; +} + - (void)setIdentifier:(NSString *)identifier { _realMarker.identifier = identifier; } diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m b/lib/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m index 8be4ba53e..b5572bf9d 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +++ b/lib/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m @@ -28,6 +28,7 @@ - (UIView *)view RCT_EXPORT_VIEW_PROPERTY(identifier, NSString) RCT_EXPORT_VIEW_PROPERTY(coordinate, CLLocationCoordinate2D) +RCT_EXPORT_VIEW_PROPERTY(rotation, CLLocationDegrees) RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock) RCT_REMAP_VIEW_PROPERTY(image, imageSrc, NSString) RCT_EXPORT_VIEW_PROPERTY(title, NSString) From 08127b40b68127c697fbb8491fd3a7225eed38ae Mon Sep 17 00:00:00 2001 From: yosimasu Date: Sat, 20 May 2017 00:48:07 +0800 Subject: [PATCH 21/24] fix compile error in rn version >= 0.40 (#1341) --- lib/ios/AirGoogleMaps/AIRGMSPolygon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ios/AirGoogleMaps/AIRGMSPolygon.h b/lib/ios/AirGoogleMaps/AIRGMSPolygon.h index 3466b3691..d41c87d5e 100644 --- a/lib/ios/AirGoogleMaps/AIRGMSPolygon.h +++ b/lib/ios/AirGoogleMaps/AIRGMSPolygon.h @@ -6,7 +6,7 @@ // #import -#import "UIView+React.h" +#import @class AIRGoogleMapPolygon; From 0aac50daa0bddecd5e932a324228191d9d02c3e6 Mon Sep 17 00:00:00 2001 From: Christopher Dro Date: Fri, 19 May 2017 13:39:21 -0700 Subject: [PATCH 22/24] v0.15.1 (#1347) --- CHANGELOG.md | 10 +++++++++- lib/android/gradle.properties | 2 +- package.json | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0af766a02..109ce6357 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,16 @@ # Change Log +## 0.15.1 (May 19, 2017) + +* iOS: [#1341](https://github.com/airbnb/react-native-maps/pull/1341) Fix compile error in rn version >= 0.40 +* iOS: [#1194](https://github.com/airbnb/react-native-maps/pull/1194) Add onPress support for Google Maps Polyline +* iOS: [#1326](https://github.com/airbnb/react-native-maps/pull/1326) Add Marker rotation for Google Maps on iOS +* Android: [#1311](https://github.com/airbnb/react-native-maps/pull/1311) Fix overlay issue +* Common [#1313](https://github.com/airbnb/react-native-maps/pull/1313) Fix Android sourceDir for react-native-link + ## 0.15.0 (May 8, 2017) -* iOS: [#1195]((https://github.com/airbnb/react-native-maps/pull/1195) Rename project file to fix iOS build error +* iOS: [#1195](https://github.com/airbnb/react-native-maps/pull/1195) Rename project file to fix iOS build error * Android: Update Google Play Services to version `10.2.4` ## 0.14.0 (April 4, 2017) diff --git a/lib/android/gradle.properties b/lib/android/gradle.properties index 2d7a31b06..ee320ef1f 100644 --- a/lib/android/gradle.properties +++ b/lib/android/gradle.properties @@ -1,5 +1,5 @@ VERSION_CODE=4 -VERSION_NAME=0.15.0 +VERSION_NAME=0.15.1 GROUP=com.airbnb.android POM_DESCRIPTION=React Native Map view component for Android diff --git a/package.json b/package.json index 766c2a967..a188fad59 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "React Native Mapview component for iOS + Android", "main": "index.js", "author": "Leland Richardson ", - "version": "0.15.0", + "version": "0.15.1", "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "run:packager": "./node_modules/react-native/packager/packager.sh", From 8b94984e5192c8083134e434e9740c204b62fcb2 Mon Sep 17 00:00:00 2001 From: Anton Petrov Date: Sat, 20 May 2017 18:46:32 +0300 Subject: [PATCH 23/24] Remove AIRGMSPolyline.h and AIRGMSPolyline.m references from AirMaps.xcodeproj (#1351) --- lib/ios/AirMaps.xcodeproj/project.pbxproj | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/ios/AirMaps.xcodeproj/project.pbxproj b/lib/ios/AirMaps.xcodeproj/project.pbxproj index 19a7213ff..ac641aff7 100644 --- a/lib/ios/AirMaps.xcodeproj/project.pbxproj +++ b/lib/ios/AirMaps.xcodeproj/project.pbxproj @@ -22,7 +22,6 @@ 1125B2E61C4AD3DA007D0023 /* AIRMapPolylineManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1125B2D61C4AD3DA007D0023 /* AIRMapPolylineManager.m */; }; 1125B2F21C4AD445007D0023 /* SMCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1125B2F11C4AD445007D0023 /* SMCalloutView.m */; }; 19DABC7F1E7C9D3C00F41150 /* RCTConvert+AirMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DABC7E1E7C9D3C00F41150 /* RCTConvert+AirMap.m */; }; - 9B0F3F7C1E9526A30001804F /* AIRGMSPolyline.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0F3F7B1E9526A30001804F /* AIRGMSPolyline.m */; }; DA6C26381C9E2AFE0035349F /* AIRMapUrlTile.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6C26371C9E2AFE0035349F /* AIRMapUrlTile.m */; }; DA6C263E1C9E324A0035349F /* AIRMapUrlTileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6C263D1C9E324A0035349F /* AIRMapUrlTileManager.m */; }; /* End PBXBuildFile section */ @@ -71,8 +70,6 @@ 11FA5C511C4A1296003AC2EE /* libAirMaps.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAirMaps.a; sourceTree = BUILT_PRODUCTS_DIR; }; 19DABC7D1E7C9D3C00F41150 /* RCTConvert+AirMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+AirMap.h"; sourceTree = ""; }; 19DABC7E1E7C9D3C00F41150 /* RCTConvert+AirMap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+AirMap.m"; sourceTree = ""; }; - 9B0F3F7A1E9526460001804F /* AIRGMSPolyline.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AIRGMSPolyline.h; sourceTree = ""; }; - 9B0F3F7B1E9526A30001804F /* AIRGMSPolyline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AIRGMSPolyline.m; sourceTree = ""; }; DA6C26361C9E2AFE0035349F /* AIRMapUrlTile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AIRMapUrlTile.h; sourceTree = ""; }; DA6C26371C9E2AFE0035349F /* AIRMapUrlTile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AIRMapUrlTile.m; sourceTree = ""; }; DA6C263C1C9E324A0035349F /* AIRMapUrlTileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AIRMapUrlTileManager.h; sourceTree = ""; }; @@ -143,8 +140,6 @@ DA6C26371C9E2AFE0035349F /* AIRMapUrlTile.m */, DA6C263C1C9E324A0035349F /* AIRMapUrlTileManager.h */, DA6C263D1C9E324A0035349F /* AIRMapUrlTileManager.m */, - 9B0F3F7A1E9526460001804F /* AIRGMSPolyline.h */, - 9B0F3F7B1E9526A30001804F /* AIRGMSPolyline.m */, ); path = AirMaps; sourceTree = ""; @@ -207,7 +202,6 @@ files = ( 1125B2E31C4AD3DA007D0023 /* AIRMapPolygon.m in Sources */, 1125B2E41C4AD3DA007D0023 /* AIRMapPolygonManager.m in Sources */, - 9B0F3F7C1E9526A30001804F /* AIRGMSPolyline.m in Sources */, 1125B2DB1C4AD3DA007D0023 /* AIRMapCallout.m in Sources */, 1125B2E01C4AD3DA007D0023 /* AIRMapManager.m in Sources */, 1125B2E61C4AD3DA007D0023 /* AIRMapPolylineManager.m in Sources */, From 8893578ca6197d0c0a3cacf5aea9c78bfb0a4b99 Mon Sep 17 00:00:00 2001 From: Christopher Dro Date: Sat, 20 May 2017 09:13:35 -0700 Subject: [PATCH 24/24] v0.15.2 (#1352) --- CHANGELOG.md | 4 ++++ lib/android/gradle.properties | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 109ce6357..5968b7e7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 0.15.2 (May 20, 2017) + +* iOS: [#1351](https://github.com/airbnb/react-native-maps/pull/1351) Fix file references + ## 0.15.1 (May 19, 2017) * iOS: [#1341](https://github.com/airbnb/react-native-maps/pull/1341) Fix compile error in rn version >= 0.40 diff --git a/lib/android/gradle.properties b/lib/android/gradle.properties index ee320ef1f..65c67798d 100644 --- a/lib/android/gradle.properties +++ b/lib/android/gradle.properties @@ -1,5 +1,5 @@ VERSION_CODE=4 -VERSION_NAME=0.15.1 +VERSION_NAME=0.15.2 GROUP=com.airbnb.android POM_DESCRIPTION=React Native Map view component for Android diff --git a/package.json b/package.json index a188fad59..30ffc43e8 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "React Native Mapview component for iOS + Android", "main": "index.js", "author": "Leland Richardson ", - "version": "0.15.1", + "version": "0.15.2", "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "run:packager": "./node_modules/react-native/packager/packager.sh",