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