我在我的 react-native 项目中遇到了 HEREMap Premium Android SDK 的性能问题。以前我使用的是免费版的 HEREMap,我的 map View 表现非常好。但是一旦我切换到 Premium SDK, View 渲染变得非常慢。
以下是我为高级 SDK 集成所做的唯一更改,
- 在
MapEngine.getInstance().init
之前调用setIsolatedDiskCacheRootPath
接口(interface) - 更新app/src/main/AndroidManifest.xml中的license key信息
我错过了什么吗?请帮忙。
最佳答案
当您第一次调用 setIsolatedDiskCacheRootPath 时,下载所有 map 数据需要更长的时间。因此,这是您更改为 Premium SDK 后的第一次预期行为。此外, map 加载时间也取决于您的网络连接。一般来说,Here 建议在您的应用程序中下载离线 map 。
编辑:您也可以尝试删除 setIsolatedDiskCacheRootPath(),然后您可以相应地更改您的 list 文件。请参阅 https://developer.here.com/documentation/android-premium/dev_guide/topics/map-service.html 中的“将共享磁盘缓存与 map 服务一起使用”部分
<service
android:name="com.here.android.mpa.service.MapService"
android:label="HereMapService"
android:process="global.Here.Map.Service.v3"
android:exported="true" >
<intent-filter>
<action android:name="com.here.android.mpa.service.MapService.v3" >
</action>
</intent-filter>
</service>
关于android - 切换到 HEREMap premium SDK 后性能下降,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54705159/