Skip to content

Commit 767ecc7

Browse files
committed
fix: marker, polyline, polygon and circle update
1 parent 36a1291 commit 767ecc7

38 files changed

+1451
-257
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ apply from: "./fix-prefab.gradle"
2828
if (rootProject.name != "rngooglemapsplus.example") {
2929
apply plugin: "com.facebook.react"
3030
} else {
31-
println("\u001B[33m⚠️ Skipping React Native Gradle plugin in library (example build detected)\u001B[0m")
31+
println("\u001B[33mSkipping React Native Gradle plugin in library (example build detected)\u001B[0m")
3232
}
3333

3434
def getExtOrIntegerDefault(name) {

android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class MapMarkerBuilder(
6868
}
6969
marker.title = next.title
7070
marker.snippet = next.snippet
71-
marker.alpha = next.opacity?.toFloat() ?: 0f
71+
marker.alpha = next.opacity?.toFloat() ?: 1f
7272
marker.isFlat = next.flat ?: false
7373
marker.isDraggable = next.draggable ?: false
7474
marker.rotation = next.rotation?.toFloat() ?: 0f

android/src/main/java/com/rngooglemapsplus/extensions/RNMarkerExtension.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ fun RNMarker.markerEquals(b: RNMarker): Boolean =
77
zIndex == b.zIndex &&
88
coordinate == b.coordinate &&
99
anchor == b.anchor &&
10+
showInfoWindow == b.showInfoWindow &&
11+
title == b.title &&
12+
snippet == b.snippet &&
13+
opacity == b.opacity &&
14+
flat == b.flat &&
15+
draggable == b.draggable &&
16+
rotation == b.rotation &&
17+
infoWindowAnchor == b.infoWindowAnchor &&
1018
markerStyleEquals(b)
1119

1220
fun RNMarker.markerStyleEquals(b: RNMarker): Boolean = iconSvg == b.iconSvg

android/src/main/java/com/rngooglemapsplus/extensions/RNPolygonExtension.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ fun RNPolygon.polygonEquals(b: RNPolygon): Boolean {
88
if (strokeWidth != b.strokeWidth) return false
99
if (fillColor != b.fillColor) return false
1010
if (strokeColor != b.strokeColor) return false
11+
if (geodesic != b.geodesic) return false
12+
if (!holes.contentEquals(b.holes)) return false
1113
val ac = coordinates
1214
val bc = b.coordinates
1315
if (ac.size != bc.size) return false

android/src/main/java/com/rngooglemapsplus/extensions/RNPolylineExtension.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ fun RNPolyline.polylineEquals(b: RNPolyline): Boolean {
88
if ((width ?: 0.0) != (b.width ?: 0.0)) return false
99
if (lineCap != b.lineCap) return false
1010
if (lineJoin != b.lineJoin) return false
11+
if (geodesic != b.geodesic) return false
1112
if (color != b.color) return false
1213
val ac = coordinates
1314
val bc = b.coordinates

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PODS:
1616
- hermes-engine (0.82.0):
1717
- hermes-engine/Pre-built (= 0.82.0)
1818
- hermes-engine/Pre-built (0.82.0)
19-
- NitroModules (0.29.8):
19+
- NitroModules (0.30.0):
2020
- boost
2121
- DoubleConversion
2222
- fast_float
@@ -3018,7 +3018,7 @@ SPEC CHECKSUMS:
30183018
Google-Maps-iOS-Utils: bed22fa703c919259b3901449434d60d994fae20
30193019
GoogleMaps: a40d3b1f511f0fa2036e7b08c920c33279b1d5fd
30203020
hermes-engine: 8642d8f14a548ab718ec112e9bebdfdd154138b5
3021-
NitroModules: 73c42f3089bd74f411172ea8e69024aac4a2ac9f
3021+
NitroModules: 9d7097ba832aa88b678bf65b8a04e5ea565334d8
30223022
RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669
30233023
RCTDeprecation: 22bf66112da540a7d40e536366ddd8557934fca1
30243024
RCTRequired: a0ed4dc41b35f79fbb6d8ba320e06882a8c792cf

example/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
"react-native": "0.82.0",
1919
"react-native-gesture-handler": "2.28.0",
2020
"react-native-google-maps-plus": "workspace:*",
21-
"react-native-nitro-modules": "0.29.8",
21+
"react-native-nitro-modules": "0.30.0",
2222
"react-native-reanimated": "4.1.3",
2323
"react-native-safe-area-context": "5.6.1",
2424
"react-native-screens": "4.16.0",
25-
"react-native-worklets": "0.6.1"
25+
"react-native-worklets": "0.6.1",
26+
"superstruct": "^2.0.2"
2627
},
2728
"devDependencies": {
2829
"@babel/core": "7.28.4",
@@ -36,7 +37,7 @@
3637
"@react-native/typescript-config": "0.82.0",
3738
"@types/react": "19.1.1",
3839
"react-native-builder-bob": "0.40.13",
39-
"react-native-monorepo-config": "0.2.1"
40+
"react-native-monorepo-config": "0.2.2"
4041
},
4142
"engines": {
4243
"node": ">=20"

example/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
22
import {
3-
NavigationContainer,
4-
DefaultTheme,
53
DarkTheme,
4+
DefaultTheme,
5+
NavigationContainer,
66
} from '@react-navigation/native';
77
import { createStackNavigator } from '@react-navigation/stack';
88

@@ -113,7 +113,7 @@ export default function App() {
113113
options={{ title: 'Snapshot test' }}
114114
/>
115115
<Stack.Screen
116-
name="StressTest"
116+
name="Stress"
117117
component={StressTestScreen}
118118
options={{ title: 'Stress test' }}
119119
/>

example/src/components/ControlPanel.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import React, { useMemo } from 'react';
22
import {
3-
View,
4-
Text,
5-
TouchableOpacity,
63
ScrollView,
74
StyleSheet,
5+
Text,
6+
TouchableOpacity,
7+
View,
88
} from 'react-native';
99
import Animated, {
10-
useSharedValue,
10+
Extrapolation,
11+
interpolate,
1112
useAnimatedStyle,
13+
useSharedValue,
1214
withTiming,
13-
interpolate,
14-
Extrapolation,
1515
} from 'react-native-reanimated';
1616
import type { GoogleMapsViewRef } from 'react-native-google-maps-plus';
1717
import { useAppTheme } from '../theme';
@@ -29,7 +29,7 @@ export default function ControlPanel({ mapRef, buttons }: Props) {
2929
const theme = useAppTheme();
3030
const navigation = useNavigation<RootNavigationProp>();
3131
const progress = useSharedValue(0);
32-
const styles = getThemedStyles(theme);
32+
const styles = useMemo(() => getThemedStyles(theme), [theme]);
3333

3434
const toggle = () => {
3535
progress.value = withTiming(progress.value === 1 ? 0 : 1, {
@@ -62,7 +62,10 @@ export default function ControlPanel({ mapRef, buttons }: Props) {
6262
{
6363
title: 'Check Google Play Services',
6464
onPress: () =>
65-
console.log(mapRef.current?.isGooglePlayServicesAvailable()),
65+
console.log(
66+
'Google Play Services result',
67+
mapRef.current?.isGooglePlayServicesAvailable()
68+
),
6669
},
6770
],
6871
[buttons, mapRef, navigation]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React, { useMemo } from 'react';
2+
import { Pressable, StyleSheet, Text } from 'react-native';
3+
import { useAppTheme } from '../theme';
4+
5+
type Props = {
6+
title: string;
7+
onPress: () => void;
8+
};
9+
10+
export default function HeaderButton({ title, onPress }: Props) {
11+
const theme = useAppTheme();
12+
const styles = useMemo(() => getThemedStyles(theme), [theme]);
13+
14+
return (
15+
<Pressable onPress={onPress} style={() => [styles.headerButton]}>
16+
<Text style={[styles.headerButtonText]}>{title}</Text>
17+
</Pressable>
18+
);
19+
}
20+
21+
const getThemedStyles = (theme: any) =>
22+
StyleSheet.create({
23+
headerButton: {
24+
paddingHorizontal: 12,
25+
paddingVertical: 6,
26+
borderRadius: 6,
27+
marginRight: 12,
28+
},
29+
headerButtonText: {
30+
color: theme.textPrimary,
31+
fontSize: 15,
32+
fontWeight: '600',
33+
},
34+
});

0 commit comments

Comments
 (0)