Guest User

Untitled

a guest
Jul 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. package in.meet.android;
  2.  
  3. import android.os.Bundle;
  4. import android.view.MotionEvent;
  5. import android.view.View;
  6. import android.widget.PopupWindow;
  7. import android.widget.Toast;
  8. import com.google.android.maps.GeoPoint;
  9. import com.google.android.maps.MapActivity;
  10. import com.google.android.maps.MapController;
  11. import com.google.android.maps.MapView;
  12.  
  13. /**
  14. * Created by IntelliJ IDEA.
  15. * User: anujm
  16. * Date: 12/18/10
  17. * Time: 9:02 PM
  18. * To change this template use File | Settings | File Templates.
  19. */
  20. public class MapsDemo extends MapActivity {
  21. private MapView mapView;
  22. private MapController mapController;
  23. private GeoPoint p;
  24.  
  25. /** Called when the activity is first created. */
  26. @Override
  27. public void onCreate(Bundle savedInstanceState)
  28. {
  29. super.onCreate(savedInstanceState);
  30. setContentView(R.layout.main);
  31. mapView = (MapView) findViewById(R.id.mapview);
  32. mapView.setBuiltInZoomControls(true);
  33. String[] bangaloreCoordinates = new String[]{"12.58", "77.38"};
  34. setStartupLocation(bangaloreCoordinates);
  35. MapView.OnTouchListener touchListener = new View.OnTouchListener() {
  36. public boolean onTouch(View v, MotionEvent event) {
  37.  
  38.  
  39. return false;
  40. }
  41. };
  42. }
  43.  
  44. private void setStartupLocation(String[] coordinates) {
  45. mapController = mapView.getController();
  46. double lat = Double.parseDouble(coordinates[0]);
  47. double lng = Double.parseDouble(coordinates[1]);
  48.  
  49. p = new GeoPoint(
  50. (int) (lat * 1E6),
  51. (int) (lng * 1E6));
  52.  
  53. mapController.animateTo(p);
  54. mapController.setZoom(8);
  55. }
  56.  
  57. @Override
  58. protected boolean isRouteDisplayed() {
  59. return false; //To change body of implemented methods use File | Settings | File Templates.
  60. }
  61.  
  62. public void onTouch()
  63. {
  64.  
  65. }
  66. }
Add Comment
Please, Sign In to add comment