HERE Map/MapView without using MapFragment

穿精又带淫゛_ 提交于 2019-12-01 09:37:16

问题


Is there a way to get a Map or MapView without placing a MapFragmet inside a Layout?

<com.here.android.mpa.mapping.MapView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/here_map"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"/>

I already tried to place a MapView directly in my layout but there is no method to initialize or request a Map from it.


回答1:


You can have a com.here.android.mpa.mapping.MapView in your layout without the use of a fragment.

Simply call new com.here.android.mpa.mapping.Map() and call com.here.android.mpa.mapping.MapView#setMap( map ) to attach the map to the map view.

Note you can only attach each map to a single map view. Also, make sure to call Mapview#onPause() and MapView#onResume() or the underlying textureview will not work correctly!

References: https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics_api_nlp_hybrid_plus/com-here-android-mpa-mapping-mapview.html#topic-apiref__setmap-map



来源:https://stackoverflow.com/questions/35506270/here-map-mapview-without-using-mapfragment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!