Loading current location in Google Maps is not quick in android -


I am trying to load my current location in Google Maps V2. The problem is that when I load the app, I first see the default map which is loaded near Africa and then it animates in the current location after 1 or 2 seconds. Instead, I want to show my map directly on some existing places like Maps or Uber.

I'm not sure where I am going wrong: Here I have done that:

InTap () is said in the fragment of the onCreateView.

  Personal Boolean initMap () {if (googleMap == null) {SupportMapFragment MapFrag = (SupportMapFragment) getFragmentManager () FindFragmentById (R.id.map)); GoogleMap = mapFrag.getMap (); GoogleMap.setTrafficEnabled (true); If (friendslocationclicked == incorrect) {googleMap.setMyLocationEnabled (true); } GoogleMap.setMapType (GoogleMap.MAP_TYPE_NORMAL); GoogleMap.setOnMyLocationChangeListener (New GoogleMap.OnMyLocationChangeListener) {@OverrideMyLocationChange at position zero (location ARG0) {googleMap.animateCamera (CameraUpdateFactory.newLatLongZoom (new wave long (arg0.getLatitude), arg0.getLongitude ()), geomvrna); googleMap. Addmarker (new marker option (). Position (new wave length (arg0.getLatitude (), arg0.getLongitude ()) .title ("this is me!"));}});} Return (google map! = Null) ;}  

Can anyone help me solve this problem?

  - animateCamera ()  

Use: - f Lkamra () eg: -

  googleMap.moveCamera (CameraUpdateFactory.newLatLongZoom (new slots long (arg0.getLatitude), arg0.getLongitude ()), 14.0 F));  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -