public class Projection
extends java.lang.Object
投影工具类。
负责屏幕像素坐标与地理坐标的相互转化。
构造器和说明 |
---|
Projection(AbstractTileLayerView layerView)
构造函数。
|
限定符和类型 | 方法和说明 |
---|---|
int |
calculateZoomLevel(BoundingBox bbox)
计算显示指定矩形区域范围适合的层级。
|
Point2D |
fromPixels(int x, int y)
将屏幕上的像素坐标点转化为对应的地理坐标。
|
Point |
toPixels(Point2D in, Point out)
将地理坐标转化为屏幕上的像素坐标。
|
public Projection(AbstractTileLayerView layerView)
构造函数。
layerView
- 图层视图对象。public int calculateZoomLevel(BoundingBox bbox)
计算显示指定矩形区域范围适合的层级。
bbox
- 指定矩形区域范围。public Point2D fromPixels(int x, int y)
x
- 像素坐标 x 。y
- 像素坐标 y 。public Point toPixels(Point2D in, Point out)
将地理坐标转化为屏幕上的像素坐标。
in
- 地理坐标点。out
- 屏幕上的像素坐标点参数对象。