react-native-maps 1.1.0-beta.6 → 1.2.0-beta.1
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/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradlew +185 -0
- package/android/gradlew.bat +89 -0
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapCircleManager.java +4 -9
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapGradientPolyline.java +2 -4
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapGradientPolylineManager.java +4 -9
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapHeatmap.java +2 -2
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapLocalTile.java +2 -6
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapLocalTileManager.java +4 -10
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapManager.java +7 -12
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapMarker.java +11 -22
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapMarkerManager.java +2 -2
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapOverlay.java +0 -5
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapOverlayManager.java +4 -10
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapPolygonManager.java +4 -9
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapPolyline.java +1 -1
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapPolylineManager.java +4 -9
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapTileProvider.java +42 -67
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapTileWorker.java +4 -11
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapUrlTile.java +3 -3
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapUrlTileManager.java +4 -10
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java +22 -47
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapWMSTile.java +5 -11
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapWMSTileManager.java +4 -10
- package/android/src/main/java/com/airbnb/android/react/maps/FileUtil.java +2 -5
- package/android/src/main/java/com/airbnb/android/react/maps/ImageReader.java +4 -6
- package/android/src/main/java/com/airbnb/android/react/maps/ViewAttacherGroup.java +1 -6
- package/android/src/main/java/com/airbnb/android/react/maps/ViewChangesTracker.java +4 -4
- package/package.json +5 -3
- package/android/src/main/assets/ula.kml +0 -1214
- package/ios/User.xcconfig +0 -0
|
Binary file
|
package/android/gradlew
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
# Copyright 2015 the original author or authors.
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
|
|
19
|
+
##############################################################################
|
|
20
|
+
##
|
|
21
|
+
## Gradle start up script for UN*X
|
|
22
|
+
##
|
|
23
|
+
##############################################################################
|
|
24
|
+
|
|
25
|
+
# Attempt to set APP_HOME
|
|
26
|
+
# Resolve links: $0 may be a link
|
|
27
|
+
PRG="$0"
|
|
28
|
+
# Need this for relative symlinks.
|
|
29
|
+
while [ -h "$PRG" ] ; do
|
|
30
|
+
ls=`ls -ld "$PRG"`
|
|
31
|
+
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
32
|
+
if expr "$link" : '/.*' > /dev/null; then
|
|
33
|
+
PRG="$link"
|
|
34
|
+
else
|
|
35
|
+
PRG=`dirname "$PRG"`"/$link"
|
|
36
|
+
fi
|
|
37
|
+
done
|
|
38
|
+
SAVED="`pwd`"
|
|
39
|
+
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
40
|
+
APP_HOME="`pwd -P`"
|
|
41
|
+
cd "$SAVED" >/dev/null
|
|
42
|
+
|
|
43
|
+
APP_NAME="Gradle"
|
|
44
|
+
APP_BASE_NAME=`basename "$0"`
|
|
45
|
+
|
|
46
|
+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
47
|
+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
48
|
+
|
|
49
|
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
50
|
+
MAX_FD="maximum"
|
|
51
|
+
|
|
52
|
+
warn () {
|
|
53
|
+
echo "$*"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
die () {
|
|
57
|
+
echo
|
|
58
|
+
echo "$*"
|
|
59
|
+
echo
|
|
60
|
+
exit 1
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
# OS specific support (must be 'true' or 'false').
|
|
64
|
+
cygwin=false
|
|
65
|
+
msys=false
|
|
66
|
+
darwin=false
|
|
67
|
+
nonstop=false
|
|
68
|
+
case "`uname`" in
|
|
69
|
+
CYGWIN* )
|
|
70
|
+
cygwin=true
|
|
71
|
+
;;
|
|
72
|
+
Darwin* )
|
|
73
|
+
darwin=true
|
|
74
|
+
;;
|
|
75
|
+
MSYS* | MINGW* )
|
|
76
|
+
msys=true
|
|
77
|
+
;;
|
|
78
|
+
NONSTOP* )
|
|
79
|
+
nonstop=true
|
|
80
|
+
;;
|
|
81
|
+
esac
|
|
82
|
+
|
|
83
|
+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Determine the Java command to use to start the JVM.
|
|
87
|
+
if [ -n "$JAVA_HOME" ] ; then
|
|
88
|
+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
89
|
+
# IBM's JDK on AIX uses strange locations for the executables
|
|
90
|
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
91
|
+
else
|
|
92
|
+
JAVACMD="$JAVA_HOME/bin/java"
|
|
93
|
+
fi
|
|
94
|
+
if [ ! -x "$JAVACMD" ] ; then
|
|
95
|
+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
96
|
+
|
|
97
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
98
|
+
location of your Java installation."
|
|
99
|
+
fi
|
|
100
|
+
else
|
|
101
|
+
JAVACMD="java"
|
|
102
|
+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
103
|
+
|
|
104
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
105
|
+
location of your Java installation."
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
# Increase the maximum file descriptors if we can.
|
|
109
|
+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
|
110
|
+
MAX_FD_LIMIT=`ulimit -H -n`
|
|
111
|
+
if [ $? -eq 0 ] ; then
|
|
112
|
+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
|
113
|
+
MAX_FD="$MAX_FD_LIMIT"
|
|
114
|
+
fi
|
|
115
|
+
ulimit -n $MAX_FD
|
|
116
|
+
if [ $? -ne 0 ] ; then
|
|
117
|
+
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
118
|
+
fi
|
|
119
|
+
else
|
|
120
|
+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
121
|
+
fi
|
|
122
|
+
fi
|
|
123
|
+
|
|
124
|
+
# For Darwin, add options to specify how the application appears in the dock
|
|
125
|
+
if $darwin; then
|
|
126
|
+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
127
|
+
fi
|
|
128
|
+
|
|
129
|
+
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
130
|
+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
|
131
|
+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
132
|
+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
133
|
+
|
|
134
|
+
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
135
|
+
|
|
136
|
+
# We build the pattern for arguments to be converted via cygpath
|
|
137
|
+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
138
|
+
SEP=""
|
|
139
|
+
for dir in $ROOTDIRSRAW ; do
|
|
140
|
+
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
141
|
+
SEP="|"
|
|
142
|
+
done
|
|
143
|
+
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
144
|
+
# Add a user-defined pattern to the cygpath arguments
|
|
145
|
+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
146
|
+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
147
|
+
fi
|
|
148
|
+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
149
|
+
i=0
|
|
150
|
+
for arg in "$@" ; do
|
|
151
|
+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
152
|
+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
153
|
+
|
|
154
|
+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
155
|
+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
156
|
+
else
|
|
157
|
+
eval `echo args$i`="\"$arg\""
|
|
158
|
+
fi
|
|
159
|
+
i=`expr $i + 1`
|
|
160
|
+
done
|
|
161
|
+
case $i in
|
|
162
|
+
0) set -- ;;
|
|
163
|
+
1) set -- "$args0" ;;
|
|
164
|
+
2) set -- "$args0" "$args1" ;;
|
|
165
|
+
3) set -- "$args0" "$args1" "$args2" ;;
|
|
166
|
+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
167
|
+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
168
|
+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
169
|
+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
170
|
+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
171
|
+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
172
|
+
esac
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
# Escape application args
|
|
176
|
+
save () {
|
|
177
|
+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
|
178
|
+
echo " "
|
|
179
|
+
}
|
|
180
|
+
APP_ARGS=`save "$@"`
|
|
181
|
+
|
|
182
|
+
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
|
183
|
+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
|
184
|
+
|
|
185
|
+
exec "$JAVACMD" "$@"
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
@rem
|
|
2
|
+
@rem Copyright 2015 the original author or authors.
|
|
3
|
+
@rem
|
|
4
|
+
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
@rem you may not use this file except in compliance with the License.
|
|
6
|
+
@rem You may obtain a copy of the License at
|
|
7
|
+
@rem
|
|
8
|
+
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
@rem
|
|
10
|
+
@rem Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
@rem See the License for the specific language governing permissions and
|
|
14
|
+
@rem limitations under the License.
|
|
15
|
+
@rem
|
|
16
|
+
|
|
17
|
+
@if "%DEBUG%" == "" @echo off
|
|
18
|
+
@rem ##########################################################################
|
|
19
|
+
@rem
|
|
20
|
+
@rem Gradle startup script for Windows
|
|
21
|
+
@rem
|
|
22
|
+
@rem ##########################################################################
|
|
23
|
+
|
|
24
|
+
@rem Set local scope for the variables with windows NT shell
|
|
25
|
+
if "%OS%"=="Windows_NT" setlocal
|
|
26
|
+
|
|
27
|
+
set DIRNAME=%~dp0
|
|
28
|
+
if "%DIRNAME%" == "" set DIRNAME=.
|
|
29
|
+
set APP_BASE_NAME=%~n0
|
|
30
|
+
set APP_HOME=%DIRNAME%
|
|
31
|
+
|
|
32
|
+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
33
|
+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
|
34
|
+
|
|
35
|
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
36
|
+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
|
37
|
+
|
|
38
|
+
@rem Find java.exe
|
|
39
|
+
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
40
|
+
|
|
41
|
+
set JAVA_EXE=java.exe
|
|
42
|
+
%JAVA_EXE% -version >NUL 2>&1
|
|
43
|
+
if "%ERRORLEVEL%" == "0" goto execute
|
|
44
|
+
|
|
45
|
+
echo.
|
|
46
|
+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
47
|
+
echo.
|
|
48
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
49
|
+
echo location of your Java installation.
|
|
50
|
+
|
|
51
|
+
goto fail
|
|
52
|
+
|
|
53
|
+
:findJavaFromJavaHome
|
|
54
|
+
set JAVA_HOME=%JAVA_HOME:"=%
|
|
55
|
+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
56
|
+
|
|
57
|
+
if exist "%JAVA_EXE%" goto execute
|
|
58
|
+
|
|
59
|
+
echo.
|
|
60
|
+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
61
|
+
echo.
|
|
62
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
63
|
+
echo location of your Java installation.
|
|
64
|
+
|
|
65
|
+
goto fail
|
|
66
|
+
|
|
67
|
+
:execute
|
|
68
|
+
@rem Setup the command line
|
|
69
|
+
|
|
70
|
+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@rem Execute Gradle
|
|
74
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
|
75
|
+
|
|
76
|
+
:end
|
|
77
|
+
@rem End local scope for the variables with windows NT shell
|
|
78
|
+
if "%ERRORLEVEL%"=="0" goto mainEnd
|
|
79
|
+
|
|
80
|
+
:fail
|
|
81
|
+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
82
|
+
rem the _cmd.exe /c_ return code!
|
|
83
|
+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
84
|
+
exit /b 1
|
|
85
|
+
|
|
86
|
+
:mainEnd
|
|
87
|
+
if "%OS%"=="Windows_NT" endlocal
|
|
88
|
+
|
|
89
|
+
:omega
|
|
@@ -2,7 +2,6 @@ package com.airbnb.android.react.maps;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
import android.graphics.Color;
|
|
5
|
-
import android.os.Build;
|
|
6
5
|
import android.util.DisplayMetrics;
|
|
7
6
|
import android.view.WindowManager;
|
|
8
7
|
|
|
@@ -18,14 +17,10 @@ public class AirMapCircleManager extends ViewGroupManager<AirMapCircle> {
|
|
|
18
17
|
|
|
19
18
|
public AirMapCircleManager(ReactApplicationContext reactContext) {
|
|
20
19
|
super();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.getRealMetrics(metrics);
|
|
26
|
-
} else {
|
|
27
|
-
metrics = reactContext.getResources().getDisplayMetrics();
|
|
28
|
-
}
|
|
20
|
+
metrics = new DisplayMetrics();
|
|
21
|
+
((WindowManager) reactContext.getSystemService(Context.WINDOW_SERVICE))
|
|
22
|
+
.getDefaultDisplay()
|
|
23
|
+
.getRealMetrics(metrics);
|
|
29
24
|
}
|
|
30
25
|
|
|
31
26
|
@Override
|
|
@@ -38,9 +38,7 @@ public class AirMapGradientPolyline extends AirMapFeature {
|
|
|
38
38
|
|
|
39
39
|
private GoogleMap map;
|
|
40
40
|
|
|
41
|
-
private TileOverlayOptions tileOverlayOptions;
|
|
42
41
|
private TileOverlay tileOverlay;
|
|
43
|
-
private AirMapGradientPolylineProvider tileProvider;
|
|
44
42
|
protected final Context context;
|
|
45
43
|
|
|
46
44
|
public AirMapGradientPolyline(Context context) {
|
|
@@ -88,8 +86,8 @@ public class AirMapGradientPolyline extends AirMapFeature {
|
|
|
88
86
|
private TileOverlayOptions createTileOverlayOptions() {
|
|
89
87
|
TileOverlayOptions options = new TileOverlayOptions();
|
|
90
88
|
options.zIndex(zIndex);
|
|
91
|
-
|
|
92
|
-
options.tileProvider(
|
|
89
|
+
AirMapGradientPolylineProvider tileProvider = new AirMapGradientPolylineProvider(context, points, colors, width);
|
|
90
|
+
options.tileProvider(tileProvider);
|
|
93
91
|
return options;
|
|
94
92
|
}
|
|
95
93
|
|
package/android/src/main/java/com/airbnb/android/react/maps/AirMapGradientPolylineManager.java
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
|
-
import android.os.Build;
|
|
5
4
|
import android.util.DisplayMetrics;
|
|
6
5
|
import android.view.WindowManager;
|
|
7
6
|
|
|
@@ -21,14 +20,10 @@ public class AirMapGradientPolylineManager extends ViewGroupManager<AirMapGradie
|
|
|
21
20
|
|
|
22
21
|
public AirMapGradientPolylineManager(ReactApplicationContext reactContext) {
|
|
23
22
|
super();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.getRealMetrics(metrics);
|
|
29
|
-
} else {
|
|
30
|
-
metrics = reactContext.getResources().getDisplayMetrics();
|
|
31
|
-
}
|
|
23
|
+
metrics = new DisplayMetrics();
|
|
24
|
+
((WindowManager) reactContext.getSystemService(Context.WINDOW_SERVICE))
|
|
25
|
+
.getDefaultDisplay()
|
|
26
|
+
.getRealMetrics(metrics);
|
|
32
27
|
}
|
|
33
28
|
|
|
34
29
|
@Override
|
|
@@ -49,7 +49,7 @@ public class AirMapHeatmap extends AirMapFeature {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
public void setOpacity(double opacity) {
|
|
52
|
-
this.opacity =
|
|
52
|
+
this.opacity = opacity;
|
|
53
53
|
if (heatmapTileProvider != null) {
|
|
54
54
|
heatmapTileProvider.setOpacity(opacity);
|
|
55
55
|
}
|
|
@@ -59,7 +59,7 @@ public class AirMapHeatmap extends AirMapFeature {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
public void setRadius(int radius) {
|
|
62
|
-
this.radius =
|
|
62
|
+
this.radius = radius;
|
|
63
63
|
if (heatmapTileProvider != null) {
|
|
64
64
|
heatmapTileProvider.setRadius(radius);
|
|
65
65
|
}
|
|
@@ -9,7 +9,6 @@ import com.google.android.gms.maps.model.TileOverlayOptions;
|
|
|
9
9
|
import com.google.android.gms.maps.model.TileProvider;
|
|
10
10
|
|
|
11
11
|
import java.io.ByteArrayOutputStream;
|
|
12
|
-
import java.io.File;
|
|
13
12
|
import java.io.FileInputStream;
|
|
14
13
|
import java.io.IOException;
|
|
15
14
|
import java.io.InputStream;
|
|
@@ -20,7 +19,7 @@ public class AirMapLocalTile extends AirMapFeature {
|
|
|
20
19
|
private static final int BUFFER_SIZE = 16 * 1024;
|
|
21
20
|
private int tileSize;
|
|
22
21
|
private String pathTemplate;
|
|
23
|
-
private boolean useAssets;
|
|
22
|
+
private final boolean useAssets;
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
public AIRMapLocalTileProvider(int tileSizet, String pathTemplate, boolean useAssets) {
|
|
@@ -61,10 +60,7 @@ public class AirMapLocalTile extends AirMapFeature {
|
|
|
61
60
|
buffer.flush();
|
|
62
61
|
|
|
63
62
|
return buffer.toByteArray();
|
|
64
|
-
} catch (IOException e) {
|
|
65
|
-
e.printStackTrace();
|
|
66
|
-
return null;
|
|
67
|
-
} catch (OutOfMemoryError e) {
|
|
63
|
+
} catch (IOException | OutOfMemoryError e) {
|
|
68
64
|
e.printStackTrace();
|
|
69
65
|
return null;
|
|
70
66
|
} finally {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
|
-
import android.os.Build;
|
|
5
4
|
import android.util.DisplayMetrics;
|
|
6
5
|
import android.view.WindowManager;
|
|
7
6
|
|
|
@@ -14,18 +13,13 @@ import com.facebook.react.uimanager.annotations.ReactProp;
|
|
|
14
13
|
* Created by zavadpe on 30/11/2017.
|
|
15
14
|
*/
|
|
16
15
|
public class AirMapLocalTileManager extends ViewGroupManager<AirMapLocalTile> {
|
|
17
|
-
private DisplayMetrics metrics;
|
|
18
16
|
|
|
19
17
|
public AirMapLocalTileManager(ReactApplicationContext reactContext) {
|
|
20
18
|
super();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.getRealMetrics(metrics);
|
|
26
|
-
} else {
|
|
27
|
-
metrics = reactContext.getResources().getDisplayMetrics();
|
|
28
|
-
}
|
|
19
|
+
DisplayMetrics metrics = new DisplayMetrics();
|
|
20
|
+
((WindowManager) reactContext.getSystemService(Context.WINDOW_SERVICE))
|
|
21
|
+
.getDefaultDisplay()
|
|
22
|
+
.getRealMetrics(metrics);
|
|
29
23
|
}
|
|
30
24
|
|
|
31
25
|
@Override
|
|
@@ -21,7 +21,6 @@ import com.google.android.gms.maps.GoogleMap;
|
|
|
21
21
|
import com.google.android.gms.maps.GoogleMapOptions;
|
|
22
22
|
import com.google.android.gms.maps.model.LatLng;
|
|
23
23
|
import com.google.android.gms.maps.model.LatLngBounds;
|
|
24
|
-
import com.google.android.gms.maps.model.MapStyleOptions;
|
|
25
24
|
|
|
26
25
|
import java.util.HashMap;
|
|
27
26
|
import java.util.Map;
|
|
@@ -30,17 +29,13 @@ public class AirMapManager extends ViewGroupManager<AirMapView> {
|
|
|
30
29
|
|
|
31
30
|
private static final String REACT_CLASS = "AIRMap";
|
|
32
31
|
private static final int ANIMATE_TO_REGION = 1;
|
|
33
|
-
private static final int
|
|
34
|
-
private static final int
|
|
35
|
-
private static final int
|
|
36
|
-
private static final int
|
|
37
|
-
private static final int
|
|
38
|
-
private static final int
|
|
39
|
-
private static final int
|
|
40
|
-
private static final int ANIMATE_TO_NAVIGATION = 9;
|
|
41
|
-
private static final int SET_INDOOR_ACTIVE_LEVEL_INDEX = 10;
|
|
42
|
-
private static final int SET_CAMERA = 11;
|
|
43
|
-
private static final int ANIMATE_CAMERA = 12;
|
|
32
|
+
private static final int FIT_TO_ELEMENTS = 2;
|
|
33
|
+
private static final int FIT_TO_SUPPLIED_MARKERS = 3;
|
|
34
|
+
private static final int FIT_TO_COORDINATES = 4;
|
|
35
|
+
private static final int SET_MAP_BOUNDARIES = 5;
|
|
36
|
+
private static final int SET_INDOOR_ACTIVE_LEVEL_INDEX = 6;
|
|
37
|
+
private static final int SET_CAMERA = 7;
|
|
38
|
+
private static final int ANIMATE_CAMERA = 8;
|
|
44
39
|
|
|
45
40
|
|
|
46
41
|
private final Map<String, Integer> MAP_TYPES = MapBuilder.of(
|
|
@@ -76,7 +76,6 @@ public class AirMapMarker extends AirMapFeature {
|
|
|
76
76
|
|
|
77
77
|
private boolean tracksViewChanges = true;
|
|
78
78
|
private boolean tracksViewChangesActive = false;
|
|
79
|
-
private boolean hasViewChanges = true;
|
|
80
79
|
|
|
81
80
|
private boolean hasCustomMarkerView = false;
|
|
82
81
|
private final AirMapMarkerManager markerManager;
|
|
@@ -96,7 +95,7 @@ public class AirMapMarker extends AirMapFeature {
|
|
|
96
95
|
imageReference = dataSource.getResult();
|
|
97
96
|
if (imageReference != null) {
|
|
98
97
|
CloseableImage image = imageReference.get();
|
|
99
|
-
if (image
|
|
98
|
+
if (image instanceof CloseableStaticBitmap) {
|
|
100
99
|
CloseableStaticBitmap closeableStaticBitmap = (CloseableStaticBitmap) image;
|
|
101
100
|
Bitmap bitmap = closeableStaticBitmap.getUnderlyingBitmap();
|
|
102
101
|
if (bitmap != null) {
|
|
@@ -289,13 +288,7 @@ public class AirMapMarker extends AirMapFeature {
|
|
|
289
288
|
public void updateMarkerIcon() {
|
|
290
289
|
if (marker == null) return;
|
|
291
290
|
|
|
292
|
-
|
|
293
|
-
// No more updates for this, as it's a simple icon
|
|
294
|
-
hasViewChanges = false;
|
|
295
|
-
}
|
|
296
|
-
if (marker != null) {
|
|
297
|
-
marker.setIcon(getIcon());
|
|
298
|
-
}
|
|
291
|
+
marker.setIcon(getIcon());
|
|
299
292
|
}
|
|
300
293
|
|
|
301
294
|
public LatLng interpolate(float fraction, LatLng a, LatLng b) {
|
|
@@ -322,7 +315,6 @@ public class AirMapMarker extends AirMapFeature {
|
|
|
322
315
|
}
|
|
323
316
|
|
|
324
317
|
public void setImage(String uri) {
|
|
325
|
-
hasViewChanges = true;
|
|
326
318
|
|
|
327
319
|
boolean shouldLoadImage = true;
|
|
328
320
|
|
|
@@ -368,18 +360,16 @@ public class AirMapMarker extends AirMapFeature {
|
|
|
368
360
|
logoHolder.setController(controller);
|
|
369
361
|
} else {
|
|
370
362
|
iconBitmapDescriptor = getBitmapDescriptorByName(uri);
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
drawable.draw(canvas);
|
|
380
|
-
}
|
|
363
|
+
int drawableId = getDrawableResourceByName(uri);
|
|
364
|
+
iconBitmap = BitmapFactory.decodeResource(getResources(), drawableId);
|
|
365
|
+
if (iconBitmap == null) { // VectorDrawable or similar
|
|
366
|
+
Drawable drawable = getResources().getDrawable(drawableId);
|
|
367
|
+
iconBitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
|
|
368
|
+
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
|
369
|
+
Canvas canvas = new Canvas(iconBitmap);
|
|
370
|
+
drawable.draw(canvas);
|
|
381
371
|
}
|
|
382
|
-
if (this.markerManager != null
|
|
372
|
+
if (this.markerManager != null) {
|
|
383
373
|
this.markerManager.getSharedIcon(uri).updateIcon(iconBitmapDescriptor, iconBitmap);
|
|
384
374
|
}
|
|
385
375
|
update(true);
|
|
@@ -389,7 +379,6 @@ public class AirMapMarker extends AirMapFeature {
|
|
|
389
379
|
public void setIconBitmapDescriptor(BitmapDescriptor bitmapDescriptor, Bitmap bitmap) {
|
|
390
380
|
this.iconBitmapDescriptor = bitmapDescriptor;
|
|
391
381
|
this.iconBitmap = bitmap;
|
|
392
|
-
this.hasViewChanges = true;
|
|
393
382
|
this.update(true);
|
|
394
383
|
}
|
|
395
384
|
|
|
@@ -32,7 +32,7 @@ public class AirMapMarkerManager extends ViewGroupManager<AirMapMarker> {
|
|
|
32
32
|
public static class AirMapMarkerSharedIcon {
|
|
33
33
|
private BitmapDescriptor iconBitmapDescriptor;
|
|
34
34
|
private Bitmap bitmap;
|
|
35
|
-
private Map<AirMapMarker, Boolean> markers;
|
|
35
|
+
private final Map<AirMapMarker, Boolean> markers;
|
|
36
36
|
private boolean loadImageStarted;
|
|
37
37
|
|
|
38
38
|
public AirMapMarkerSharedIcon(){
|
|
@@ -113,7 +113,7 @@ public class AirMapMarkerManager extends ViewGroupManager<AirMapMarker> {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
private Map<String, AirMapMarkerSharedIcon> sharedIcons = new ConcurrentHashMap<>();
|
|
116
|
+
private final Map<String, AirMapMarkerSharedIcon> sharedIcons = new ConcurrentHashMap<>();
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* get the shared icon object, if not existed, create a new one and store it.
|
|
@@ -4,7 +4,6 @@ import android.content.Context;
|
|
|
4
4
|
import android.graphics.Bitmap;
|
|
5
5
|
|
|
6
6
|
import com.facebook.react.bridge.ReadableArray;
|
|
7
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
8
7
|
import com.google.android.gms.maps.GoogleMap;
|
|
9
8
|
import com.google.android.gms.maps.model.BitmapDescriptor;
|
|
10
9
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
|
@@ -13,8 +12,6 @@ import com.google.android.gms.maps.model.GroundOverlayOptions;
|
|
|
13
12
|
import com.google.android.gms.maps.model.LatLng;
|
|
14
13
|
import com.google.android.gms.maps.model.LatLngBounds;
|
|
15
14
|
|
|
16
|
-
import java.util.ArrayList;
|
|
17
|
-
|
|
18
15
|
public class AirMapOverlay extends AirMapFeature implements ImageReadable {
|
|
19
16
|
|
|
20
17
|
private GroundOverlayOptions groundOverlayOptions;
|
|
@@ -22,7 +19,6 @@ public class AirMapOverlay extends AirMapFeature implements ImageReadable {
|
|
|
22
19
|
private LatLngBounds bounds;
|
|
23
20
|
private float bearing;
|
|
24
21
|
private BitmapDescriptor iconBitmapDescriptor;
|
|
25
|
-
private Bitmap iconBitmap;
|
|
26
22
|
private boolean tappable;
|
|
27
23
|
private float zIndex;
|
|
28
24
|
private float transparency;
|
|
@@ -133,7 +129,6 @@ public class AirMapOverlay extends AirMapFeature implements ImageReadable {
|
|
|
133
129
|
|
|
134
130
|
@Override
|
|
135
131
|
public void setIconBitmap(Bitmap bitmap) {
|
|
136
|
-
this.iconBitmap = bitmap;
|
|
137
132
|
}
|
|
138
133
|
|
|
139
134
|
@Override
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package com.airbnb.android.react.maps;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
|
-
import android.os.Build;
|
|
5
4
|
import android.util.DisplayMetrics;
|
|
6
5
|
import android.view.WindowManager;
|
|
7
6
|
|
|
@@ -17,18 +16,13 @@ import com.facebook.react.uimanager.annotations.ReactProp;
|
|
|
17
16
|
import java.util.Map;
|
|
18
17
|
|
|
19
18
|
public class AirMapOverlayManager extends ViewGroupManager<AirMapOverlay> {
|
|
20
|
-
private final DisplayMetrics metrics;
|
|
21
19
|
|
|
22
20
|
public AirMapOverlayManager(ReactApplicationContext reactContext) {
|
|
23
21
|
super();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.getRealMetrics(metrics);
|
|
29
|
-
} else {
|
|
30
|
-
metrics = reactContext.getResources().getDisplayMetrics();
|
|
31
|
-
}
|
|
22
|
+
DisplayMetrics metrics = new DisplayMetrics();
|
|
23
|
+
((WindowManager) reactContext.getSystemService(Context.WINDOW_SERVICE))
|
|
24
|
+
.getDefaultDisplay()
|
|
25
|
+
.getRealMetrics(metrics);
|
|
32
26
|
}
|
|
33
27
|
|
|
34
28
|
@Override
|
|
@@ -2,7 +2,6 @@ package com.airbnb.android.react.maps;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
import android.graphics.Color;
|
|
5
|
-
import android.os.Build;
|
|
6
5
|
import android.util.DisplayMetrics;
|
|
7
6
|
import android.view.WindowManager;
|
|
8
7
|
|
|
@@ -22,14 +21,10 @@ public class AirMapPolygonManager extends ViewGroupManager<AirMapPolygon> {
|
|
|
22
21
|
|
|
23
22
|
public AirMapPolygonManager(ReactApplicationContext reactContext) {
|
|
24
23
|
super();
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.getRealMetrics(metrics);
|
|
30
|
-
} else {
|
|
31
|
-
metrics = reactContext.getResources().getDisplayMetrics();
|
|
32
|
-
}
|
|
24
|
+
metrics = new DisplayMetrics();
|
|
25
|
+
((WindowManager) reactContext.getSystemService(Context.WINDOW_SERVICE))
|
|
26
|
+
.getDefaultDisplay()
|
|
27
|
+
.getRealMetrics(metrics);
|
|
33
28
|
}
|
|
34
29
|
|
|
35
30
|
@Override
|
|
@@ -109,7 +109,7 @@ public class AirMapPolyline extends AirMapFeature {
|
|
|
109
109
|
if(isGap) {
|
|
110
110
|
this.pattern.add(new Gap(patternValue));
|
|
111
111
|
}else {
|
|
112
|
-
PatternItem patternItem
|
|
112
|
+
PatternItem patternItem;
|
|
113
113
|
boolean isLineCapRound = this.lineCap instanceof RoundCap;
|
|
114
114
|
if(isLineCapRound) {
|
|
115
115
|
patternItem = new Dot();
|