Skip to content

Commit

Permalink
Merge commit '8893578ca6197d0c0a3cacf5aea9c78bfb0a4b99'
Browse files Browse the repository at this point in the history
* commit '8893578ca6197d0c0a3cacf5aea9c78bfb0a4b99':
  v0.15.2 (react-native-maps#1352)
  Remove AIRGMSPolyline.h and AIRGMSPolyline.m references from AirMaps.xcodeproj (react-native-maps#1351)
  v0.15.1 (react-native-maps#1347)
  fix compile error in rn version >= 0.40 (react-native-maps#1341)
  Add Marker rotation for Google Maps on iOS (react-native-maps#1326)
  Fixing reference to AirMapsExplorer in installation docs (react-native-maps#1328)
  Update README: Use callback in `ref` attribute (react-native-maps#1345)
  [iOS] Added onPress support for Polyline on Google Maps (react-native-maps#1194)
  [rnpm] Fix sourceDir for Android (react-native-maps#1313)
  Update license date (react-native-maps#1316)
  Fix overlay issues in Android introduced in 0.13.1 (react-native-maps#1311)

Conflicts:
	lib/android/googlemap/src/main/java/com/airbnb/android/react/maps/googlemap/AirGoogleMapView.java
	lib/android/gradle.properties
	lib/android/src/main/java/com/airbnb/android/react/maps/AirMapManager.java
	lib/components/MapPolyline.js
  • Loading branch information
jiaminglu committed May 24, 2017
2 parents c478f3f + 8893578 commit c32ce42
Show file tree
Hide file tree
Showing 24 changed files with 445 additions and 26 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# 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
* 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)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,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
Expand All @@ -485,7 +485,7 @@ takeSnapshot () {
render() {
return (
<View>
<MapView initialRegion={...} ref="map">
<MapView initialRegion={...} ref={map => { this.map = map }}>
<MapView.Marker coordinate={this.state.coordinate} />
</MapView>
<Image source={{ uri: this.state.mapSnapshot.uri }} />
Expand Down Expand Up @@ -558,7 +558,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.
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/marker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br/><br/> The default is the top middle of the image.<br/><br/> 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` | `<null>` | | This is a non-value based prop. Adding this allows the marker to be draggable (re-positioned).

## Events
Expand Down
1 change: 1 addition & 0 deletions example/examples/EventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class EventListener extends React.Component {
<MapView.Polyline
strokeColor={'rgba(255,0,0,1)'}
onPress={this.recordEvent('Polyline::onPress')}
tappable
coordinates={[{
latitude: LATITUDE + (LATITUDE_DELTA / 5),
longitude: LONGITUDE - (LONGITUDE_DELTA / 4),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected AirAMapView createViewInstance(ThemedReactContext context) {
emitMapError(context, "Map initialize error", "map_init_error");
}

return new AirAMapView(context, this, this.mapOptions);
return new AirAMapView(context, this.appContext, this, this.mapOptions);
}

@ReactProp(name = "region")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import com.amap.api.maps.model.Polyline;
import com.amap.api.maps.model.VisibleRegion;
import com.facebook.react.bridge.LifecycleEventListener;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.bridge.WritableNativeMap;
Expand Down Expand Up @@ -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();
Expand All @@ -116,8 +119,8 @@ private static Context getNonBuggyContext(ThemedReactContext reactContext) {
return superContext;
}

public AirAMapView(ThemedReactContext reactContext, AirAMapManager manager, AMapOptions options) {
super(getNonBuggyContext(reactContext), options);
public AirAMapView(ThemedReactContext reactContext, ReactApplicationContext appContext, AirAMapManager manager, AMapOptions options) {
super(getNonBuggyContext(reactContext, appContext), options);

this.manager = manager;
this.context = reactContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected AirGoogleMapView createViewInstance(ThemedReactContext context) {
emitMapError(context, "Map initialize error", "map_init_error");
}

return new AirGoogleMapView(context, this, this.googleMapOptions);
return new AirGoogleMapView(context, this.appContext, this, this.googleMapOptions);
}

@ReactProp(name = "region")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import com.airbnb.android.react.maps.common.SimpleBounds;
import com.airbnb.android.react.maps.common.SimpleLatLng;
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;
import com.facebook.react.bridge.WritableNativeMap;
Expand Down Expand Up @@ -104,10 +106,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();
Expand All @@ -120,9 +124,9 @@ private static Context getNonBuggyContext(ThemedReactContext reactContext) {
return superContext;
}

public AirGoogleMapView(ThemedReactContext reactContext, AirGoogleMapManager manager,
GoogleMapOptions googleMapOptions) {
super(getNonBuggyContext(reactContext), googleMapOptions);
public AirGoogleMapView(ThemedReactContext reactContext, ReactApplicationContext appContext, AirGoogleMapManager manager,
GoogleMapOptions googleMapOptions) {
super(getNonBuggyContext(reactContext, appContext), googleMapOptions);

this.manager = manager;
this.context = reactContext;
Expand Down
18 changes: 18 additions & 0 deletions lib/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
VERSION_CODE=4
VERSION_NAME=0.15.2
GROUP=com.airbnb.android

POM_DESCRIPTION=React Native Map view component for Android
POM_URL=https://github.com/airbnb/react-native-maps/tree/new-scv
POM_SCM_URL=https://github.com/airbnb/react-native-maps/tree/new-scv
POM_SCM_CONNECTION=scm:[email protected]:airbnb/react-native-maps.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:airbnb/react-native-maps.git
POM_LICENSE_NAME=MIT
POM_LICENSE_URL=https://github.com/airbnb/react-native-maps/blob/master/LICENSE
POM_LICENSE_DIST=repo
POM_DEVELOPER_ID=airbnb
POM_DEVELOPER_NAME=Leland Richardson

POM_NAME=ReactNative Maps library
POM_ARTIFACT_ID=react-native-maps
POM_PACKAGING=aar
Loading

0 comments on commit c32ce42

Please sign in to comment.