当前位置: 首页>>代码示例>>Java>>正文


Java TileView.setBitmapProvider方法代码示例

本文整理汇总了Java中com.qozix.tileview.TileView.setBitmapProvider方法的典型用法代码示例。如果您正苦于以下问题:Java TileView.setBitmapProvider方法的具体用法?Java TileView.setBitmapProvider怎么用?Java TileView.setBitmapProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.qozix.tileview.TileView的用法示例。


在下文中一共展示了TileView.setBitmapProvider方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.qozix.tileview.TileView; //导入方法依赖的package包/类
@Override
public void onCreate( Bundle savedInstanceState ) {
	super.onCreate( savedInstanceState );
	tileView = new TileView( this );

	/**
	 * Set an id. This is necessary to enable the save state mechanism of Android.
	 * It is retrieved from a resource value, but it can also be generated with
	 * {@code View.generateViewId()}.
	 */
	tileView.setId( R.id.tileview_id );
	tileView.setSaveEnabled( true );

	// use our own custom bitmap provider to access Android internal storage
	tileView.setBitmapProvider( new BitmapProviderInternalStorage() );

	setContentView( tileView );
}
 
开发者ID:firefly2442,项目名称:ArmaConnect,代码行数:19,代码来源:TileViewActivity.java

示例2: setMap

import com.qozix.tileview.TileView; //导入方法依赖的package包/类
/**
 * Sets the map to generate a new {@link TileView}.
 *
 * @param map The new {@link Map} object
 */
public void setMap(Map map) {
    /* Keep a weakRef for future references */
    mMapWeakReference = new WeakReference<>(map);

    TileView tileView = new TileView(this.getContext());

    /* Set the size of the view in px at scale 1 */
    tileView.setSize(map.getWidthPx(), map.getHeightPx());

    /* Lowest scale */
    List<MapGson.Level> levelList = map.getLevelList();
    float scale = 1 / (float) Math.pow(2, levelList.size() - 1);

    /* Scale limits */
    tileView.setScaleLimits(scale, 2);

    /* Starting scale */
    tileView.setScale(scale);

    /* DetailLevel definition */
    for (MapGson.Level level : levelList) {
        tileView.addDetailLevel(scale, level.level, level.tile_size.x, level.tile_size.y);
        /* Calculate each level scale for best precision */
        scale = 1 / (float) Math.pow(2, levelList.size() - level.level - 2);
    }

    /* Panning outside of the map is not possible --affects minimum scale */
    tileView.setShouldScaleToFit(true);

    /* Disable animations. As of 03/2016, it leads to performance drops */
    tileView.setTransitionsEnabled(false);

    /* Render while panning */
    tileView.setShouldRenderWhilePanning(true);

    /* Map calibration */
    tileView.defineBounds(0, 0, 1, 1);

    /* The calibration marker */
    mCalibrationMarker = new CalibrationMarker(this.getContext());
    MarkerTouchMoveListener.MarkerMoveCallback callback = new CalibrationMarkerMoveCallback();
    mCalibrationMarker.setOnTouchListener(new MarkerTouchMoveListener(tileView, callback));
    tileView.addMarker(mCalibrationMarker, 0.5, 0.5, -0.5f, -0.5f);

    /* The BitmapProvider */
    tileView.setBitmapProvider(map.getBitmapProvider());

    /* Add the TileView to the root view */
    setTileView(tileView);

    /* Update the ui */
    rootView.setup();

    /* Check whether the Map has defined a projection */
    if (map.getProjection() == null) {
        rootView.noProjectionDefined();
    } else {
        rootView.projectionDefined();
    }
}
 
开发者ID:peterLaurence,项目名称:TrekAdvisor,代码行数:66,代码来源:MapCalibrationFragment.java


注:本文中的com.qozix.tileview.TileView.setBitmapProvider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。