arcgis android sdk 是需要授权才能使用,
- 授权文件licenseConfig.json, 放到react native assets 目中,如果不使用一些高级功能,基本授权也够用了
-
{
-
"LicenseKey": {
-
"MainKey": "runtimelite,1000,rud6806392543,none,5H80TK8EL7K9RJE15074",
-
"ExtensionKey": []
-
},
-
"NamedUser": {
-
"Url": "",
-
"UserName": "",
-
"Password": ""
-
}
-
}
授权使用 在地图未加载之前写
```javascript
const licenseConfig = require('../../assets/licenseConfig.json');
import {LicenseManager, StoreManager} from '@haibalai/react-native-arcgis';
StoreManager.initLicenseConfig(licenseConfig)
.then((r: any) => {
LicenseManager.initLicense();
console.log('初始化License成功');
})
.catch((e: any) => {
console.log('失败初始化:');
更多参考 https://xiaozhuanlan.com/topic/1472938065