728x90
๋ฐ์ํ
import * as React from 'react';
import MapView from 'react-native-maps';
import { StyleSheet, Text, View, Dimensions } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<MapView region={ {
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0,
longitudeDelta: 0.0,
} } style={styles.map} >
<MapView.Marker
coordinate={{latitude: 37.78825,
longitude: -122.4324}}
title={"title"}
description={"description"}
/>
</MapView>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
map: {
width: Dimensions.get('window').width,
height: Dimensions.get('window').height,
},
});
์ถ์ฒ:
https://stackoverflow.com/questions/29412753/how-do-i-set-a-marker-in-mapview-of-react-native
How do I set a marker in MapView of React Native
I want to set a marker on MapView in React Native, but I can't find any information through official documents of MapView. If it is not allowed in that way, how can I use existed react module such as
stackoverflow.com
728x90
๋ฐ์ํ
'๐ฅ๏ธํ๋ก ํธ์๋ > React Native' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๋ฆฌ์กํธ ๋ค์ดํฐ๋ธ - WebView ์๋ฐ์คํฌ๋ฆฝํธ ์กฐ์ & WebView์ ์ฑ ๋ฉ์์ง ์ ๋ฌ (0) | 2022.10.21 |
---|---|
๋ฆฌ์กํธ ๋ค์ดํฐ๋ธ - ์ ์ฉํ ์ฌ์ดํธ ๋ชจ์ (0) | 2022.10.10 |
๋ฆฌ์กํธ ๋ค์ดํฐ๋ธ - Expo snack์์ ํจํค์ง ์ถ๊ฐ ๋ฐฉ๋ฒ (0) | 2022.10.10 |
React Native - ์ด๊ธฐ ์ค์น (0) | 2022.04.07 |