private int _zoom = 12;
/** Factor to zoom by, 2 to the power of zoom */
private int _zoomFactor = 1 << _zoom;
+ /** Flag to mark if this position has ever been set */
+ private boolean _empty = true;
/** Maximum zoom level */
private static final int MAX_ZOOM = 21;
}
}
if (requiredZoom < 2) requiredZoom = 2;
+ else if (requiredZoom > 18) requiredZoom = 18;
// Set position
setZoom(requiredZoom);
_xPosition = transformToPixels((inMinX + inMaxX) / 2.0);
_yPosition = transformToPixels((inMinY + inMaxY) / 2.0);
+ _empty = false;
}
/**
{
_zoom = inZoom;
_zoomFactor = 1 << _zoom;
+ _empty = false;
}
/**
// Set position
_xPosition = (_xPosition - inWidth/2 + (inMinX + inMaxX) / 2) * multFactor;
_yPosition = (_yPosition - inHeight/2 + (inMinY + inMaxY) / 2) * multFactor;
+ _empty = false;
}
/**
_xPosition += inDeltaX;
_yPosition += inDeltaY;
}
+
+ /**
+ * @return true if this position has never been set
+ */
+ public boolean isEmpty()
+ {
+ return _empty;
+ }
}