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


Java TileView.defineBounds方法代码示例

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


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

示例1: setTileViewBounds

import com.qozix.tileview.TileView; //导入方法依赖的package包/类
private void setTileViewBounds(TileView tileView, Map map) {
    Map.MapBounds mapBounds = map.getMapBounds();
    if (mapBounds != null) {
        tileView.defineBounds(mapBounds.X0,
                mapBounds.Y0,
                mapBounds.X1,
                mapBounds.Y1);
    } else {
        tileView.defineBounds(0, 0, 1, 1);
    }
}
 
开发者ID:peterLaurence,项目名称:TrekAdvisor,代码行数:12,代码来源:MapViewFragment.java

示例2: onCreate

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

	// let the image explode
	tileView.setScaleLimits( 0, 2 );
	
	// size of original image at 100% mScale
	tileView.setSize( 2835, 4289 );
	
	// detail levels
	tileView.addDetailLevel( 1.000f, "tiles/painting/1000/%d_%d.jpg");
	tileView.addDetailLevel( 0.500f, "tiles/painting/500/%d_%d.jpg");
	tileView.addDetailLevel( 0.250f, "tiles/painting/250/%d_%d.jpg");
	tileView.addDetailLevel( 0.125f, "tiles/painting/125/%d_%d.jpg");
	
	// set mScale to 0, but keep scaleToFit true, so it'll be as small as possible but still match the container
	tileView.setScale( 0 );
	
	// let's use 0-1 positioning...
	tileView.defineBounds( 0, 0, 1, 1 );
	
	// frame to center
	frameTo( 0.5, 0.5 );

	// render while panning
	tileView.setShouldRenderWhilePanning( true );

	// disallow going back to minimum scale while double-taping at maximum scale (for demo purpose)
	tileView.setShouldLoopScale( false );
}
 
开发者ID:moagrius,项目名称:TileView,代码行数:36,代码来源:LargeImageTileViewActivity.java

示例3: 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

示例4: onCreate

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

	// size of original image at 100% mScale
	tileView.setSize( 2736, 2880 );

	// small map, let's let it resize to 200%
	tileView.setScaleLimits( 0, 2 );

	// we're running from assets, should be fairly fast decodes, go ahead and render asap
	tileView.setShouldRenderWhilePanning( true );

	// detail levels
	tileView.addDetailLevel( 1.000f, "tiles/plans/1000/%d_%d.jpg");
	tileView.addDetailLevel( 0.500f, "tiles/plans/500/%d_%d.jpg");
	tileView.addDetailLevel( 0.250f, "tiles/plans/250/%d_%d.jpg");
	tileView.addDetailLevel( 0.125f, "tiles/plans/125/%d_%d.jpg");

	// let's use 0-1 positioning...
	tileView.defineBounds( 0, 0, 1, 1 );
	
	// center markers along both axes
	tileView.setMarkerAnchorPoints( -0.5f, -0.5f );
	
	// add a marker listener
	tileView.setMarkerTapListener( mMarkerTapListener );
	
	// add some pins...
	addPin( 0.25, 0.25 );
	addPin( 0.25, 0.75 );
	addPin( 0.75, 0.25 );
	addPin( 0.75, 0.75 );
	addPin( 0.50, 0.50 );
	
	// mScale it down to manageable size
	tileView.setScale( 0.5f );
	
	// center the frame
	frameTo( 0.5, 0.5 );
	
}
 
开发者ID:moagrius,项目名称:TileView,代码行数:47,代码来源:BuildingPlansTileViewActivity.java


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