Code example for SupportMapFragment

Methods: onCreate

0
        return mapFragment;
    } 
 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (savedInstanceState != null) {
            //TODO Restore map state 
        } 
        origin = new LatLng(37.35, -122.0);
        destination = new LatLng(37.45, -122.2);
    } 
 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        setUpMapIfNeeded(); 
    } 
 
    private void setUpMapIfNeeded() { 
        PolygonOptions rectOptions = new PolygonOptions()