簡體   English   中英

HERE Android SDK 依次說明

[英]HERE Android SDK Turn by turn instruction

我正在使用 HERE Android SDK 執行逐次導航項目。 但我沒有得到類似於圖像的結果。

在此處輸入圖片說明

我有這個代碼來獲取當前的 manauver

private NavigationManager.NewInstructionEventListener newInstructionEventListener = new NavigationManager.NewInstructionEventListener() {
    @Override
    public void onNewInstructionEvent() {
        Maneuver maneuver = navigationManager.getNextManeuver();

        if (maneuver != null) {
            if (maneuver.getAction() == Maneuver.Action.END) {

            }

            tvManeuver.setText(navigationManager.getNextManeuver().getTurn().name() + " " + maneuver.getIcon().value());
            ivTitle.setImageBitmap(maneuver.getNextRoadImage().getBitmap());
            tvStreet.setText(maneuver.getRoadName());
            tvMeters.setText("durante " + maneuver.getDistanceFromPreviousManeuver() + " m");

            if (maneuver.getDistanceToNextManeuver() == 0) {
                tvMeters.setVisibility(View.GONE);
            } else {
                tvMeters.setVisibility(View.VISIBLE);
            }
        }
    }
};

但我沒有得到正確的機動文本。 例如“在下一個角右轉”和相應的箭頭圖標放在 IMAGEVIEW 中。

有誰能夠幫我?

問候。

我假設您提供的圖像來自Google Store上的HERE Maps,這是使用HERE SDK的自定義實現。

您可以從Maneuver獲得說明,請查看文檔https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics_api_nlp_hybrid_plus/com-here-android-mpa-routing-maneuver.html#topic- apiref__getinstruction-無效

還應該從getIcon()中檢索圖標,該圖標會給出枚舉,並且您需要在圖標中創建圖像以進行可能的枚舉,請查看文檔https://developer.here.com/mobile-sdks/documentation/android-hybrid-加/ topics_api_nlp_hybrid_plus / COM-這里,Android的MPA路由-操縱-icon.html#話題apiref

如果要獲取操作列表,則無法在NewInstructionEvent上獲取它。 由於您已經在導航中,因此應該已經有了您的路線對象。 在路由對象上,您只需調用getManeuvers()。 這將為您提供當前路線的所有機動清單。

您也可以參考他們的UI工具包https://developer.here.com/blog/build-beautiful-interfaces-with-the-here-mobile-sdk-ui-kit-for-android-and-ios

希望這可以幫助。 我知道這是一個較舊的線程。

HERE SDK Premium 不提供導航開始前的機動指令,您也無法在任何時候獲得機動指令列表。

但是,您可以使用 HERE Routing API 獲取機動指令列表。

https://developer.here.com/documentation/routing-api/dev_guide/topics/use-cases/actions.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM