mirror of
https://github.com/googlemaps/android-samples.git
synced 2025-12-08 18:02:20 +00:00
chore: Add region tags in MapsMarkerActivity. (#238)
This commit is contained in:
parent
997740ab9a
commit
e5580ef99b
@ -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]
|
||||
|
||||
@ -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]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user