@lugg/maps 1.0.0-beta.12 → 1.0.0-beta.14
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/src/main/java/com/luggmaps/LuggPolylineView.kt +2 -1
- package/android/src/main/java/com/luggmaps/core/GoogleMapProvider.kt +12 -2
- package/android/src/main/java/com/luggmaps/core/PolylineAnimator.kt +1 -1
- package/ios/events/CameraIdleEvent.h +4 -2
- package/ios/events/CameraMoveEvent.h +4 -2
- package/ios/events/CirclePressEvent.h +4 -2
- package/ios/events/GroundOverlayPressEvent.h +4 -2
- package/ios/events/LongPressEvent.h +4 -2
- package/ios/events/MarkerDragEvent.h +12 -6
- package/ios/events/MarkerPressEvent.h +4 -2
- package/ios/events/PolygonPressEvent.h +4 -2
- package/ios/events/PressEvent.h +4 -2
- package/ios/events/ReadyEvent.h +4 -2
- package/ios/events/TileOverlayPressEvent.h +4 -2
- package/package.json +9 -8
- package/plugin/build/withMapsAndroid.d.ts +0 -5
- package/plugin/build/withMapsAndroid.js +0 -15
- package/plugin/build/withMapsIOS.d.ts +0 -5
- package/plugin/build/withMapsIOS.js +0 -27
|
@@ -8,6 +8,7 @@ import com.google.android.gms.maps.model.Polyline
|
|
|
8
8
|
|
|
9
9
|
interface LuggPolylineViewDelegate {
|
|
10
10
|
fun polylineViewDidUpdate(polylineView: LuggPolylineView)
|
|
11
|
+
fun polylineViewDidDrop(polylineView: LuggPolylineView)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
data class AnimatedOptions(val duration: Long = 2150L, val easing: String = "linear", val trailLength: Float = 1f, val delay: Long = 0L)
|
|
@@ -67,8 +68,8 @@ class LuggPolylineView(context: Context) : ReactViewGroup(context) {
|
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
fun onDropViewInstance() {
|
|
71
|
+
delegate?.polylineViewDidDrop(this)
|
|
70
72
|
delegate = null
|
|
71
|
-
polyline?.remove()
|
|
72
73
|
polyline = null
|
|
73
74
|
}
|
|
74
75
|
}
|
|
@@ -598,6 +598,10 @@ class GoogleMapProvider(private val context: Context) :
|
|
|
598
598
|
syncPolylineView(polylineView)
|
|
599
599
|
}
|
|
600
600
|
|
|
601
|
+
override fun polylineViewDidDrop(polylineView: LuggPolylineView) {
|
|
602
|
+
teardownPolyline(polylineView)
|
|
603
|
+
}
|
|
604
|
+
|
|
601
605
|
// endregion
|
|
602
606
|
|
|
603
607
|
// region PolygonViewDelegate
|
|
@@ -773,8 +777,12 @@ class GoogleMapProvider(private val context: Context) :
|
|
|
773
777
|
}
|
|
774
778
|
|
|
775
779
|
override fun removePolylineView(polylineView: LuggPolylineView) {
|
|
776
|
-
|
|
777
|
-
|
|
780
|
+
teardownPolyline(polylineView)
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
private fun teardownPolyline(polylineView: LuggPolylineView) {
|
|
784
|
+
pendingPolylineViews.remove(polylineView)
|
|
785
|
+
polylineAnimators.remove(polylineView)?.destroy()
|
|
778
786
|
polylineView.polyline?.remove()
|
|
779
787
|
polylineView.polyline = null
|
|
780
788
|
}
|
|
@@ -812,6 +820,8 @@ class GoogleMapProvider(private val context: Context) :
|
|
|
812
820
|
private fun addPolylineViewToMap(polylineView: LuggPolylineView) {
|
|
813
821
|
val map = googleMap ?: return
|
|
814
822
|
|
|
823
|
+
polylineAnimators.remove(polylineView)?.destroy()
|
|
824
|
+
|
|
815
825
|
val options = PolylineOptions()
|
|
816
826
|
.width(polylineView.strokeWidth.dpToPx())
|
|
817
827
|
.zIndex(polylineView.zIndex)
|
|
@@ -249,7 +249,7 @@ class PolylineAnimator {
|
|
|
249
249
|
// Clear spans before setting points to prevent IndexOutOfBoundsException
|
|
250
250
|
// when the new points list is shorter than what existing spans reference
|
|
251
251
|
poly.color = strokeColors.firstOrNull() ?: Color.BLACK
|
|
252
|
-
poly.points =
|
|
252
|
+
poly.points = reusablePoints
|
|
253
253
|
|
|
254
254
|
if (strokeColors.size > 1) {
|
|
255
255
|
val segmentCount = reusablePoints.size - 1
|
|
@@ -11,8 +11,10 @@ struct CameraIdleEvent {
|
|
|
11
11
|
double zoom;
|
|
12
12
|
bool gesture;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
15
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
16
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
17
|
+
void emit(const EventEmitterPtr &eventEmitter) const {
|
|
16
18
|
if (!eventEmitter)
|
|
17
19
|
return;
|
|
18
20
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
@@ -11,8 +11,10 @@ struct CameraMoveEvent {
|
|
|
11
11
|
double zoom;
|
|
12
12
|
bool gesture;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
15
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
16
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
17
|
+
void emit(const EventEmitterPtr &eventEmitter) const {
|
|
16
18
|
if (!eventEmitter)
|
|
17
19
|
return;
|
|
18
20
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
@@ -6,8 +6,10 @@ namespace luggmaps {
|
|
|
6
6
|
namespace events {
|
|
7
7
|
|
|
8
8
|
struct CirclePressEvent {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
10
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
11
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
12
|
+
static void emit(const EventEmitterPtr &eventEmitter) {
|
|
11
13
|
if (!eventEmitter)
|
|
12
14
|
return;
|
|
13
15
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
@@ -6,8 +6,10 @@ namespace luggmaps {
|
|
|
6
6
|
namespace events {
|
|
7
7
|
|
|
8
8
|
struct GroundOverlayPressEvent {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
10
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
11
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
12
|
+
static void emit(const EventEmitterPtr &eventEmitter) {
|
|
11
13
|
if (!eventEmitter)
|
|
12
14
|
return;
|
|
13
15
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
@@ -11,8 +11,10 @@ struct LongPressEvent {
|
|
|
11
11
|
double x;
|
|
12
12
|
double y;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
15
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
16
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
17
|
+
void emit(const EventEmitterPtr &eventEmitter) const {
|
|
16
18
|
if (!eventEmitter)
|
|
17
19
|
return;
|
|
18
20
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
@@ -11,8 +11,10 @@ struct MarkerDragStartEvent {
|
|
|
11
11
|
double x;
|
|
12
12
|
double y;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
15
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
16
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
17
|
+
void emit(const EventEmitterPtr &eventEmitter) const {
|
|
16
18
|
if (!eventEmitter)
|
|
17
19
|
return;
|
|
18
20
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
@@ -31,8 +33,10 @@ struct MarkerDragChangeEvent {
|
|
|
31
33
|
double x;
|
|
32
34
|
double y;
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
37
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
38
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
39
|
+
void emit(const EventEmitterPtr &eventEmitter) const {
|
|
36
40
|
if (!eventEmitter)
|
|
37
41
|
return;
|
|
38
42
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
@@ -51,8 +55,10 @@ struct MarkerDragEndEvent {
|
|
|
51
55
|
double x;
|
|
52
56
|
double y;
|
|
53
57
|
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
59
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
60
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
61
|
+
void emit(const EventEmitterPtr &eventEmitter) const {
|
|
56
62
|
if (!eventEmitter)
|
|
57
63
|
return;
|
|
58
64
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
@@ -11,8 +11,10 @@ struct MarkerPressEvent {
|
|
|
11
11
|
double x;
|
|
12
12
|
double y;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
15
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
16
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
17
|
+
void emit(const EventEmitterPtr &eventEmitter) const {
|
|
16
18
|
if (!eventEmitter)
|
|
17
19
|
return;
|
|
18
20
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
@@ -6,8 +6,10 @@ namespace luggmaps {
|
|
|
6
6
|
namespace events {
|
|
7
7
|
|
|
8
8
|
struct PolygonPressEvent {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
10
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
11
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
12
|
+
static void emit(const EventEmitterPtr &eventEmitter) {
|
|
11
13
|
if (!eventEmitter)
|
|
12
14
|
return;
|
|
13
15
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
package/ios/events/PressEvent.h
CHANGED
|
@@ -11,8 +11,10 @@ struct PressEvent {
|
|
|
11
11
|
double x;
|
|
12
12
|
double y;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
15
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
16
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
17
|
+
void emit(const EventEmitterPtr &eventEmitter) const {
|
|
16
18
|
if (!eventEmitter)
|
|
17
19
|
return;
|
|
18
20
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
package/ios/events/ReadyEvent.h
CHANGED
|
@@ -6,8 +6,10 @@ namespace luggmaps {
|
|
|
6
6
|
namespace events {
|
|
7
7
|
|
|
8
8
|
struct ReadyEvent {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
10
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
11
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
12
|
+
static void emit(const EventEmitterPtr &eventEmitter) {
|
|
11
13
|
if (!eventEmitter)
|
|
12
14
|
return;
|
|
13
15
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
@@ -6,8 +6,10 @@ namespace luggmaps {
|
|
|
6
6
|
namespace events {
|
|
7
7
|
|
|
8
8
|
struct TileOverlayPressEvent {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// Holder type is templated to bridge RN versions: SharedEventEmitter went
|
|
10
|
+
// from shared_ptr<const EventEmitter> to shared_ptr<EventEmitter> in 0.85.
|
|
11
|
+
template <typename Emitter, typename EventEmitterPtr>
|
|
12
|
+
static void emit(const EventEmitterPtr &eventEmitter) {
|
|
11
13
|
if (!eventEmitter)
|
|
12
14
|
return;
|
|
13
15
|
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lugg/maps",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.14",
|
|
4
4
|
"description": "Universal maps for React Native.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -75,8 +75,9 @@
|
|
|
75
75
|
"@eslint/compat": "^1.3.2",
|
|
76
76
|
"@eslint/eslintrc": "^3.3.1",
|
|
77
77
|
"@eslint/js": "^9.35.0",
|
|
78
|
-
"@react-native/babel-preset": "0.
|
|
79
|
-
"@react-native/eslint-config": "0.
|
|
78
|
+
"@react-native/babel-preset": "0.85.3",
|
|
79
|
+
"@react-native/eslint-config": "0.85.3",
|
|
80
|
+
"@react-native/jest-preset": "0.85.3",
|
|
80
81
|
"@release-it/conventional-changelog": "^10.0.1",
|
|
81
82
|
"@types/jest": "^29.5.14",
|
|
82
83
|
"@types/react": "^19.2.0",
|
|
@@ -89,15 +90,15 @@
|
|
|
89
90
|
"jest": "^29.7.0",
|
|
90
91
|
"lefthook": "^2.0.3",
|
|
91
92
|
"prettier": "^2.8.8",
|
|
92
|
-
"react": "19.2.
|
|
93
|
-
"react-native": "0.
|
|
93
|
+
"react": "19.2.3",
|
|
94
|
+
"react-native": "0.85.3",
|
|
94
95
|
"react-native-builder-bob": "^0.40.13",
|
|
95
96
|
"release-it": "^19.0.4",
|
|
96
97
|
"turbo": "^2.5.6",
|
|
97
98
|
"typescript": "^5.9.2"
|
|
98
99
|
},
|
|
99
100
|
"resolutions": {
|
|
100
|
-
"@lodev09/react-native-true-sheet": "3.
|
|
101
|
+
"@lodev09/react-native-true-sheet": "3.11.0-beta.10"
|
|
101
102
|
},
|
|
102
103
|
"peerDependencies": {
|
|
103
104
|
"@vis.gl/react-google-maps": ">=1.0.0",
|
|
@@ -110,7 +111,7 @@
|
|
|
110
111
|
}
|
|
111
112
|
},
|
|
112
113
|
"dependencies": {
|
|
113
|
-
"@expo/config-plugins": "^
|
|
114
|
+
"@expo/config-plugins": "^56.0.8"
|
|
114
115
|
},
|
|
115
116
|
"workspaces": [
|
|
116
117
|
"example/bare",
|
|
@@ -158,7 +159,7 @@
|
|
|
158
159
|
}
|
|
159
160
|
},
|
|
160
161
|
"jest": {
|
|
161
|
-
"preset": "react-native",
|
|
162
|
+
"preset": "@react-native/jest-preset",
|
|
162
163
|
"modulePathIgnorePatterns": [
|
|
163
164
|
"<rootDir>/example/bare/node_modules",
|
|
164
165
|
"<rootDir>/lib/"
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withLuggMapsAndroid = void 0;
|
|
4
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
-
const withLuggMapsAndroid = (config, { apiKey }) => {
|
|
6
|
-
if (!apiKey) {
|
|
7
|
-
return config;
|
|
8
|
-
}
|
|
9
|
-
return (0, config_plugins_1.withAndroidManifest)(config, (c) => {
|
|
10
|
-
const mainApplication = config_plugins_1.AndroidConfig.Manifest.getMainApplicationOrThrow(c.modResults);
|
|
11
|
-
config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(mainApplication, 'com.google.android.geo.API_KEY', apiKey);
|
|
12
|
-
return c;
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
exports.withLuggMapsAndroid = withLuggMapsAndroid;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withLuggMapsIOS = void 0;
|
|
4
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
-
const withLuggMapsIOS = (config, { apiKey }) => {
|
|
6
|
-
if (!apiKey) {
|
|
7
|
-
return config;
|
|
8
|
-
}
|
|
9
|
-
config = (0, config_plugins_1.withInfoPlist)(config, (c) => {
|
|
10
|
-
c.modResults.GMSApiKey = apiKey;
|
|
11
|
-
return c;
|
|
12
|
-
});
|
|
13
|
-
config = (0, config_plugins_1.withAppDelegate)(config, (c) => {
|
|
14
|
-
const contents = c.modResults.contents;
|
|
15
|
-
// Add import for GoogleMaps
|
|
16
|
-
if (!contents.includes('import GoogleMaps')) {
|
|
17
|
-
c.modResults.contents = contents.replace(/(import (?:UIKit|Expo))/, '$1\nimport GoogleMaps');
|
|
18
|
-
}
|
|
19
|
-
// Add GMSServices.provideAPIKey call
|
|
20
|
-
if (!c.modResults.contents.includes('GMSServices.provideAPIKey')) {
|
|
21
|
-
c.modResults.contents = c.modResults.contents.replace(/(func application\([^)]+\)[^{]*\{)/, `$1\n GMSServices.provideAPIKey("${apiKey}")\n`);
|
|
22
|
-
}
|
|
23
|
-
return c;
|
|
24
|
-
});
|
|
25
|
-
return config;
|
|
26
|
-
};
|
|
27
|
-
exports.withLuggMapsIOS = withLuggMapsIOS;
|