Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ Edit both `.env` files with your API key:
GOOGLE_MAPS_API_KEY=your_api_key_here
```

The Expo `.env` also exposes the key to the web example:

```sh
EXPO_PUBLIC_GOOGLE_MAPS_API_KEY=${GOOGLE_MAPS_API_KEY}
```

## Running

From the repo root:
Expand All @@ -41,6 +47,9 @@ yarn bare android
# Run expo example
yarn expo ios
yarn expo android

# Run web example
yarn expo web
```

## Shared Components
Expand Down
8 changes: 4 additions & 4 deletions example/bare/ios/LuggMapsExample/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
<string>35F9.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
<string>CA92.1</string>
</array>
</dict>
</array>
Expand Down
1 change: 1 addition & 0 deletions example/expo/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
GOOGLE_MAPS_API_KEY=your_api_key_here
EXPO_PUBLIC_GOOGLE_MAPS_API_KEY=${GOOGLE_MAPS_API_KEY}
2 changes: 1 addition & 1 deletion example/expo/app/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function ModalScreen() {
const router = useRouter();
const mapRef = useRef<MapView>(null);
const { top, bottom } = useSafeAreaInsets();
const apiKey = process.env.GOOGLE_MAPS_API_KEY;
const apiKey = process.env.EXPO_PUBLIC_GOOGLE_MAPS_API_KEY;

const handleReady = () => {
mapRef.current?.fitCoordinates(TOUR_COORDINATES, {
Expand Down
2 changes: 2 additions & 0 deletions example/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"@lodev09/react-native-true-sheet": "4.1.0",
"@lugg/maps": "workspace:*",
"@lugg/shared-example": "workspace:*",
"@radix-ui/react-dialog": "^1.1.23",
"@radix-ui/react-presence": "^1.1.10",
"@vis.gl/react-google-maps": "^1.5.0",
"expo": "~58.0.23",
"expo-constants": "~58.0.15",
Expand Down
2 changes: 1 addition & 1 deletion example/shared/src/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface HomeProps {
}

export const HomeScreen = ({ onMarkerPress, onShowStaticMaps }: HomeProps) => {
const apiKey = process.env.GOOGLE_MAPS_API_KEY;
const apiKey = process.env.EXPO_PUBLIC_GOOGLE_MAPS_API_KEY;

return (
<TrueSheetProvider>
Expand Down
2 changes: 1 addition & 1 deletion example/shared/src/screens/MarkerDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const MarkerDetailScreen = ({
}: MarkerDetailScreenProps) => {
const { colors } = useTheme();
const { width, height } = useWindowDimensions();
const apiKey = process.env.GOOGLE_MAPS_API_KEY;
const apiKey = process.env.EXPO_PUBLIC_GOOGLE_MAPS_API_KEY;
const [provider, setProvider] = useState<MapProviderType>(
Platform.OS === 'ios' ? 'apple' : 'google'
);
Expand Down
2 changes: 1 addition & 1 deletion example/shared/src/screens/StaticMapsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export const StaticMapsScreen = ({
onSelect,
topInset = 0,
}: StaticMapsScreenProps) => {
const apiKey = process.env.GOOGLE_MAPS_API_KEY;
const apiKey = process.env.EXPO_PUBLIC_GOOGLE_MAPS_API_KEY;
const { colors } = useTheme();

const [provider, setProvider] = useState<MapProviderType>(
Expand Down
2 changes: 2 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4254,6 +4254,8 @@ __metadata:
"@lodev09/react-native-true-sheet": "npm:4.1.0"
"@lugg/maps": "workspace:*"
"@lugg/shared-example": "workspace:*"
"@radix-ui/react-dialog": "npm:^1.1.23"
"@radix-ui/react-presence": "npm:^1.1.10"
"@types/react": "npm:~19.3.0"
"@types/react-dom": "npm:~19.3.0"
"@types/react-native-web": "npm:^0"
Expand Down
Loading