English subtitles

← Introducing the GoogleMap Object

Get Embed Code
4 Languages

Showing Revision 3 created 05/24/2016 by Udacity Robot.

  1. We saw earlier that we could add
    a map fragment or a layout file and
  2. set properties on it to get some
    pretty interesting and cool maps.
  3. We even had a 3D fly over of New York
    city that was pretty cool right?
  4. Well that just scratches
    the surface of the types of app
  5. that you can build with map integration.
  6. The XML based maps always
    start in the same location and
  7. that can be limiting for a mobile app.
  8. So in order to get
    a little more power and
  9. flexibility, we're going to switch gears
    and start using the Google Map objects
  10. to compliment the map
    fragment using Java code.
  11. Once we've gotten that, it then becomes
    really easy to set properties and
  12. respond to user events on the map.
  13. Let's start with an example where
    we set the different map types
  14. such as the standard map,
    the satellite view or the hybrid view.
  15. In this app,
    you can see a map of New York City.
  16. And I have control
    over this map by touch.
  17. I can panoram the map, and as you can
    see, I can pinch to zoom in and out.
  18. When I press the buttons at the top
    of the map, Map, Satellite and
  19. Hybrid, I can change the map type.
  20. So if I touch Satellite,
  21. I now can see details of the buildings
    taken from Satellite images.
  22. Here you can see Madison Square Garden
    and even when I zoom in I can
  23. begin to see some of the seating
    plans in Madison Square Garden.
  24. And of course Hybrid gives
    me a hybrid of the two.
  25. I can see satellite but
  26. I can also see data such as landmarks
    like the Empire State Building and
  27. street names such as Fifth Avenue,
    as you can see here.
  28. I've done all of this using a Google
    map object in my Java code.
  29. This is slightly different
    from the fragment that
  30. you used in the earlier sample.
  31. And we're going to dive in to take
    a look at how to do this next.