๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ–ฅ๏ธํ”„๋ก ํŠธ์—”๋“œ/React Native

๋ฆฌ์•กํŠธ ๋„ค์ดํ‹ฐ๋ธŒ - MapView Marker ์‚ฌ์šฉ ์˜ˆ์ œ

by Janger 2022. 10. 14.
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
๋ฐ˜์‘ํ˜•