tyao1 / react-native-amap-location

Android amap location sdk for react native
MIT License
133 stars 23 forks source link

我想问一下控制台可以打印位置信息,但是没有显示地图,react-native-amap-location是不能显示地图只能获取位置信息吗?还是我哪里写的不对? #16

Open zhulichao opened 7 years ago

zhulichao commented 7 years ago
import React, { Component } from 'react';
import { View, Text, TouchableHighlight, StyleSheet, InteractionManager } from 'react-native';
import AMapLocation from 'react-native-amap-location';

class Amap extends Component {
  componentDidMount() {
    this.listener = AMapLocation.addEventListener((data) => console.log('data', data));

    AMapLocation.startLocation({
      accuracy: 'HighAccuracy',
      killProcess: true,
      needDetail: true,
    });
  }
  componentWillUnmount() {
    AMapLocation.stopLocation();
    this.listener.remove();
  }
  render() {
    return (
      <View style={{flexDirection: 'row', alignItems: 'center'}}></View>
    );
  }
}

export default Amap;
tyao1 commented 7 years ago

对,只能获取位置信息哦