CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom);
protected com.google.type.LatLng toPb() { return com.google.type.LatLng.newBuilder() .setLatitude(latitude) .setLongitude(longitude) .build(); } }
/** <code>.google.type.DayOfWeek day_of_week = 2;</code> */ public com.google.type.DayOfWeek getDayOfWeek() { @SuppressWarnings("deprecation") com.google.type.DayOfWeek result = com.google.type.DayOfWeek.valueOf(dayOfWeek_); return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; }
/** <code>.google.type.Date date_value = 7;</code> */ public com.google.type.Date getDateValue() { if (typeCase_ == 7) { return (com.google.type.Date) type_; } return com.google.type.Date.getDefaultInstance(); } /** <code>.google.type.Date date_value = 7;</code> */
/** <code>.google.type.TimeOfDay time_value = 6;</code> */ public com.google.type.TimeOfDay getTimeValue() { if (typeCase_ == 6) { return (com.google.type.TimeOfDay) type_; } return com.google.type.TimeOfDay.getDefaultInstance(); } /** <code>.google.type.TimeOfDay time_value = 6;</code> */
LatLng toProto() { LatLng.Builder latLngBuilder = LatLng.newBuilder(); latLngBuilder.setLatitude(latitude); latLngBuilder.setLongitude(longitude); return latLngBuilder.build(); }
CameraPosition cameraPosition = new CameraPosition.Builder() .target(new LatLng(-33, 150)) .zoom(13) .build(); MapFragment.newInstance(new GoogleMapOptions() .camera(camera));
/** <code>.google.type.Date date_value = 7;</code> */ public com.google.type.DateOrBuilder getDateValueOrBuilder() { if (typeCase_ == 7) { return (com.google.type.Date) type_; } return com.google.type.Date.getDefaultInstance(); }
/** <code>.google.type.TimeOfDay time_value = 6;</code> */ public com.google.type.TimeOfDayOrBuilder getTimeValueOrBuilder() { if (typeCase_ == 6) { return (com.google.type.TimeOfDay) type_; } return com.google.type.TimeOfDay.getDefaultInstance(); }
/** <code>.google.type.DayOfWeek day_of_week_value = 8;</code> */ public com.google.type.DayOfWeek getDayOfWeekValue() { if (typeCase_ == 8) { @SuppressWarnings("deprecation") com.google.type.DayOfWeek result = com.google.type.DayOfWeek.valueOf((java.lang.Integer) type_); return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; } return com.google.type.DayOfWeek.DAY_OF_WEEK_UNSPECIFIED; }
googlemap.addMarker(new MarkerOptions() .position(new LatLng( 65.07213,-2.109375)) .title("This is my title") .snippet("and snippet") .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ORANGE)));
/** <code>.google.type.TimeOfDay time = 3;</code> */ public com.google.type.TimeOfDay getTime() { return time_ == null ? com.google.type.TimeOfDay.getDefaultInstance() : time_; } /** <code>.google.type.TimeOfDay time = 3;</code> */
/** <code>.google.type.DayOfWeek day_of_week_value = 8;</code> */ public com.google.type.DayOfWeek getDayOfWeekValue() { if (typeCase_ == 8) { @SuppressWarnings("deprecation") com.google.type.DayOfWeek result = com.google.type.DayOfWeek.valueOf((java.lang.Integer) type_); return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; } return com.google.type.DayOfWeek.DAY_OF_WEEK_UNSPECIFIED; } /** <code>.google.type.DayOfWeek day_of_week_value = 8;</code> */
/** <code>.google.type.DayOfWeek day_of_week = 2;</code> */ public com.google.type.DayOfWeek getDayOfWeek() { @SuppressWarnings("deprecation") com.google.type.DayOfWeek result = com.google.type.DayOfWeek.valueOf(dayOfWeek_); return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; } /** <code>.google.type.DayOfWeek day_of_week = 2;</code> */
GoogleMap map = ... // get a map. // Add a marker at San Francisco. Marker marker = map.addMarker(new MarkerOptions() .position(new LatLng(37.7750, 122.4183)) .title("San Francisco") .snippet("Population: 776733"));
public class CustomMapFragment extends com.google.android.gms.maps.SupportMapFragment { private final LatLng HAMBURG = new LatLng(53.558, 9.927); @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); GoogleMap googleMap = getMap(); googleMap.addMarker(new MarkerOptions().position(HAMBURG).title("Hamburg")); googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(HAMBURG, 15)); googleMap.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null); } }
for (int i = 0; i < myList.size(); i++) { double latitude = myList.getLatitude(); double longitude = myList.getLongitude(); Marker marker = mMap.addMarker(new MarkerOptions().position(new LatLng(latitude,longitude))).title(myList.getTitle()) .icon(BitmapDescriptorFactory.fromResource(R.drawable.location_icon)); mHashMap.put(marker, i); }
PolylineOptions line= new PolylineOptions().add(new LatLng(40.70686417491799, -74.01572942733765), new LatLng(40.76866299974387, -73.98268461227417), new LatLng(40.765136435316755, -73.97989511489868), new LatLng(40.748963847316034, -73.96807193756104)) .width(5).color(Color.RED); map.addPolyline(line);
mMapFragment = MiniMapFragment.newInstance(new LatLng(37.4005502611301, -5.98233461380005));