Return to Video

Camera Position

  • 0:00 - 0:04
    When using maps in your application
    the map fragment provides a view
  • 0:04 - 0:07
    over the map, based on the
    specifications defined on your camera.
  • 0:07 - 0:11
    If you don't define a camera you just
    get a view of the entire world over
  • 0:11 - 0:14
    latitude zero and longitude zero.
  • 0:14 - 0:17
    Understanding the camera is
    the key to understanding your app.
  • 0:17 - 0:22
    The camera is controlled using
    a class called CameraPosition.
  • 0:22 - 0:25
    The properties that define
    your camera are the targets.
  • 0:25 - 0:30
    And this is the latitude and longitude
    that you want to point the camera at.
  • 0:30 - 0:33
    This lat long will define
    the center of your map.
  • 0:33 - 0:37
    And how much of the map you
    see is determined by the zoom.
  • 0:37 - 0:42
    This is a value from zero, the furthest
    out effectively showing the whole world,
  • 0:42 - 0:45
    down to 21,
    which is really close to street level.
  • 0:45 - 0:48
    You can get in even closer
    by using Street View,
  • 0:48 - 0:50
    and you'll see that in a later lesson.
  • 0:50 - 0:52
    Bearing is a property, and
  • 0:52 - 0:55
    this determines the direction
    that the camera is facing.
  • 0:55 - 0:59
    It's specified in degrees
    clockwise from north.
  • 0:59 - 1:04
    So if you want the camera to be facing
    east, the bearing would be 90 degrees.
  • 1:04 - 1:09
    If you wanted to face northwest,
    the bearing would be 315 degrees.
  • 1:09 - 1:12
    Tilt is how much
    the camera is tilted by.
  • 1:12 - 1:13
    By default,
  • 1:13 - 1:17
    this is zero which means the camera is
    facing directly down towards the ground.
  • 1:19 - 1:23
    You can increase this with the upper
    bound determined by how far zoomed
  • 1:23 - 1:24
    out you are.
  • 1:24 - 1:27
    So, for example,
    if you're zoomed out really far
  • 1:27 - 1:31
    the maximum tilt that you
    could do is 30 degrees.
  • 1:31 - 1:34
    As you get closer to the Earth,
    the maximum tilt goes up.
  • 1:34 - 1:38
    With a maximum of 67.5 degrees.
  • 1:38 - 1:42
    You can just see tilt as how
    the camera is tilted toward the ground,
  • 1:42 - 1:44
    you're looking straight
    down at the ground, or
  • 1:44 - 1:48
    you're tilted at the ground so
    you can get a 3D isometric style view.
  • 1:48 - 1:50
    Like you had with
    the skyscrapers earlier on.
Title:
Camera Position
Description:

more » « less
Video Language:
English
Team:
Udacity
Project:
ud876-4 - Google Play Services - Maps
Duration:
01:51
Udacity Robot edited English subtitles for Camera Position
Udacity Robot edited English subtitles for Camera Position
Udacity Robot edited English subtitles for Camera Position
Cogi-Admin edited English subtitles for Camera Position

English subtitles

Revisions Compare revisions