Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package in.meet.android;
- import android.os.Bundle;
- import android.view.MotionEvent;
- import android.view.View;
- import android.widget.PopupWindow;
- import android.widget.Toast;
- import com.google.android.maps.GeoPoint;
- import com.google.android.maps.MapActivity;
- import com.google.android.maps.MapController;
- import com.google.android.maps.MapView;
- /**
- * Created by IntelliJ IDEA.
- * User: anujm
- * Date: 12/18/10
- * Time: 9:02 PM
- * To change this template use File | Settings | File Templates.
- */
- public class MapsDemo extends MapActivity {
- private MapView mapView;
- private MapController mapController;
- private GeoPoint p;
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- mapView = (MapView) findViewById(R.id.mapview);
- mapView.setBuiltInZoomControls(true);
- String[] bangaloreCoordinates = new String[]{"12.58", "77.38"};
- setStartupLocation(bangaloreCoordinates);
- MapView.OnTouchListener touchListener = new View.OnTouchListener() {
- public boolean onTouch(View v, MotionEvent event) {
- return false;
- }
- };
- }
- private void setStartupLocation(String[] coordinates) {
- mapController = mapView.getController();
- double lat = Double.parseDouble(coordinates[0]);
- double lng = Double.parseDouble(coordinates[1]);
- p = new GeoPoint(
- (int) (lat * 1E6),
- (int) (lng * 1E6));
- mapController.animateTo(p);
- mapController.setZoom(8);
- }
- @Override
- protected boolean isRouteDisplayed() {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
- public void onTouch()
- {
- }
- }
Add Comment
Please, Sign In to add comment