コード例 #1
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 @Override
 public void onZoomBegin(float scale, Origination origin) {
   if (origin == null) {
     mTileCanvasViewGroup.suppressRender();
   }
   mDetailLevelManager.setScale(scale);
 }
コード例 #2
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
  public TileView(Context context, AttributeSet attrs, int defStyleAttr) {

    super(context, attrs, defStyleAttr);

    mTileCanvasViewGroup = new TileCanvasViewGroup(context);
    addView(mTileCanvasViewGroup);

    mCompositePathView = new CompositePathView(context);
    addView(mCompositePathView);

    mScalingLayout = new ScalingLayout(context);
    addView(mScalingLayout);

    mMarkerLayout = new MarkerLayout(context);
    addView(mMarkerLayout);

    mCalloutLayout = new CalloutLayout(context);
    addView(mCalloutLayout);

    mDetailLevelManager.setDetailLevelChangeListener(this);
    mTileCanvasViewGroup.setTileRenderListener(this);
    addZoomPanListener(this);

    mRenderThrottleHandler = new RenderThrottleHandler(this);

    requestRender();
  }
コード例 #3
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 /** Restore visible state (generally after a call to pause). Appropriate for Activity.onResume. */
 public void resume() {
   setWillNotDraw(false);
   updateViewport();
   mTileCanvasViewGroup.updateTileSet(mDetailLevelManager.getCurrentDetailLevel());
   requestRender();
   requestLayout();
 }
コード例 #4
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 @Override
 public void onZoomEnd(float scale, Origination origin) {
   if (origin == null) {
     mTileCanvasViewGroup.resumeRender();
   }
   mDetailLevelManager.setScale(scale);
   requestRender();
 }
コード例 #5
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 /**
  * Allows the TileView to render tiles while panning.
  *
  * @param shouldRender True if it should render while panning.
  */
 public void setShouldRenderWhilePanning(boolean shouldRender) {
   mShouldRenderWhilePanning = shouldRender;
   int buffer =
       shouldRender
           ? TileCanvasViewGroup.FAST_RENDER_BUFFER
           : TileCanvasViewGroup.DEFAULT_RENDER_BUFFER;
   mTileCanvasViewGroup.setRenderBuffer(buffer);
 }
コード例 #6
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 @Override
 public void onScaleChanged(float scale, float previous) {
   super.onScaleChanged(scale, previous);
   mDetailLevelManager.setScale(scale);
   mHotSpotManager.setScale(scale);
   mTileCanvasViewGroup.setScale(scale);
   mScalingLayout.setScale(scale);
   mCompositePathView.setScale(scale);
   mMarkerLayout.setScale(scale);
   mCalloutLayout.setScale(scale);
 }
コード例 #7
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 @Override
 public void onDetailLevelChanged(DetailLevel detailLevel) {
   requestRender();
   mTileCanvasViewGroup.updateTileSet(detailLevel);
 }
コード例 #8
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 /**
  * Clear tile image files and remove all views, appropriate for Activity.onDestroy. After invoking
  * this method, the TileView instance should be removed from any view trees, and references to it
  * should be set to null.
  */
 public void destroy() {
   pause();
   mTileCanvasViewGroup.destroy();
   mCompositePathView.clear();
   removeAllViews();
 }
コード例 #9
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 /**
  * Defines whether tile bitmaps should be rendered using an AlphaAnimation
  *
  * @param enabled True if the TileView should render tiles with fade transitions
  */
 public void setTransitionsEnabled(boolean enabled) {
   mTileCanvasViewGroup.setTransitionsEnabled(enabled);
 }
コード例 #10
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 /**
  * Instructs Tile instances to recycle (or not). This can be useful if using a caching system that
  * re-uses bitmaps and expects them to not have been recycled.
  *
  * <p>The default value is true.
  *
  * @deprecated This value is no longer considered - bitmaps are always recycled when they're no
  *     longer used.
  * @param shouldRecycleBitmaps True if bitmaps should call Bitmap.recycle when they are removed
  *     from view.
  */
 public void setShouldRecycleBitmaps(boolean shouldRecycleBitmaps) {
   mTileCanvasViewGroup.setShouldRecycleBitmaps(shouldRecycleBitmaps);
 }
コード例 #11
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 /**
  * Sets a custom class to perform the getBitmap operation when tile bitmaps are requested for tile
  * images only. By default, a BitmapDecoder implementation is provided that renders bitmaps from
  * the context's Assets, but alternative implementations could be used that fetch images via HTTP,
  * or from the SD card, or resources, SVG, etc.
  *
  * @param bitmapProvider A class instance that implements BitmapProvider, and must define a
  *     getBitmap method, which accepts a String file name and a Context object, and returns a
  *     Bitmap
  */
 public void setBitmapProvider(BitmapProvider bitmapProvider) {
   mTileCanvasViewGroup.setBitmapProvider(bitmapProvider);
 }
コード例 #12
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 /** Notify the TileView that it should resume tiles rendering. */
 public void resumeRender() {
   mTileCanvasViewGroup.resumeRender();
 }
コード例 #13
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 /**
  * Notify the TileView that it should continue to render any pending tiles, but should not accept
  * new render tasks.
  */
 public void suppressRender() {
   mTileCanvasViewGroup.suppressRender();
 }
コード例 #14
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 /**
  * Notify the TileView that it may stop rendering tiles. The rendering thread will be sent an
  * interrupt request, but no guarantee is provided when the request will be responded to.
  */
 public void cancelRender() {
   mTileCanvasViewGroup.cancelRender();
 }
コード例 #15
0
ファイル: TileView.java プロジェクト: peterLaurence/TileView
 /**
  * Request that the current tile set is re-examined and re-drawn. The request is added to a queue
  * and is not guaranteed to be processed at any particular time, and will never be handled
  * immediately.
  */
 public void requestRender() {
   mTileCanvasViewGroup.requestRender();
 }