本文整理匯總了Java中org.oscim.android.MapActivity類的典型用法代碼示例。如果您正苦於以下問題:Java MapActivity類的具體用法?Java MapActivity怎麽用?Java MapActivity使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MapActivity類屬於org.oscim.android包,在下文中一共展示了MapActivity類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: MapView
import org.oscim.android.MapActivity; //導入依賴的package包/類
/**
* @param context
* the enclosing MapActivity instance.
* @param attributeSet
* a set of attributes.
* @throws IllegalArgumentException
* if the context object is not an instance of
* {@link MapActivity} .
*/
public MapView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
if (!(context instanceof MapActivity)) {
throw new IllegalArgumentException(
"context is not an instance of MapActivity");
}
this.setWillNotDraw(true);
DisplayMetrics metrics = getResources().getDisplayMetrics();
dpi = Math.max(metrics.xdpi, metrics.ydpi);
// TODO make this dpi dependent
Tile.SIZE = 400;
MapActivity mapActivity = (MapActivity) context;
mMapViewPosition = new MapViewPosition(this);
mMapPosition = new MapPosition();
mLayerManager = new LayerManager(context);
mGLView = new GLView(context, this);
mDebugSettings = new DebugSettings();
// FIXME
MapTileLoader.setDebugSettings(mDebugSettings);
mapActivity.registerMapView(this);
LayoutParams params = new LayoutParams(
android.view.ViewGroup.LayoutParams.MATCH_PARENT,
android.view.ViewGroup.LayoutParams.MATCH_PARENT);
addView(mGLView, params);
mEventLayer = new MapEventLayer(this);
mLayerManager.add(mEventLayer);
clearMap();
redrawMap(false);
}