Skip to content

Commit fa63927

Browse files
authored
chore: add region tags to 6 samples (#1552)
1 parent cf74be5 commit fa63927

File tree

12 files changed

+42
-7
lines changed

12 files changed

+42
-7
lines changed

ApiDemos/java/app/src/gms/java/com/example/mapdemo/AdvancedMarkersDemoActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* The following sample showcases how to create Advanced Markers, and use all their customization
3636
* possibilities.
3737
*/
38+
// [START maps_android_sample_marker_advanced]
3839
public class AdvancedMarkersDemoActivity extends AppCompatActivity implements OnMapReadyCallback {
3940

4041
private static final LatLng SINGAPORE = new LatLng(1.3521, 103.8198);
@@ -135,3 +136,4 @@ public void onMapReady(GoogleMap map) {
135136
Marker marker5 = map.addMarker(advancedMarkerOptions5);
136137
}
137138
}
139+
// [END maps_android_sample_marker_advanced]

ApiDemos/java/app/src/gms/java/com/example/mapdemo/EventsDemoActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
/**
3232
* This shows how to listen to some {@link GoogleMap} events.
3333
*/
34+
// [START maps_android_sample_events]
3435
public class EventsDemoActivity extends AppCompatActivity
3536
implements OnMapClickListener, OnMapLongClickListener, OnCameraIdleListener,
3637
OnMapReadyCallback {
@@ -75,3 +76,4 @@ public void onCameraIdle() {
7576
cameraTextView.setText(map.getCameraPosition().toString());
7677
}
7778
}
79+
// [END maps_android_sample_events]

ApiDemos/java/app/src/gms/java/com/example/mapdemo/MarkerDemoActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
/**
6565
* This shows how to place markers on a map.
6666
*/
67+
// [START maps_android_sample_marker]
6768
public class MarkerDemoActivity extends AppCompatActivity implements
6869
OnMarkerClickListener,
6970
OnInfoWindowClickListener,
@@ -505,3 +506,4 @@ public void onMarkerDrag(Marker marker) {
505506
}
506507

507508
}
509+
// [END maps_android_sample_marker]

ApiDemos/java/app/src/gms/java/com/example/mapdemo/MyLocationDemoActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
* android.Manifest.permission#ACCESS_COARSE_LOCATION} are requested at run time. If either
4242
* permission is not granted, the Activity is finished with an error message.
4343
*/
44+
// [START maps_android_sample_my_location]
4445
public class MyLocationDemoActivity extends AppCompatActivity
4546
implements
4647
OnMyLocationButtonClickListener,
@@ -158,3 +159,4 @@ private void showMissingPermissionError() {
158159
}
159160

160161
}
162+
// [END maps_android_sample_my_location]

ApiDemos/java/app/src/gms/java/com/example/mapdemo/PolygonDemoActivity.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
/**
4848
* This shows how to draw polygons on a map.
4949
*/
50+
// [START maps_android_sample_polygons]
5051
public class PolygonDemoActivity extends AppCompatActivity
5152
implements OnSeekBarChangeListener, OnItemSelectedListener, OnMapReadyCallback {
5253

@@ -89,7 +90,6 @@ public class PolygonDemoActivity extends AppCompatActivity
8990
R.string.pattern_dotted,
9091
R.string.pattern_mixed,
9192
};
92-
9393
@Override
9494
protected void onCreate(Bundle savedInstanceState) {
9595
super.onCreate(savedInstanceState);
@@ -131,6 +131,7 @@ protected void onCreate(Bundle savedInstanceState) {
131131
(SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
132132
mapFragment.getMapAsync(this);
133133
}
134+
// [START_EXCLUDE silent]
134135

135136
private String[] getResourceStrings(int[] resourceIds) {
136137
String[] strings = new String[resourceIds.length];
@@ -139,6 +140,7 @@ private String[] getResourceStrings(int[] resourceIds) {
139140
}
140141
return strings;
141142
}
143+
// [END_EXCLUDE]
142144

143145
@Override
144146
public void onMapReady(GoogleMap map) {
@@ -186,6 +188,7 @@ public void onPolygonClick(Polygon polygon) {
186188
});
187189
}
188190

191+
// [START_EXCLUDE silent]
189192
/**
190193
* Creates a List of LatLngs that form a rectangle with the given dimensions.
191194
*/
@@ -286,4 +289,6 @@ public void toggleClickability(View view) {
286289
mutablePolygon.setClickable(((CheckBox) view).isChecked());
287290
}
288291
}
289-
}
292+
// [END_EXCLUDE]
293+
}
294+
// [END maps_android_sample_polygons]

ApiDemos/java/app/src/gms/java/com/example/mapdemo/polyline/PolylineDemoActivity.java renamed to ApiDemos/java/app/src/gms/java/com/example/mapdemo/PolylineDemoActivity.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
/**
5555
* This shows how to draw polylines on a map.
5656
*/
57+
// [START maps_android_sample_polylines]
5758
public class PolylineDemoActivity extends AppCompatActivity
5859
implements OnSeekBarChangeListener, OnItemSelectedListener, OnMapReadyCallback {
5960

@@ -160,6 +161,7 @@ protected void onCreate(Bundle savedInstanceState) {
160161
(SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
161162
mapFragment.getMapAsync(this);
162163
}
164+
// [START_EXCLUDE silent]
163165

164166
private String[] getResourceStrings(int[] resourceIds) {
165167
String[] strings = new String[resourceIds.length];
@@ -168,6 +170,7 @@ private String[] getResourceStrings(int[] resourceIds) {
168170
}
169171
return strings;
170172
}
173+
// [END_EXCLUDE]
171174

172175
@Override
173176
public void onMapReady(GoogleMap map) {
@@ -219,6 +222,7 @@ public void onPolylineClick(Polyline polyline) {
219222
});
220223
}
221224

225+
// [START_EXCLUDE silent]
222226
private Cap getSelectedCap(int pos) {
223227
int id = CAP_TYPE_NAME_RESOURCE_IDS[pos];
224228
if (id == R.string.cap_butt) {
@@ -319,4 +323,6 @@ public void toggleClickability(View view) {
319323
mutablePolyline.setClickable(((CheckBox) view).isChecked());
320324
}
321325
}
322-
}
326+
// [END_EXCLUDE]
327+
}
328+
// [END maps_android_sample_polylines]

ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/AdvancedMarkersDemoActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ private val TAG = AdvancedMarkersDemoActivity::class.java.name
4646
* The following sample showcases how to create Advanced Markers, and use all their customization
4747
* possibilities.
4848
*/
49+
// [START maps_android_sample_marker_advanced]
4950
class AdvancedMarkersDemoActivity : AppCompatActivity(), OnMapReadyCallback {
5051
override fun onCreate(savedInstanceState: Bundle?) {
5152
super.onCreate(savedInstanceState)
@@ -136,4 +137,5 @@ class AdvancedMarkersDemoActivity : AppCompatActivity(), OnMapReadyCallback {
136137

137138
val marker5: Marker? = map.addMarker(advancedMarkerOptions5)
138139
}
139-
}
140+
}
141+
// [END maps_android_sample_marker_advanced]

ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/EventsDemoActivity.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import com.google.android.gms.maps.model.LatLng
2525
/**
2626
* This shows how to listen to some [GoogleMap] events.
2727
*/
28+
// [START maps_android_sample_events]
2829
class EventsDemoActivity : AppCompatActivity(), OnMapClickListener,
2930
OnMapLongClickListener, OnCameraIdleListener, OnMapReadyCallback {
3031

@@ -58,7 +59,8 @@ class EventsDemoActivity : AppCompatActivity(), OnMapClickListener,
5859
}
5960

6061
override fun onCameraIdle() {
61-
if(!::map.isInitialized) return
62+
if (!::map.isInitialized) return
6263
cameraTextView.text = map.cameraPosition.toString()
6364
}
64-
}
65+
}
66+
// [END maps_android_sample_events]

ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/MarkerDemoActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import java.util.Random
6161
/**
6262
* This shows how to place markers on a map.
6363
*/
64+
// [START maps_android_sample_marker]
6465
class MarkerDemoActivity :
6566
AppCompatActivity(),
6667
OnMarkerClickListener,
@@ -478,6 +479,7 @@ class MarkerDemoActivity :
478479
}
479480
}
480481
}
482+
// [END maps_android_sample_marker]
481483

482484
/**
483485
* This stores the details of a place that used to draw a marker

ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/MyLocationDemoActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import com.google.android.gms.maps.SupportMapFragment
3737
* Permission for [Manifest.permission.ACCESS_FINE_LOCATION] and [Manifest.permission.ACCESS_COARSE_LOCATION]
3838
* are requested at run time. If either permission is not granted, the Activity is finished with an error message.
3939
*/
40+
// [START maps_android_sample_my_location]
4041
class MyLocationDemoActivity : AppCompatActivity(),
4142
OnMyLocationButtonClickListener,
4243
OnMyLocationClickListener, OnMapReadyCallback,
@@ -183,4 +184,5 @@ class MyLocationDemoActivity : AppCompatActivity(),
183184
*/
184185
private const val LOCATION_PERMISSION_REQUEST_CODE = 1
185186
}
186-
}
187+
}
188+
// [END maps_android_sample_my_location]

0 commit comments

Comments
 (0)