@Override protected synchronized void onSizeChanged(int width, int height, int oldWidth, int oldHeight) { Log.d(TAG, "onSizeChanged: " + width + "x" + height); super.onSizeChanged(width, height, oldWidth, oldHeight); mWidth = width; mHeight = height; mInitialized = (mWidth > 0 && mHeight > 0); if (mInitialized) mMapViewPosition.setViewport(width, height); }
/** * Update all Layers on Main thread. * * @param forceRedraw also render frame FIXME (does nothing atm) */ void redrawMapInternal(boolean forceRedraw) { boolean changed = forceRedraw; if (mPausing || !mInitialized) return; if (forceRedraw && !mClearMap) mGLView.requestRender(); // get the current MapPosition changed |= mMapViewPosition.getMapPosition(mMapPosition); mLayerManager.onUpdate(mMapPosition, changed, mClearMap); // delay redraw until all layers had the chance to clear // their state. if (mClearMap) { mGLView.requestRender(); mClearMap = false; } }
/** @return estimated visible axis aligned bounding box */ public BoundingBox getBoundingBox() { return mMapViewPosition.getViewBox(); }
/** * Sets the center of the MapView and triggers a redraw. * * @param geoPoint the new center point of the map. */ public void setCenter(GeoPoint geoPoint) { mMapViewPosition.setMapCenter(geoPoint); redrawMap(true); }
public void setMapPosition(MapPosition mapPosition) { mMapViewPosition.setMapPosition(mapPosition); }