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


Java MercatorProjection.latitudeToY方法代码示例

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


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

示例1: animateTo

import org.oscim.core.MercatorProjection; //导入方法依赖的package包/类
public synchronized void animateTo(GeoPoint geoPoint) {
	double f = Tile.SIZE << ABS_ZOOMLEVEL;

	mStartX = mAbsX * f;
	mStartY = mAbsY * f;

	mEndX = MercatorProjection.longitudeToX(geoPoint.getLongitude()) * f;
	mEndY = MercatorProjection.latitudeToY(geoPoint.getLatitude()) * f;

	mEndX -= mStartX;
	mEndY -= mStartY;

	mAnimMove = true;
	mAnimScale = false;
	mAnimFling = false;
	animStart(300);
}
 
开发者ID:opensciencemap,项目名称:vtm-android,代码行数:18,代码来源:MapViewPosition.java

示例2: constructor

import org.oscim.core.MercatorProjection; //导入方法依赖的package包/类
@Test
void constructor() {

    double latTopLeft = 52.581;
    double lonTopLeft = 13.396;
    double latBotomRight = 52.579;
    double lonBotomright = 13.400;
    double latCenter = 52.580;
    double lonCenter = 13.398;

    GeoPoint leftTop = new GeoPoint(latTopLeft, lonTopLeft);
    GeoPoint rightBotom = new GeoPoint(latBotomRight, lonBotomright);
    GeoPoint geoPoint = new GeoPoint(latCenter, lonCenter);


    GeoBoundingBoxInt gbb = new GeoBoundingBoxInt(leftTop, rightBotom);
    assertThat("Point must inside Box", gbb.contains(geoPoint));


    Box box = new Box(MercatorProjection.longitudeToX(lonTopLeft)
            , MercatorProjection.latitudeToY(latTopLeft)
            , MercatorProjection.longitudeToX(lonBotomright)
            , MercatorProjection.latitudeToY(latBotomRight));

    box.map2mercator();
    assertThat("Point must inside Box", box.contains(lonCenter, latCenter));

    GeoBoundingBoxInt geoBoundingBox = new GeoBoundingBoxInt(box);
    assertThat("Point must inside Box", geoBoundingBox.contains(geoPoint));

}
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:32,代码来源:GeoBoundingBoxTest.java

示例3: transformPath

import org.oscim.core.MercatorProjection; //导入方法依赖的package包/类
protected int transformPath(MapPosition pos, GeometryBuffer g, CoordinatePath path) {

		double scale = pos.scale * Tile.SIZE / UNSCALE_COORD;
		int cnt = 0;
		O: while (path.hasNext()) {
			Coordinate c = path.next();
			float x = (float) ((MercatorProjection.longitudeToX(c.x) - pos.x) * scale);
			float y = (float) ((MercatorProjection.latitudeToY(c.y) - pos.y) * scale);

			switch (path.getStep()) {
				case MOVE_TO:
					if (g.isPoly())
						g.startPolygon();
					else if (g.isLine())
						g.startLine();

					cnt++;
					g.addPoint(x, y);
					break;
				case LINE_TO:
					cnt++;
					g.addPoint(x, y);
					break;
				case CLOSE:
					//g.addPoint(x, y);
					//if (g.type == GeometryType.POLY)
					break;
				case STOP:
					break O;
			}
		}
		return cnt;
	}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:34,代码来源:JtsLayer.java

示例4: setPosition

import org.oscim.core.MercatorProjection; //导入方法依赖的package包/类
public void setPosition(double latitude, double longitude, double accuracy) {
    mLocation.x = MercatorProjection.longitudeToX(longitude);
    mLocation.y = MercatorProjection.latitudeToY(latitude);
    mRadius = accuracy / MercatorProjection.groundResolution(latitude, 1);
    locationAccuracyRenderer.setLocation(mLocation.x, mLocation.y, mRadius);
}
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:7,代码来源:LocationAccuracyLayer.java

示例5: setPosition

import org.oscim.core.MercatorProjection; //导入方法依赖的package包/类
public void setPosition(double latitude, double longitude, float bearing) {
    mLocation.x = MercatorProjection.longitudeToX(longitude);
    mLocation.y = MercatorProjection.latitudeToY(latitude);
    mBearing = bearing;
    ((LocationIndicator) mRenderer).animate(true);
}
 
开发者ID:andreynovikov,项目名称:trekarta,代码行数:7,代码来源:LocationOverlay.java

示例6: setMapCenter

import org.oscim.core.MercatorProjection; //导入方法依赖的package包/类
private void setMapCenter(double latitude, double longitude) {
	latitude = MercatorProjection.limitLatitude(latitude);
	longitude = MercatorProjection.limitLongitude(longitude);
	mAbsX = MercatorProjection.longitudeToX(longitude);
	mAbsY = MercatorProjection.latitudeToY(latitude);
}
 
开发者ID:opensciencemap,项目名称:vtm-android,代码行数:7,代码来源:MapViewPosition.java

示例7: setPosition

import org.oscim.core.MercatorProjection; //导入方法依赖的package包/类
public void setPosition(double latitude, double longitude, double accuracy) {
	mLocation.x = MercatorProjection.longitudeToX(longitude);
	mLocation.y = MercatorProjection.latitudeToY(latitude);
	mRadius = accuracy / MercatorProjection.groundResolution(latitude, 1);
	((LocationIndicator) mRenderer).animate(true);
}
 
开发者ID:opensciencemap,项目名称:vtm-app,代码行数:7,代码来源:LocationOverlay.java


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