User Tools

Site Tools


map_suite_android_getting_started

Map Suite Android Getting Started

Video Overview

Getting Started
Getting Started(Xamarin Forms)

Introduction

The Getting Started Learning Sample for Map Suite Android Edition shows how to begin creating and using your customizable Android mapping app.

Interacting with the Map

Panning the map is performed by touching the screen with one finger and dragging. Zooming is accomplished by touching the screen with two fingers and pinching. It is also possible to zoom in and out by tapping the + and – symbols in the top left. Use the left and right arrows at the bottom of the screen to move between previous and future extents, like back and forward on a web browser.

Tap the map anywhere to show the latitude and longitude of that location. On a long press, a menu appears that allows the user to select zoom level 2, 5, 10, 16, or 18. The higher the zoom level, the higher the zoom. Zoom level 5 shows the continental United States, while zoom level 10 shows roughly a state.

Tap the target icon in the bottom left to show the current location. Press the globe icon to show the entire world at zoom level 2.

A Look at the Code

MainActivity is the MainLauncher, meaning that it will run when the program is opened. The OnCreate function initializes the map and registers the events of the buttons. MainActivity also contains functions for interacting with the map, like single and double tapping, zooming, and finding the GPS location. InitializeAndroidMap uses MapView, the ThinkGeo map controller, to set up the map overlay (ThinkGeo's World Map Kit), projection, overlays, and scale.

Under the CustomControls folder, the OpenGpsSettingsDialog class handles the dialog box that only shows up if GPS is not enabled when the app starts. ScaleZoomLevelMapTool extends Map Suite's MapTool to handle the Zoom Level of the map. SelectZoomLevelListDialog is the AlertDialog that is displayed when holding a tap on the map that allows the user to select the Zoom Level from a list of options.

map_suite_android_getting_started.txt · Last modified: 2016/01/12 05:40 by tgwikiupdate