chore: Add region tags in MapsMarkerActivity. (#238)

This commit is contained in:
Chris Arriola 2020-06-02 11:09:23 -07:00 committed by GitHub
parent 997740ab9a
commit e5580ef99b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -58,14 +58,21 @@ public class MapsMarkerActivity extends AppCompatActivity
* installed Google Play services and returned to the app.
*/
// [END_EXCLUDE]
// [START maps_marker_on_map_ready_add_marker]
@Override
public void onMapReady(GoogleMap googleMap) {
// [START_EXCLUDE silent]
// Add a marker in Sydney, Australia,
// and move the map's camera to the same location.
// [END_EXCLUDE]
LatLng sydney = new LatLng(-33.852, 151.211);
googleMap.addMarker(new MarkerOptions().position(sydney)
.title("Marker in Sydney"));
googleMap.addMarker(new MarkerOptions()
.position(sydney)
.title("Marker in Sydney"));
// [START_EXCLUDE silent]
googleMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
// [END_EXCLUDE]
}
// [END maps_marker_on_map_ready_add_marker]
}
// [END maps_marker_on_map_ready]

View File

@ -47,6 +47,7 @@ class MapsMarkerActivity : AppCompatActivity(), OnMapReadyCallback {
// [END maps_marker_get_map_async]
// [END_EXCLUDE]
// [START maps_marker_on_map_ready_add_marker]
override fun onMapReady(googleMap: GoogleMap?) {
googleMap?.apply {
val sydney = LatLng(-33.852, 151.211)
@ -55,8 +56,11 @@ class MapsMarkerActivity : AppCompatActivity(), OnMapReadyCallback {
.position(sydney)
.title("Marker in Sydney")
)
// [START_EXCLUDE silent]
moveCamera(CameraUpdateFactory.newLatLng(sydney))
// [END_EXCLUDE]
}
}
// [END maps_marker_on_map_ready_add_marker]
}
// [END maps_marker_on_map_ready]