public class

MapOptions

extends Object
java.lang.Object
   ↳ com.esri.android.map.MapOptions

Class Overview

The options to instantiate a MapView with a given pre-defined MapOptions.MapType, zoom level and map center.

A typical use of MapOptions to instantiate a MapView would be the following:

 MapOptions options = new MapOptions(MapType.TOPO, 23, -110, 9);
 MapView mapView = new MapView(this, options);
 

However, instead of using Java in your activity, you can assign MapOptions to your MapView in the XML Layout using the mapoptions attribute. For Example:

XML Usage
 
 <!-- MapView with MapOptions settings for Topo basemap,
         zoom level, and centered in Costa Mesa, CA. -->
 <com.esri.android.map.MapView
 android:id="@+id/map"
 android:layout_width="fill_parent" 
 android:layout_height="fill_parent"
 mapoptions.MapType="topo"
 mapoptions.ZoomLevel="13"
 mapoptions.center="33.666354, -117.903557"/>
 
 
Java usage:
 // Retrieve the MapView, Basemap, ZoomLevel, and Center from XML layout
 MapView mMapView = (MapView) findViewById(R.id.map);
 

Summary

Nested Classes
enum MapOptions.MapType Pre-defined basemaps for use with MapOptions to simplify creating Basemap layers in a MapView
Public Constructors
MapOptions(MapOptions.MapType type)
The constructor is used if you are instantiating the MapOptions using the give basemap.
MapOptions(MapOptions.MapType type, double lat, double lon, int zoom)
The constructor is used if you are instantiating the MapOptions using the give basemap, map center and zoom level.
Public Methods
void setCenter(double lat, double lon)
Sets map center.
void setZoom(int zoom)
Sets zoom level.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MapOptions (MapOptions.MapType type)

The constructor is used if you are instantiating the MapOptions using the give basemap.

Parameters
type MapOptions.MapType: the pre-defined basemap. By default it is TOPO.

public MapOptions (MapOptions.MapType type, double lat, double lon, int zoom)

The constructor is used if you are instantiating the MapOptions using the give basemap, map center and zoom level.

Parameters
type MapOptions.MapType: the pre-defined basemap. By default it is TOPO.
lat double: the latitude of the map center.
lon double: the longitude of the map center.
zoom int: the zoom level of the basemap.

Public Methods

public void setCenter (double lat, double lon)

Sets map center.

Parameters
lat double: latitude of map center.
lon double: longitude of map center.

public void setZoom (int zoom)

Sets zoom level.

Parameters
zoom int: the zoom level of the basemap.