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


Java BoundingBox.getCenterPoint方法代码示例

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


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

示例1: animateTo

import org.oscim.core.BoundingBox; //导入方法依赖的package包/类
public synchronized void animateTo(long duration, BoundingBox bbox) {
	mMap.getMapPosition(mStartPos);
	/* TODO for large distance first scale out, then in
	 * calculate the maximum scale at which the BoundingBox
	 * is completely visible */
	double dx = Math.abs(longitudeToX(bbox.getMaxLongitude())
	        - longitudeToX(bbox.getMinLongitude()));

	double dy = Math.abs(latitudeToY(bbox.getMinLatitude())
	        - latitudeToY(bbox.getMaxLatitude()));

	log.debug("anim bbox " + bbox);

	double zx = mMap.getWidth() / (dx * Tile.SIZE);
	double zy = mMap.getHeight() / (dy * Tile.SIZE);
	double newScale = Math.min(zx, zy);

	GeoPoint p = bbox.getCenterPoint();

	mDeltaPos.set(longitudeToX(p.getLongitude()) - mStartPos.x,
	              latitudeToY(p.getLatitude()) - mStartPos.y,
	              newScale - mStartPos.scale,
	              -mStartPos.bearing,
	              -mStartPos.tilt);

	animStart(duration, ANIM_MOVE | ANIM_SCALE | ANIM_ROTATE | ANIM_TILT);
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:28,代码来源:Animator.java

示例2: animateTo

import org.oscim.core.BoundingBox; //导入方法依赖的package包/类
public synchronized void animateTo(BoundingBox bbox) {

		// calculate the minimum scale at which the bbox is completely visible
		double dx = Math.abs(MercatorProjection.longitudeToX(bbox.getMaxLongitude())
				- MercatorProjection.longitudeToX(bbox.getMinLongitude()));

		double dy = Math.abs(MercatorProjection.latitudeToY(bbox.getMinLatitude())
				- MercatorProjection.latitudeToY(bbox.getMaxLatitude()));

		double zx = mWidth / (dx * Tile.SIZE);
		double zy = mHeight / (dy * Tile.SIZE);
		double newScale = Math.min(zx, zy);

		newScale = FastMath.clamp(newScale, MIN_SCALE, 1 << ABS_ZOOMLEVEL);

		float scale = (float) (newScale / mAbsScale);

		Log.d(TAG, "scale to " + bbox + " " + newScale + " " + mAbsScale
				+ " " + FastMath.log2((int) newScale) + " " + scale);

		mEndScale = mAbsScale * scale - mAbsScale;
		mStartScale = mAbsScale;
		mStartRotation = mRotation;

		double f = Tile.SIZE << ABS_ZOOMLEVEL;
		mStartX = mAbsX * f;
		mStartY = mAbsY * f;

		GeoPoint geoPoint = bbox.getCenterPoint();

		mEndX = MercatorProjection.longitudeToX(geoPoint.getLongitude()) * f;
		mEndY = MercatorProjection.latitudeToY(geoPoint.getLatitude()) * f;
		mEndX -= mStartX;
		mEndY -= mStartY;
		mAnimMove = true;
		mAnimScale = true;
		mAnimFling = false;
		animStart(500);
	}
 
开发者ID:opensciencemap,项目名称:vtm-android,代码行数:40,代码来源:MapViewPosition.java

示例3: MapInfo

import org.oscim.core.BoundingBox; //导入方法依赖的package包/类
/**
 * @param bbox
 *            ...
 * @param zoom
 *            ...
 * @param start
 *            ...
 * @param projection
 *            ...
 * @param date
 *            ...
 * @param size
 *            ...
 * @param version
 *            ...
 * @param language
 *            ...
 * @param comment
 *            ...
 * @param createdBy
 *            ...
 * @param zoomLevel
 *            TODO
 */
public MapInfo(BoundingBox bbox, Byte zoom, GeoPoint start, String projection,
        long date, long size, int version, String language, String comment,
        String createdBy, int[] zoomLevel) {

	this.startZoomLevel = zoom;
	this.zoomLevel = zoomLevel;
	this.startPosition = start;
	this.projectionName = projection;
	this.mapDate = date;
	this.boundingBox = bbox;
	this.mapCenter = bbox.getCenterPoint();
	this.languagePreference = language;
	this.fileSize = size;
	this.fileVersion = version;

	this.comment = comment;
	this.createdBy = createdBy;

}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:44,代码来源:MapInfo.java

示例4: MapInfo

import org.oscim.core.BoundingBox; //导入方法依赖的package包/类
/**
 * @param bbox
 *            ...
 * @param zoom
 *            ...
 * @param start
 *            ...
 * @param projection
 *            ...
 * @param date
 *            ...
 * @param size
 *            ...
 * @param version
 *            ...
 * @param language
 *            ...
 * @param comment
 *            ...
 * @param createdBy
 *            ...
 * @param zoomLevel
 *            TODO
 */
public MapInfo(BoundingBox bbox, Byte zoom, GeoPoint start, String projection,
		long date, long size, int version, String language, String comment,
		String createdBy, int[] zoomLevel) {

	this.startZoomLevel = zoom;
	this.zoomLevel = zoomLevel;
	this.startPosition = start;
	this.projectionName = projection;
	this.mapDate = date;
	this.boundingBox = bbox;
	this.mapCenter = bbox.getCenterPoint();
	this.languagePreference = language;
	this.fileSize = size;
	this.fileVersion = version;

	this.comment = comment;
	this.createdBy = createdBy;

}
 
开发者ID:opensciencemap,项目名称:vtm-android,代码行数:44,代码来源:MapInfo.java


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