package gr.mybook.mymap;

import android.os.Bundle;
import android.app.Activity;

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;

public class MainActivity extends Activity {
	private static final int NONE = GoogleMap.MAP_TYPE_NONE;
	private static final int NORMAL = GoogleMap.MAP_TYPE_NORMAL;
	private static final int SATELLITE = GoogleMap.MAP_TYPE_SATELLITE;
	private static final int HYBRID = GoogleMap.MAP_TYPE_HYBRID;
	private static final int TERRAIN = GoogleMap.MAP_TYPE_TERRAIN;
	
	
	private GoogleMap map;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		try{
		map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
		// Changing map type
		// map.setMapType(NONE);
		// map.setMapType(NORMAL);
		 //map.setMapType(SATELLITE);
		 //map.setMapType(HYBRID);
		//map.setMapType(TERRAIN);
		 
		 //map.setMyLocationEnabled(true);
		 
		double latitude = 37.968333;
		double longitude = 23.728611;
		MarkerOptions marker = new MarkerOptions().position(
				new LatLng(latitude, longitude))
				.title("ACROPOLIS")
				.snippet("National Hellenic Museum");
		marker.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE));
		map.addMarker(marker);
		
		// move the camera to the position with a zoom level
		CameraPosition cameraPosition = new CameraPosition.Builder().target(new LatLng(latitude, longitude)).zoom(15).build();
		map.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}
