【问题标题】:Expo google maps Location Geocoding autocomplete [closed]世博会谷歌地图位置地理编码自动完成[关闭]
【发布时间】:2020-06-17 03:25:08
【问题描述】:

我正在为我的地图输入文本,使用 Expo Location API(地理编码)搜索给定位置。我的问题是我想为这些位置做一个自动完成......就像这个组件https://yarnpkg.com/package/react-native-google-places-autocomplete

有什么想法吗?由于“Powered by Google”徽标,我不使用 react-native-google-places-autocomplete。

Pd:谷歌版权标志在地图底部。

【问题讨论】:

    标签: reactjs react-native google-maps google-maps-api-3 expo


    【解决方案1】:

    您可以使用react-native-google-places-autocomplete 来做到这一点。

    有一个道具可以让你禁用 power by google 标签。 enablePoweredByContainer={false}.

    import React from 'react';
    import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete';
    
    const GooglePlacesInput = () => {
      return (
        <GooglePlacesAutocomplete
          placeholder='Search'
          onPress={(data, details = null) => {
            // 'details' is provided when fetchDetails = true
            console.log(data, details);
          }}
          query={{
            key: 'YOUR API KEY',
            language: 'en',
          }}
          enablePoweredByContainer={false}
        />
      );
    };
    
    export default GooglePlacesInput;
    

    【讨论】:

      猜你喜欢
      • 2012-02-20
      • 2015-09-16
      • 1970-01-01
      • 2019-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多