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.
How to get the location of centered place pin on Map like uber android app
3.6k views Asked by Kapil At
2
There are 2 answers
0
On
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:
I'm not sure what language your using so here's a javascript solution. try creating latlng variable and using that variable to both place the marker and define center. You could do Something like this
Hope this helps.