React Native for Arcgis 地图开发 授权的使用 (三)

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('失败初始化:');

posted @ 2022-04-26 15:02  haibalai  阅读(39)  评论(0编辑  收藏  举报