Package org.oscim.utils
Class ScanBox
java.lang.Object
org.oscim.utils.ScanBox
Scan-line fill algorithm to retrieve tile-coordinates from
Viewport.
ScanBox is used to calculate tile coordinates that intersect the box (or
trapezoid) which is the projection of screen bounds to the map. Usage:
Viewport.getMapViewProjection(box)
ScanBox sb = new ScanBox(){
protected void setVisible(int y, int x1, int x2) {
}
};
sb.scan(pos.x, pos.y, pos.scale, * zoomLevel, coords);
where zoomLevel is the zoom-level for which tile coordinates should be
calculated.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidscan(double x, double y, double scale, int zoom, float[] box) protected abstract voidsetVisible(int y, int x1, int x2)
-
Field Details
-
mZoom
protected int mZoom
-
-
Constructor Details
-
ScanBox
public ScanBox()
-
-
Method Details
-
setVisible
protected abstract void setVisible(int y, int x1, int x2) - Parameters:
y- the y-number of tile to be set visible.x1- the start x-number of tile to be set visible.x2- the end x-number of tile to be set visible (excluded).
-
scan
public void scan(double x, double y, double scale, int zoom, float[] box) - Parameters:
x- Projected map position x in 0..1.y- Projected map position y in 0..1.scale- Absolute scale.zoom- Tile zoom level for current scale.box- Current visible cut-out (8 floats).
-