Exemple #1
0
  @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);
  }
Exemple #2
0
  /**
   * 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;
    }
  }
Exemple #3
0
 /** @return estimated visible axis aligned bounding box */
 public BoundingBox getBoundingBox() {
   return mMapViewPosition.getViewBox();
 }
Exemple #4
0
  /**
   * 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);
  }
Exemple #5
0
 public void setMapPosition(MapPosition mapPosition) {
   mMapViewPosition.setMapPosition(mapPosition);
 }