react-native-amap-location icon indicating copy to clipboard operation
react-native-amap-location copied to clipboard

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

Open zhulichao opened this issue 7 years ago • 1 comments

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;

zhulichao avatar Mar 15 '17 06:03 zhulichao

对,只能获取位置信息哦

tyao1 avatar Mar 15 '17 12:03 tyao1