Best code examples for Android SupportMapFragment class (com.google.android.gms.maps.SupportMapFragment)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android SupportMapFragment class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android SupportMapFragment examples from Open Source projects
This code example shows how to use the following methods: getMap
 
    private void setUpMapIfNeeded() { 
        // Do a null check to confirm that we have not already instantiated the map. 
        if (mMap == null) { 
            // Try to obtain the map from the SupportMapFragment. 
            mMap = mMapFragment.getMap(); 
            // Check if we were successful in obtaining the map. 
            if (mMap != null) { 
                setUpMap(); 
            } 
        } 
    } 
 
    private void setUpMap() { 
        mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker")); 
    } 
} 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getMap
		super(context);
		this.mapFragment = mapFragment;
	} 
 
	public void init(){ 
		this.map = mapFragment.getMap();
		this.map.setMyLocationEnabled(true);
		UiSettings settings = this.map.getUiSettings();
		settings.setMyLocationButtonEnabled(true);
 
		// カメラを現在位置にフォーカスする 
		map.setOnMyLocationChangeListener(new OnMyLocationChangeListener(){
		      @Override 
		      public void onMyLocationChange(Location location) {
		    	  moveCamera(location.getLatitude(), location.getLongitude(), 15);
		    	  map.setOnMyLocationChangeListener(null); // 一回移動したらリスナーを殺す
		      } 
		});     
	} 
	 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getMap
 
    private void setUpMapIfNeeded() { 
        // Do a null check to confirm that we have not already instantiated the map. 
        if (mMap == null) { 
            // Try to obtain the map from the SupportMapFragment. 
            mMap = mMapFragment.getMap(); 
            // Check if we were successful in obtaining the map. 
            if (mMap != null) { 
                setUpMap(); 
            } 
        } 
    } 
 
    private void setUpMap() { 
    	 
    	 mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title(title)); 
		  
 		//mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng( 
 				//0, 0), 12.0f)); 
 		 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods:
    static final LatLng HAMBURG = new LatLng(53.558, 9.927); 
 
    public void onCreate(Bundle savedInstanceState) { 
        super.onCreate(savedInstanceState); 
 
        SupportMapFragment mMapFragment = new SupportMapFragment(); 
        getSupportFragmentManager().beginTransaction() 
                .add(android.R.id.content, mMapFragment).commit(); 
 
        /* if(mMapFragment != null){ 
            GoogleMap map = mMapFragment.getMap(); 
 
            Marker hamburg = map.addMarker(new MarkerOptions().position(HAMBURG) 
                    .title("Hamburg")); 
        } 
        */ 
    } 
} 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getMap
Related Android SupportMapFragment Questions & Answers:
See Code Examples for Android SupportMapFragment Methods: