Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Thanks to me i find the solution if any once have same problem use following code.</p> <pre><code>import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.MapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.CameraPosition; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; import com.tfick.android.R; public class PoiFragment extends MapFragment { /*object of google map*/ public GoogleMap mGoogleMap; /* summy location*/ private static final LatLng SYDNEY = new LatLng(23.03, 72.62); @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return super.onCreateView(inflater, container, savedInstanceState); } @Override public void onActivityCreated(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onActivityCreated(savedInstanceState); if (getMap() != null) { Log.d(getClass().getSimpleName(), "Map ready for use!"); mGoogleMap = getMap(); /* cretaing custom camera position */ CameraPosition mCameraPosition = new CameraPosition.Builder() .target(SYDNEY).bearing(0).tilt(30).build(); Log.i("gmap", mGoogleMap.toString()); /* setting custom camera position */ mGoogleMap.animateCamera(CameraUpdateFactory .newCameraPosition(mCameraPosition)); /* adding custom marker on the map. */ mGoogleMap .addMarker(new MarkerOptions() .draggable(true) .position(new LatLng(22.03, 72.56)) .title("hello world") .snippet("Ahmedabad") .icon(BitmapDescriptorFactory .fromResource(R.drawable.wifi))); mGoogleMap .addMarker(new MarkerOptions() .draggable(true) .position(new LatLng(23.03, 78.10)) .title("hello world") .snippet("Baroda") .icon(BitmapDescriptorFactory .fromResource(R.drawable.wifi))); } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload