本文整理汇总了Java中com.codename1.maps.Coord.translate方法的典型用法代码示例。如果您正苦于以下问题:Java Coord.translate方法的具体用法?Java Coord.translate怎么用?Java Coord.translate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.codename1.maps.Coord
的用法示例。
在下文中一共展示了Coord.translate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bboxFor
import com.codename1.maps.Coord; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public BoundingBox bboxFor(Coord position, int zoomLevel) {
_zoomLevel = zoomLevel;
Coord scale = scale(zoomLevel);
Dimension tileSize = tileSize();
double x = scale.getLongitude() * tileSize.getWidth();
double y = scale.getLatitude() * tileSize.getHeight();
Coord tileScale = new Coord(y, x, false);
_tileNo = tileNo(position, projection().extent().getSouthWest(), tileScale);
Coord start = tileCoord(_tileNo, projection().extent().getSouthWest(), tileScale);
Coord end = start.translate(tileScale.getLatitude(), tileScale.getLongitude());
return new BoundingBox(start, end);
}
示例2: bboxFor
import com.codename1.maps.Coord; //导入方法依赖的package包/类
/**
* @inheritDoc
*/
public BoundingBox bboxFor(Coord position, int zoomLevel) {
_zoomLevel = zoomLevel;
Coord scale = scale(zoomLevel);
Dimension tileSize = tileSize();
double x = scale.getLongitude() * tileSize.getWidth();
double y = scale.getLatitude() * tileSize.getHeight();
Coord tileScale = new Coord(y, x, false);
_tileNo = tileNo(position, projection().extent().getSouthWest(), tileScale);
Coord start = tileCoord(_tileNo, projection().extent().getSouthWest(), tileScale);
Coord end = start.translate(tileScale.getLatitude(), tileScale.getLongitude());
return new BoundingBox(start, end);
}
示例3: translate
import com.codename1.maps.Coord; //导入方法依赖的package包/类
/**
* Translates position by [pixelsX, pixelsY] at zoomLevel acordingly to maps scale.
* @param position in map projection
* @param zoomLevel
* @param pixelsX
* @param pixelsY
* @return translated position.
*/
public Coord translate(Coord position, int zoomLevel, int pixelsX, int pixelsY) {
Coord scale = scale(zoomLevel);
return position.translate(pixelsY * scale.getLatitude(), pixelsX * scale.getLongitude());
}