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(); }
/** * Allows the use of a custom {@link DetailLevelManager}. * <p> * For example, to change the logic of {@link DetailLevel} choice for a given scale, you * declare your own {@code DetailLevelMangerCustom} that extends {@link DetailLevelManager} : * <pre>{@code * private class DetailLevelManagerCustom extends DetailLevelManager{ * @literal @Override * public DetailLevel getDetailLevelForScale(){ * // your logic here * } * } * } * </pre> * Then you should use {@code TileView.setDetailLevelManager} before other method calls, especially * {@code TileView.setSize} and {@code TileView.addDetailLevel}. * </p> * * @param manager The DetailLevelManager instance used. */ public void setDetailLevelManager(DetailLevelManager manager) { mDetailLevelManager = manager; mDetailLevelManager.setDetailLevelChangeListener(this); }