本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}