小编Raf*_*ega的帖子

如何在 React Native 中从谷歌地图自动完成获取地址

我正在使用react-native-google-places-autocomplete来选择一个位置。我想提取选定的位置并在其他组件中使用它。

怎么保存地址

这是我的代码

import React, {Component} from 'react';
import { View, Image, Text, StyleSheet } from 'react-native';
import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete';

const homePlace = { description: 'Home', geometry: { location: { lat: 48.8152937, lng: 2.4597668 } }};
const workPlace = { description: 'Work', geometry: { location: { lat: 48.8496818, lng: 2.2940881 } }};

export default class google extends Component {
  render(){

  return (
    <View style={styles.container}>
      <View style={styles.top}>
    <GooglePlacesAutocomplete
      placeholder='Search'
      minLength={2} // minimum length of text to …
Run Code Online (Sandbox Code Playgroud)

google-maps autocomplete react-native react-native-maps react-props

5
推荐指数
1
解决办法
2万
查看次数