react-native-google-maps-plus 1.6.1-dev.7 → 1.6.1-dev.9

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.
@@ -0,0 +1,29 @@
1
+ -keep class com.google.android.gms.** { *; }
2
+ -keep interface com.google.android.gms.** { *; }
3
+ -dontwarn com.google.android.gms.**
4
+ -dontnote com.google.android.gms.**
5
+
6
+ -keep class * implements android.os.Parcelable { *; }
7
+
8
+ -keepclassmembers class **$Companion {
9
+ public *;
10
+ }
11
+
12
+ -keep class com.google.maps.android.** { *; }
13
+ -keep interface com.google.maps.android.** { *; }
14
+ -dontwarn com.google.maps.android.**
15
+
16
+ -keep @androidx.annotation.Keep class * { *; }
17
+ -keepclassmembers class * {
18
+ @androidx.annotation.Keep *;
19
+ }
20
+
21
+ -keep class com.caverock.androidsvg.** { *; }
22
+ -dontwarn com.caverock.androidsvg.**
23
+
24
+ -keepclassmembers class com.caverock.androidsvg.** {
25
+ public *;
26
+ protected *;
27
+ }
28
+
29
+ -keep class com.rngooglemapsplus.** { *; }
@@ -57,6 +57,8 @@ class LocationHandler(
57
57
  this.interval = interval ?: INTERVAL_DEFAULT
58
58
  this.minUpdateInterval = minUpdateInterval ?: MIN_UPDATE_INTERVAL
59
59
  buildLocationRequest(this.priority, this.interval, this.minUpdateInterval)
60
+ stop()
61
+ start()
60
62
  }
61
63
 
62
64
  fun showLocationDialog() {
@@ -2,9 +2,11 @@ package com.rngooglemapsplus
2
2
 
3
3
  import android.graphics.Bitmap
4
4
  import android.graphics.Canvas
5
+ import android.util.Base64
5
6
  import android.util.LruCache
6
7
  import androidx.core.graphics.createBitmap
7
8
  import com.caverock.androidsvg.SVG
9
+ import com.caverock.androidsvg.SVGExternalFileResolver
8
10
  import com.facebook.react.uimanager.PixelUtil.dpToPx
9
11
  import com.google.android.gms.maps.model.BitmapDescriptor
10
12
  import com.google.android.gms.maps.model.BitmapDescriptorFactory
@@ -20,6 +22,7 @@ import kotlinx.coroutines.SupervisorJob
20
22
  import kotlinx.coroutines.ensureActive
21
23
  import kotlinx.coroutines.launch
22
24
  import kotlinx.coroutines.withContext
25
+ import java.net.URLDecoder
23
26
  import kotlin.coroutines.coroutineContext
24
27
 
25
28
  class MapMarkerBuilder(
@@ -35,6 +38,42 @@ class MapMarkerBuilder(
35
38
 
36
39
  private val jobsById = mutableMapOf<String, Job>()
37
40
 
41
+ init {
42
+ SVG.registerExternalFileResolver(
43
+ object : SVGExternalFileResolver() {
44
+ override fun resolveImage(filename: String?): Bitmap? {
45
+ if (filename.isNullOrBlank()) return null
46
+
47
+ return runCatching {
48
+ when {
49
+ filename.startsWith("data:image/svg+xml") -> {
50
+ val svgContent =
51
+ if ("base64," in filename) {
52
+ val base64 = filename.substringAfter("base64,")
53
+ String(Base64.decode(base64, Base64.DEFAULT), Charsets.UTF_8)
54
+ } else {
55
+ URLDecoder.decode(filename.substringAfter(","), "UTF-8")
56
+ }
57
+
58
+ val svg = SVG.getFromString(svgContent)
59
+ val width = (svg.documentWidth.takeIf { it > 0 } ?: 128f).toInt()
60
+ val height = (svg.documentHeight.takeIf { it > 0 } ?: 128f).toInt()
61
+
62
+ createBitmap(width, height).apply {
63
+ Canvas(this).also(svg::renderToCanvas)
64
+ }
65
+ }
66
+
67
+ else -> null
68
+ }
69
+ }.getOrNull()
70
+ }
71
+
72
+ override fun isFormatSupported(mimeType: String?): Boolean = mimeType?.startsWith("image/") == true
73
+ },
74
+ )
75
+ }
76
+
38
77
  fun build(
39
78
  m: RNMarker,
40
79
  icon: BitmapDescriptor?,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-maps-plus",
3
- "version": "1.6.1-dev.7",
3
+ "version": "1.6.1-dev.9",
4
4
  "description": "React Native wrapper for Android & iOS Google Maps SDK",
5
5
  "main": "./lib/module/index.js",
6
6
  "module": "./lib/module/index.js",
@@ -52,6 +52,7 @@
52
52
  "android/fix-prefab.gradle",
53
53
  "android/gradle.properties",
54
54
  "android/CMakeLists.txt",
55
+ "android/proguard-rules.pro",
55
56
  "android/src",
56
57
  "ios/**/*.h",
57
58
  "ios/**/*.m",