package fishrungames.bashgid;


import com.google.android.gms.maps.OnStreetViewPanoramaReadyCallback;
import com.google.android.gms.maps.StreetViewPanorama;

import com.google.android.gms.maps.SupportStreetViewPanoramaFragment;
import com.google.android.gms.maps.model.LatLng;


import android.os.Bundle;
import android.support.v4.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


public class StreetViewHolderFragment extends Fragment implements OnStreetViewPanoramaReadyCallback 
{
	
	double lat = 0;
	double lon = 0;
	
	public StreetViewHolderFragment()
	{
		
	}

	public StreetViewHolderFragment(double lat, double lon)
	{
		this.lat = lat;
		this.lon = lon;
	}
	
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
			
		View rootView = inflater.inflate(R.layout.fragment_streetview_page, container, false);
			
		SupportStreetViewPanoramaFragment streetViewPanoramaFragment = (SupportStreetViewPanoramaFragment) getChildFragmentManager().findFragmentById(R.id.streetviewpanorama);
		
		streetViewPanoramaFragment.getStreetViewPanoramaAsync(this);

		
		return rootView;
	}

	@Override
	public void onStreetViewPanoramaReady(StreetViewPanorama svp)
	{
		svp.setPosition(new LatLng(lat, lon));
	}

}
