Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <fragment xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:map="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/map"
- android:name="com.google.android.gms.maps.SupportMapFragment"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="google.maps.tintal.MapsActivity" />
- private GoogleMap mMap;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_maps);
- // Obtain the SupportMapFragment and get notified when the map is ready to be used.
- SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
- .findFragmentById(R.id.map);
- mapFragment.getMapAsync(this);
- }
- @Override
- public void onMapReady(GoogleMap googleMap) {
- mMap = googleMap;
- //Parroquie San Agustín
- LatLng unia01 = new LatLng(4.653980, -74.146397);
- mMap.addMarker(new MarkerOptions().position(unia01).title("Parroquia San Agustín").snippet("Diosesis de fontibon").icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ORANGE)));
- //Uniagustiniana
- LatLng unia02 = new LatLng(4.653421, -74.145150);
- mMap.addMarker(new MarkerOptions().position(unia02).title("Uniagustiniana").snippet("Universitaria Agustiniana").icon(BitmapDescriptorFactory.fromResource(R.drawable.marker)));
- mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(unia01,17));
- }
- <application
- android:allowBackup="true"
- android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
- android:roundIcon="@mipmap/ic_launcher_round"
- android:supportsRtl="true"
- android:theme="@style/Theme.AppCompat.NoActionBar">
- <activity android:name=".MainActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <meta-data
- android:name="com.google.android.geo.API_KEY"
- android:value="AIzaSyDjd5MPotj1x8v96Hs05dIRTjdocektzWg" />
- <activity
- android:name=".MapsActivity"
- android:label="@string/title_activity_maps" />
- </application>
Add Comment
Please, Sign In to add comment