A Mobile-Optimized Mapping UI
A Mobile-Optimized Mapping UI
In this next section, we will work through the process of creating a UI for mapping that is optimized for a mobile device. All the building blocks that we require are supplied in the Google Maps toolbox. It’s just a case of being a little more selective with what we use than we might ordinarily be with a desktop application.
A Mapping UI Mockup
Before we get into the code for our mobile mapping UI, we will begin by putting together
a UI mockup, as we did for our to-do list application in Chapter 4. This is displayed in Figure 8–8.
CHAPTER 8: Location-Based Services and Mobile Mapping
Figure 8–8. A mockup of our optimized UI for mobile mapping There are six primary components to the interface:
1. The application title bar. We have gone back to the simple title style for this application as it is better suited to work with a full-screen map, and we really don’t want to waste pixels with such limited screen real estate.
2. The currently selected marker title. This bar is displayed when a marker is tapped, and shows the title of the tapped marker. The active marker is shown in element
4. Depending on the application, tapping the actual marker title could be used to take the user to a detailed information page for the selected marker. In this case, the title should probably be underlined to indicate that it is also a link.
3. Marker change selection navigation controls. These navigation controls are included to provide an alternative mechanism for navigating through the markers. Instead of having to tap individual markers, the navigation controls can be used to move through the markers and change the active marker selection.
4. The active marker. This is the marker that was most recently tapped or that has been navigated to with the navigation controls.
5. An inactive marker. Inactive markers are displayed in gray, while the active marker is displayed in blue.
CHAPTER 8: Location-Based Services and Mobile Mapping
6. The zoom controls. These are provided by the Google Maps API for Android, as Android does not support multitouch events in the web browser at present. If you were to load the display on an iPhone, the zoom controls would not be displayed; however, other devices with a similar single-touch limitation would be likely to display the controls also.
No work will be required on our part to have these zoom controls display, but it is important to remember that they are displayed at the base of the map, and thus that part of the screen is accounted for.
NOTE: The preceding UI has been designed with fingers in mind. When designing a mobile UI, it is important to remember that your users will not be using the pixel-accurate selection of a mouse cursor. Rather, they will be using their fingers, which at their most accurate probably have a contact surface of about 10 pixels. If, as in the preceding mapping interface, it is possible that tappable elements will be in close proximity to one another (the markers in our case), think about providing alternative UI mechanisms to avoid causing your users frustration.