Guest User

Untitled

a guest
Apr 24th, 2018
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. <fragment xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:map="http://schemas.android.com/apk/res-auto"
  3. xmlns:tools="http://schemas.android.com/tools"
  4. android:id="@+id/map"
  5. android:name="com.google.android.gms.maps.SupportMapFragment"
  6. android:layout_width="match_parent"
  7. android:layout_height="match_parent"
  8. tools:context="google.maps.tintal.MapsActivity" />
  9.  
  10. private GoogleMap mMap;
  11.  
  12. @Override
  13. protected void onCreate(Bundle savedInstanceState) {
  14. super.onCreate(savedInstanceState);
  15. setContentView(R.layout.activity_maps);
  16. // Obtain the SupportMapFragment and get notified when the map is ready to be used.
  17. SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
  18. .findFragmentById(R.id.map);
  19. mapFragment.getMapAsync(this);
  20. }
  21.  
  22. @Override
  23. public void onMapReady(GoogleMap googleMap) {
  24. mMap = googleMap;
  25.  
  26. //Parroquie San Agustín
  27. LatLng unia01 = new LatLng(4.653980, -74.146397);
  28. mMap.addMarker(new MarkerOptions().position(unia01).title("Parroquia San Agustín").snippet("Diosesis de fontibon").icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ORANGE)));
  29.  
  30. //Uniagustiniana
  31. LatLng unia02 = new LatLng(4.653421, -74.145150);
  32. mMap.addMarker(new MarkerOptions().position(unia02).title("Uniagustiniana").snippet("Universitaria Agustiniana").icon(BitmapDescriptorFactory.fromResource(R.drawable.marker)));
  33.  
  34. mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(unia01,17));
  35. }
  36.  
  37. <application
  38. android:allowBackup="true"
  39. android:icon="@mipmap/ic_launcher"
  40. android:label="@string/app_name"
  41. android:roundIcon="@mipmap/ic_launcher_round"
  42. android:supportsRtl="true"
  43. android:theme="@style/Theme.AppCompat.NoActionBar">
  44.  
  45. <activity android:name=".MainActivity">
  46. <intent-filter>
  47. <action android:name="android.intent.action.MAIN" />
  48.  
  49. <category android:name="android.intent.category.LAUNCHER" />
  50. </intent-filter>
  51. </activity>
  52.  
  53. <meta-data
  54. android:name="com.google.android.geo.API_KEY"
  55. android:value="AIzaSyDjd5MPotj1x8v96Hs05dIRTjdocektzWg" />
  56.  
  57. <activity
  58. android:name=".MapsActivity"
  59. android:label="@string/title_activity_maps" />
  60. </application>
Add Comment
Please, Sign In to add comment