react-native-arena-map

## Getting started

Usage no npm install needed!

<script type="module">
  import reactNativeArenaMap from 'https://cdn.skypack.dev/react-native-arena-map';
</script>

README

react-native-arena-map

Getting started

$ npm install react-native-arena-map --save

Mostly automatic installation

$ react-native link react-native-arena-map

配置

iOS
  1. 在info.plist 中添加地理位置权限Privacy - Location When In Use Usage Description
  2. 把ios文件夹下的source 和 framework 两个文件夹,导入主工程
  3. 添加高德德图的库的依赖,分别为CoreTelephony.framework,CoreLocation.framework,SystemConfiguration.framework,Security.framework,libz.tbd,libc++.tbd,GLKit.framework,ExternalAccessory.framework,
Android
  1. 报32位64位冲突,在app.gradel中配置

defaultConfig {
    ndk {
          abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
        }
}
<!--在app/src/main/AndroidManifest.xml 中加入高德appKey-->
<meta-data
            android:name="com.amap.api.v2.apikey"
            android:value="58d28b59f3da0075c246e0ec372e9980" />
 

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-arena-map and add RNArenaMap.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNArenaMap.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.dingle.map.RNArenaMapPackage; to the imports at the top of the file
  • Add new RNArenaMapPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-arena-map'
    project(':react-native-arena-map').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-arena-map/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-arena-map')
    

Usage

import RNArenaMap from 'react-native-arena-map';

// TODO: What to do with the module?
RNArenaMap.showLocationSelectMapview().then((data)=>{
<!--成功-->
},(error)=>{
<!--失败-->
})