本文介绍了如何获得像超级安卓应用程序的地图上的居中地位销的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人请向我解释如何获得谷歌地图上居中位置的位置像在这个优步应用程序。用户可以移动地图,但引脚始终居中居中对齐,我们可以在我们继续移动地图时获取位置。



解决方案

您可以使用


Someone please explain me how to get the location of centered place pin on Google Map Like in this Uber App. User can move the map but pin is always centered align and We can get the location as we keep moving the map.

解决方案

You can use CurrentCenterPositionMap

First import the lib:

compile 'br.com.simplepass:mapfragmentwrapper:0.8.0'

Then, all you have to do is to put the MapFragmentWrapper xml tag as a container of your map fragment. Like this:

<br.com.simplepass.mapfragmentwrapper.MapFragmentWrapper
    android:id="@+id/map_wrapper"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <fragment
        android:id="@+id/main_fragment_map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.SupportMapFragment"/>

</br.com.simplepass.mapfragmentwrapper.MapFragmentWrapper>

See the result:

这篇关于如何获得像超级安卓应用程序的地图上的居中地位销的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 16:53