0

When I run the activity, the camera is in the default location with the default zoom. What did I do wrong? It's probably with the .newLatLongZoom() function.

   @Override
public void onMapReady(GoogleMap googleMap) {
    mMap = googleMap;
    mMap.setBuildingsEnabled(true);
    mMap.getUiSettings().setZoomControlsEnabled(true);
    float cameraZoom = 17;
    LatLng location = new LatLng(43.404032, -80.478184);
    mMap.addMarker(new MarkerOptions().position(location).title("49 McIntyre Place #18, Kitchener, ON N2R 1G3"));
    CameraUpdateFactory.newLatLngZoom(location, cameraZoom);
    Snackbar.make(getWindow().getDecorView().getRootView(), "Click the pin for more options", Snackbar.LENGTH_LONG).show();
}
Kelvin Kellner
  • 746
  • 1
  • 6
  • 15
  • What would be the expected result? did you encounter any error? please provide your error logs if any. Here is the Official Google Documentation of [Camera and View](https://developers.google.com/maps/documentation/android-api/views). Also, check this related SO ticket: http://stackoverflow.com/questions/14157536/how-do-i-set-default-location-and-zoom-level-for-google-map-api-v2 – Android Enthusiast Aug 05 '16 at 07:28
  • @d.datul1990 The line `CameraUpdateFactory.newLatLngZoom(location, cameraZoom);` was supposed to pan the camera to the `LatLng` named "`location`", and zoom to `cameraZoom` (17). Instead it did neither. I will read the ticket and documentation tomorrow. – Kelvin Kellner Aug 06 '16 at 02:44
  • Hi Kelvin, how's your issue now? did you fixed it? – Android Enthusiast Oct 03 '16 at 05:29

0 Answers0