INQ241B
Mobile Apps

Activity 8

Create a Campus Tour App

Roanoke College's Admissions office wants an app that they can give to prospective students to give self-guided tours of the campus. They want the app to display where the user is currently located on a map of campus and when they get near a building to display and image and information about the building.

Details

Use App Inventor to create a campus tour app. The app should have the following components:

  1. A Canvas component that is 300 pixels wide and 300 pixels tall. The canvas should have BackgroundImage property that is the following image of Roanoke College's Campus:

  2. A Ball component that is inside the canvas. The ball should have a bright color so that it stands out on the background image.

  3. An Image component that displays a picture of a building on campus. The Image should be initially hidden.

  4. A Label component that displays text that describes the building in the Image component. The Label should be initially hidden.

  5. A LocationSensor component so that the app can get the user's current latitude and longitude.

The app should have blocks that do the following:

  1. Set the location of the Ball component so that it is where the user is currently located on campus. To do this you will have to convert the user's latitude and longitude to x and y coordinates using the following equations:

    x = (longitude + 80. 058019) × 53153. 8
    y = ( − 74478. 6 × latitude) + 2777882. 2

  2. Reveal the hidden Image and Label components when the user gets near the building that the Image and Label refer to. Consider a user near a building if all of the following are true:

    1. The current latitude is less than the latitude of the North side of the building.

    2. The current latitude is greater than the latitude of the South side of the building.

    3. The current longitude is less than the longitude of the East side of the building.

    4. The current longitude is greater than the longitude of the West side of the building.

    You can determine the latitude and longitude of a location using Google maps. Zoom in on the location you want the coordinates of, right-click on the location, and choose "What's Here?". The latitude and longitude will be displayed in the search box.