diff --git a/docs/overlay.md b/docs/overlay.md index f350983ce..4edc01e2d 100644 --- a/docs/overlay.md +++ b/docs/overlay.md @@ -6,7 +6,12 @@ |---|---|---|---| | `image` | `ImageSource` | A custom image to be used as the overlay. Only required local image resources and uri (as for images located in the net) are allowed to be used. | `bounds` | `Array` | | The coordinates for the image (left-top corner, right-bottom corner). ie.```[[lat, long], [lat, long]]``` +| `bearing` | `Float` | `0` | `Google Maps API only` The bearing in degrees clockwise from north. Values outside the range [0, 360) will be normalized. | `tappable` | `Bool` | `false` | `Android only` Boolean to allow an overlay to be tappable and use the onPress function. +| `location` | `[Float, Float]` | | `Android only` Location of the image overlay. +| `width` | `Float` | | `Android only` The width of the overlay (in meters). +| `height` | `Float` | | `Android only` The height of the overlay (in meters). +| `anchor` | `[Float, Float]` | | `Android only` Anchor point is specified in 2D continuous space where [0, 0], [1, 0], [0, 1] and [1, 1] denote the top-left, top-right, bottom-left and bottom-right corners respectively. ## Events @@ -22,3 +27,9 @@ type LatLng = [ longitude: Number, ] ``` +## Android only - Specifying overlay location +There are two ways to specify the position of the overlay in `Android`: + +**Using a location:** You must provide an image of the overlay, a LatLng to which the anchor will be fixed and the width of the overlay (in meters). The anchor is, by default, 50% from the top of the image and 50% from the left of the image. This can be changed. You can optionally provide the height of the overlay (in meters). If you do not provide the height of the overlay, it will be automatically calculated to preserve the proportions of the image. + +**Using a Bounds:** You must provide a `Array` which will contain the image's left-top corner, right-bottom corner. \ No newline at end of file diff --git a/example/App.js b/example/App.js index ccc90f0fc..2feda3d6c 100644 --- a/example/App.js +++ b/example/App.js @@ -42,6 +42,7 @@ import MapKml from './examples/MapKml'; import BugMarkerWontUpdate from './examples/BugMarkerWontUpdate'; import ImageOverlayWithAssets from './examples/ImageOverlayWithAssets'; import ImageOverlayWithURL from './examples/ImageOverlayWithURL'; +import ImageOverlayWithRotation from './examples/ImageOverlayWithRotation'; import AnimatedNavigation from './examples/AnimatedNavigation'; import OnPoiClick from './examples/OnPoiClick'; import TestIdMarkers from './examples/TestIdMarkers'; @@ -173,6 +174,11 @@ export default class App extends React.Component { [BugMarkerWontUpdate, "BUG: Marker Won't Update (Android)", true], [ImageOverlayWithAssets, 'Image Overlay Component with Assets', true], [ImageOverlayWithURL, 'Image Overlay Component with URL', true], + [ + ImageOverlayWithRotation, + 'Image Overlay Component with Rotation', + 'default', + ], [AnimatedNavigation, 'Animated Map Navigation', true], [OnPoiClick, 'On Poi Click', true], [IndoorMap, 'Indoor Map', true], diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 006cf65db..6dea2af4a 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -128,6 +128,6 @@ android { dependencies { implementation project(":react-native-maps-lib") - implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" + implementation "androidx.appcompat:appcompat:1.0.0" implementation "com.facebook.react:react-native:+" // From node_modules } diff --git a/example/android/app/gradle.properties b/example/android/app/gradle.properties new file mode 100644 index 000000000..5465fec0e --- /dev/null +++ b/example/android/app/gradle.properties @@ -0,0 +1,2 @@ +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/example/android/app/gradle/wrapper/gradle-wrapper.jar b/example/android/app/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 000000000..f6b961fd5 Binary files /dev/null and b/example/android/app/gradle/wrapper/gradle-wrapper.jar differ diff --git a/example/android/app/gradle/wrapper/gradle-wrapper.properties b/example/android/app/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..6b0424e24 --- /dev/null +++ b/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Mar 11 14:34:01 EDT 2020 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/example/android/app/gradlew b/example/android/app/gradlew new file mode 100644 index 000000000..cccdd3d51 --- /dev/null +++ b/example/android/app/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/example/android/app/gradlew.bat b/example/android/app/gradlew.bat new file mode 100644 index 000000000..e95643d6a --- /dev/null +++ b/example/android/app/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/example/examples/ImageOverlayWithRotation.js b/example/examples/ImageOverlayWithRotation.js new file mode 100644 index 000000000..d38cfc749 --- /dev/null +++ b/example/examples/ImageOverlayWithRotation.js @@ -0,0 +1,60 @@ +import React, { Component } from 'react'; +import { StyleSheet, View } from 'react-native'; +import MapView from 'react-native-maps'; + +const LATITUDE = 23.117546; +const LONGITUDE = -82.368373; +const URL = 'https://www.gstatic.com/webp/gallery/2.jpg'; +const REGION = { + latitude: LATITUDE, + longitude: LONGITUDE, + latitudeDelta: 0.005, + longitudeDelta: 0.005, +}; + +export default class ImageOverlayWithRotation extends Component { + static propTypes = { + provider: MapView.ProviderPropType, + }; + + render() { + return ( + + + + + + + ); + } +} + +const styles = StyleSheet.create({ + container: { + ...StyleSheet.absoluteFillObject, + justifyContent: 'flex-end', + alignItems: 'center', + }, + map: { + ...StyleSheet.absoluteFillObject, + }, +}); diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index d4dade141..1d2347064 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -114,7 +114,7 @@ DEPENDENCIES: - yoga (from `../../node_modules/react-native/ReactCommon/yoga/yoga.podspec`) SPEC REPOS: - https://github.com/cocoapods/specs.git: + https://github.com/CocoaPods/Specs.git: - boost-for-react-native - Google-Maps-iOS-Utils - GoogleMaps @@ -143,10 +143,10 @@ SPEC CHECKSUMS: Google-Maps-iOS-Utils: c32891ff472eaaa1fca032beedafa1a013af7875 GoogleMaps: 5046d7edfe381c1a0b20fdaf293915a375c3122b React: b52fdb80565505b7e4592b313a38868f5df51641 - react-native-google-maps: 463653dd46ec1ef35065fbf874add62d3f4c86d7 - react-native-maps: 190c02ca533fddac5bb49cf17bdece3644612107 + react-native-google-maps: 2e2e697dab576abd5809d78cd74e775865b62bf7 + react-native-maps: 6e499eee4eabf422ba8b6f94e993cc768bf35153 yoga: 1a492113f66a35e9e583bb0434f4b8cc668dd839 PODFILE CHECKSUM: d2a6b35e414b69177ba0b16fb76ad1eb91a4a929 -COCOAPODS: 1.6.1 +COCOAPODS: 1.8.4 diff --git a/index.d.ts b/index.d.ts index 1f55aff64..799df917c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -476,11 +476,17 @@ declare module "react-native-maps" { // ======================================================================= type Coordinate = [number, number]; + type Anchor = [number, number] export interface MapOverlayProps extends ViewProperties { image?: ImageURISource | ImageRequireSource; - bounds: [Coordinate, Coordinate]; + bounds?: [Coordinate, Coordinate]; tappable?: boolean; + location?: Coordinate; + width?: number; + height?: number; + anchor?: Anchor; + bearing?: number; onPress?: (event: MapEvent<{ action: "overlay-press"; }>) => void; } diff --git a/lib/android/build.gradle b/lib/android/build.gradle index 3995544f9..0a4da163e 100644 --- a/lib/android/build.gradle +++ b/lib/android/build.gradle @@ -17,10 +17,7 @@ android { } dependencies { - def supportLibVersion = safeExtGet('supportLibVersion', '28.0.0') - def supportLibMajorVersion = supportLibVersion.split('\\.')[0] as int - def appCompatLibName = (supportLibMajorVersion < 20) ? "androidx.appcompat:appcompat" : "com.android.support:appcompat-v7" - implementation "$appCompatLibName:$supportLibVersion" + implementation "androidx.appcompat:appcompat:1.0.0" implementation('com.facebook.react:react-native:+') { exclude group: 'com.android.support' } diff --git a/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapOverlay.java b/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapOverlay.java index 4ebf2e3fb..ef328d231 100644 --- a/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapOverlay.java +++ b/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapOverlay.java @@ -25,6 +25,12 @@ public class AirMapOverlay extends AirMapFeature implements ImageReadable { private boolean tappable; private float zIndex; private float transparency; + private LatLng location; + private float width; + private float height; + private float bearing; + private float[] anchor; + private final ImageReader mImageReader; private GoogleMap map; @@ -43,6 +49,26 @@ public void setBounds(ReadableArray bounds) { } } + public void setLocation(ReadableArray location){ + this.location = new LatLng(location.getDouble(0), location.getDouble(1)); + } + + public void setWidth(float width) { + this.width = width; + } + + public void setHeight(float height) { + this.height = height; + } + + public void setBearing(float bearing){ + this.bearing = bearing; + } + + public void setAnchor(ReadableArray anchor){ + this.anchor = new float[]{ (float)anchor.getDouble(0) , (float)anchor.getDouble(1) }; + } + public void setZIndex(float zIndex) { this.zIndex = zIndex; if (this.groundOverlay != null) { @@ -81,6 +107,7 @@ private GroundOverlayOptions createGroundOverlayOptions() { return this.groundOverlayOptions; } GroundOverlayOptions options = new GroundOverlayOptions(); + if (this.iconBitmapDescriptor != null) { options.image(iconBitmapDescriptor); } else { @@ -90,7 +117,20 @@ private GroundOverlayOptions createGroundOverlayOptions() { // hide overlay until real image gets added options.visible(false); } - options.positionFromBounds(bounds); + + // Two different ways of specifying postion of the groundOverlay + options.bearing(bearing); + if(this.location != null){ + if(this.height == 0.0f){ + options.position(location, width); + } else { + options.position(location, width, height); + } + options.anchor(anchor[0], anchor[1]); + } else { + options.positionFromBounds(bounds); + } + options.zIndex(zIndex); return options; } diff --git a/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapOverlayManager.java b/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapOverlayManager.java index ed3e9ca6f..430989b5c 100644 --- a/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapOverlayManager.java +++ b/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapOverlayManager.java @@ -11,6 +11,7 @@ import com.facebook.react.uimanager.ThemedReactContext; import com.facebook.react.uimanager.ViewGroupManager; import com.facebook.react.uimanager.annotations.ReactProp; +import com.google.android.gms.maps.model.LatLng; import java.util.Map; @@ -46,6 +47,31 @@ public void setBounds(AirMapOverlay view, ReadableArray bounds) { view.setBounds(bounds); } + @ReactProp(name = "location") + public void setLocation(AirMapOverlay view, ReadableArray location){ + view.setLocation(location); + } + + @ReactProp(name = "width") + public void setWidth(AirMapOverlay view, float width) { + view.setWidth(width); + } + + @ReactProp(name = "height") + public void setHeight(AirMapOverlay view, float height) { + view.setHeight(height); + } + + @ReactProp(name = "bearing") + public void setBearing(AirMapOverlay view, float bearing){ + view.setBearing(bearing); + } + + @ReactProp(name = "anchor") + public void setAnchor(AirMapOverlay view, ReadableArray anchor){ + view.setAnchor(anchor); + } + @ReactProp(name = "zIndex", defaultFloat = 1.0f) public void setZIndex(AirMapOverlay view, float zIndex) { view.setZIndex(zIndex); diff --git a/lib/components/MapOverlay.js b/lib/components/MapOverlay.js index 479939557..2b34449a8 100644 --- a/lib/components/MapOverlay.js +++ b/lib/components/MapOverlay.js @@ -19,7 +19,19 @@ const propTypes = { // A custom image to be used as overlay. image: PropTypes.any.isRequired, // Top left and bottom right coordinates for the overlay - bounds: PropTypes.arrayOf(PropTypes.array.isRequired).isRequired, + bounds: PropTypes.arrayOf(PropTypes.array.isRequired), + // Location of the image + location: PropTypes.any, + // The width of the overlay (in meters). + width: PropTypes.number, + // The height of the overlay (in meters). + height: PropTypes.number, + /* Anchor point is specified in 2D continuous space where (0,0), (1,0), (0,1) and (1,1) + * denote the top-left, top-right, bottom-left and bottom-right corners respectively. + */ + anchor: PropTypes.arrayOf(PropTypes.number.isRequired), + // The bearing in degrees clockwise from north. + bearing: PropTypes.number, /* Boolean to allow an overlay to be tappable and use the * onPress function */ diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m b/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m index cf69ac7ba..14e28ac38 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m +++ b/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m @@ -9,7 +9,7 @@ #import "AIRGoogleMapMarker.h" #import -#import +#import #import #import "AIRGMSMarker.h" #import "AIRGoogleMapCallout.h" diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMapOverlay.h b/lib/ios/AirGoogleMaps/AIRGoogleMapOverlay.h index 0fd00ebdf..47f1705e7 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMapOverlay.h +++ b/lib/ios/AirGoogleMaps/AIRGoogleMapOverlay.h @@ -19,6 +19,7 @@ @property (nonatomic, strong, readonly) UIImage *overlayImage; @property (nonatomic, copy) NSArray *boundsRect; @property (nonatomic, readonly) GMSCoordinateBounds *overlayBounds; +@property (nonatomic, readonly) CLLocationDirection bearing; @property (nonatomic, weak) RCTBridge *bridge; diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMapOverlay.m b/lib/ios/AirGoogleMaps/AIRGoogleMapOverlay.m index 43167da77..38ca4d46f 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMapOverlay.m +++ b/lib/ios/AirGoogleMaps/AIRGoogleMapOverlay.m @@ -8,13 +8,14 @@ #import "AIRGoogleMapOverlay.h" #import -#import +#import #import #import @interface AIRGoogleMapOverlay() @property (nonatomic, strong, readwrite) UIImage *overlayImage; @property (nonatomic, readwrite) GMSCoordinateBounds *overlayBounds; + @property (nonatomic) CLLocationDirection bearing; @end @implementation AIRGoogleMapOverlay { @@ -75,6 +76,12 @@ - (void)setBoundsRect:(NSArray *)boundsRect _overlay.bounds = _overlayBounds; } +- (void)setBearing:(double)bearing +{ + _bearing = (CLLocationDirection)bearing; + _overlay.bearing = _bearing; +} + @end #endif diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMapOverlayManager.m b/lib/ios/AirGoogleMaps/AIRGoogleMapOverlayManager.m index 12b29e738..7d614fd99 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMapOverlayManager.m +++ b/lib/ios/AirGoogleMaps/AIRGoogleMapOverlayManager.m @@ -18,5 +18,6 @@ - (UIView *)view RCT_REMAP_VIEW_PROPERTY(bounds, boundsRect, NSArray) RCT_REMAP_VIEW_PROPERTY(image, imageSrc, NSString) +RCT_EXPORT_VIEW_PROPERTY(bearing, double) @end diff --git a/lib/ios/AirMaps/AIRMapMarker.m b/lib/ios/AirMaps/AIRMapMarker.m index 65098aadf..ce2474ea9 100644 --- a/lib/ios/AirMaps/AIRMapMarker.m +++ b/lib/ios/AirMaps/AIRMapMarker.m @@ -11,7 +11,7 @@ #import #import -#import +#import #import #import diff --git a/lib/ios/AirMaps/AIRMapOverlay.m b/lib/ios/AirMaps/AIRMapOverlay.m index ef1f8bc64..efa1dde54 100644 --- a/lib/ios/AirMaps/AIRMapOverlay.m +++ b/lib/ios/AirMaps/AIRMapOverlay.m @@ -2,7 +2,7 @@ #import #import -#import +#import #import #import