Here-api离线地图安装

时间:2016-02-08 13:48:17

标签: android here-api

在MapEngine初始化中我想安装所有的软件包,但我在这里卡住了installMapPackages(List packageIdList),从哪里可以找到List packageIdList。

3 个答案:

答案 0 :(得分:2)

您应该使用$('.priceSlider').slider({ range: true, min: 0, max: 2000000, values: [500000, 1500000], step: 10000, slide: function(event, ui) { // first range input(min) var firstValue = ui.values[0]; // second range input(max) var secondValue = ui.values[1]; window.location.href = "http://www.xxxx.com/sample.php?price_low="+firstValue+"&price_high="+secondValue; $('.priceSlider .sliderTooltip .stLabel').html( 'R' + ui.values[0].toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "1,") + ' <span class="fa fa-arrows-h"></span> ' + 'R' + ui.values[1].toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "1,") ); var priceSliderRangeLeft = parseInt($('.priceSlider .ui-slider-range').css('left')); var priceSliderRangeWidth = $('.priceSlider .ui-slider-range').width(); var priceSliderLeft = priceSliderRangeLeft + ( priceSliderRangeWidth / 2 ) - ( $('.priceSlider .sliderTooltip').width() / 2 ); $('.priceSlider .sliderTooltip').css('left', priceSliderLeft); } }); $('.priceSlider .sliderTooltip .stLabel').html( 'R' + $('.priceSlider').slider('values', 0).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "1,") + ' <span class="fa fa-arrows-h"></span> ' + 'R' + $('.priceSlider').slider('values', 1).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "1,") ); API来检索根MapLoader#getMapPackages()对象。然后,您可以使用MapPackage方法查找要安装的国家/地区的ID。请注意,MapPackage#getId()对象不是直接从MapPackage调用返回的,而是通过Listener对象返回的。您必须提供自己的MapLoader#getMapPackages()实施方案,并在调用MapLoader.Listener之前通过MapLoader#addListener(MapLoader.Listener listener)方法进行设置。

例如:

getMapPackages()

此处有更多详情:

  • 开发者指南

https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics/maps-offline.html

  • API参考

https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics_api_nlp_hybrid_plus/com-here-android-mpa-odml-maploader.html

https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics_api_nlp_hybrid_plus/com-here-android-mpa-odml-maploader-listener.html

https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics_api_nlp_hybrid_plus/com-here-android-mpa-odml-mappackage.html

答案 1 :(得分:0)

您应该能够使用getMapPackages()方法获取List。 文档链接: https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics/maps-offline.html

答案 2 :(得分:0)

唯一的方法(我认为)是在MapPackage上递归调用getChildren(),然后检查每个子包的getTitle()以找到你需要的区域。

例如,要获取法国“Bretagne”地区的ID,您需要通过rootMapPackage.getChildren()。get(2 / Europe /)。getChildren()。get (1 / 法国 /)。的getChildren()。得到(3 / 布列塔尼 /)。的getId()

不太方便。根包上的方法“搜索(字符串标题)”会很方便。