OsmAnd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Package Attributes
net.osmand.plus.views.OsmandMapTileView Class Reference

Inherits SurfaceView, IMapDownloaderCallback, and Callback.

List of all members.

Classes

class  MapTileViewMultiTouchZoomListener
class  MapTileViewOnDoubleTapListener
class  MapTileViewOnGestureListener
interface  OnClickListener
interface  OnLongClickListener
interface  OnTrackBallListener

Public Member Functions

 OsmandMapTileView (Context context, AttributeSet attrs)
 OsmandMapTileView (Context context)
void initView ()
void surfaceChanged (SurfaceHolder holder, int format, int width, int height)
void surfaceCreated (SurfaceHolder holder)
void surfaceDestroyed (SurfaceHolder holder)
void addLayer (OsmandMapLayer layer, float zOrder)
void removeLayer (OsmandMapLayer layer)
List< OsmandMapLayergetLayers ()
OsmandApplication getApplication ()
float getTileSize ()
int getSourceTileSize ()
float getXTile ()
float getYTile ()
float getEllipticYTile ()
void setZoom (float zoom)
boolean isMapRotateEnabled ()
void setRotate (float rotate)
boolean isShowMapPosition ()
void setShowMapPosition (boolean showMapPosition)
float getRotate ()
void setLatLon (double latitude, double longitude)
double getLatitude ()
double getLongitude ()
int getZoom ()
boolean isZooming ()
void setMapLocationListener (IMapLocationListener l)
IMapLocationListener setMapLocationListener ()
BaseMapLayer getMainLayer ()
void setMainLayer (BaseMapLayer mainLayer)
int getCenterPointX ()
int getCenterPointY ()
void setMapPosition (int type)
void calculateTileRectangle (Rect pixRect, float cx, float cy, float ctilex, float ctiley, RectF tileRect)
void calculatePixelRectangle (Rect pixelRect, float cx, float cy, float ctilex, float ctiley, RectF tileRect)
OsmandSettings getSettings ()
boolean mapIsRefreshing ()
boolean mapIsAnimating ()
void refreshMap ()
void refreshMap (final boolean force)
void tileDownloaded (DownloadRequest request)
float calcDiffTileY (float dx, float dy)
float calcDiffTileX (float dx, float dy)
float calcDiffPixelY (float dTileX, float dTileY)
float calcDiffPixelX (float dTileX, float dTileY)
int getMapXForPoint (double longitude)
int getMapYForPoint (double latitude)
int getRotatedMapXForPoint (double latitude, double longitude)
int getRotatedMapYForPoint (double latitude, double longitude)
boolean isPointOnTheRotatedMap (double latitude, double longitude)
void moveTo (float dx, float dy)
boolean onTouchEvent (MotionEvent event)
boolean onTrackballEvent (MotionEvent event)
void setTrackBallDelegate (OnTrackBallListener trackBallDelegate)
void setOnLongClickListener (OnLongClickListener l)
void setOnClickListener (OnClickListener l)
LatLon getLatLonFromScreenPoint (float x, float y)
AnimateDraggingMapThread getAnimatedDraggingThread ()

Protected Member Functions

void drawEmptyTile (Canvas cvs, float x, float y, float ftileSize, boolean nightMode)
void dragToAnimate (float fromX, float fromY, float toX, float toY, boolean notify)
void rotateToAnimate (float rotate)
void setLatLonAnimate (double latitude, double longitude, boolean notify)
void zoomToAnimate (float zoom, boolean notify)

Protected Attributes

final int emptyTileDivisor = 16
Handler handler = new Handler()
RectF tilesRect = new RectF()
RectF latlonRect = new RectF()
Rect boundsRect = new Rect()
RectF bitmapToDraw = new RectF()
Rect bitmapToZoom = new Rect()
OsmandSettings settings = null

Static Protected Attributes

static final int LOWEST_ZOOM_TO_ROTATE = 10
static final Log log = LogUtil.getLog(OsmandMapTileView.class)

Package Attributes

Paint paintGrayFill
Paint paintBlackFill
Paint paintWhiteFill
Paint paintCenter

Constructor & Destructor Documentation

net.osmand.plus.views.OsmandMapTileView.OsmandMapTileView ( Context  context,
AttributeSet  attrs 
)

Member Function Documentation

float net.osmand.plus.views.OsmandMapTileView.calcDiffPixelX ( float  dTileX,
float  dTileY 
)
float net.osmand.plus.views.OsmandMapTileView.calcDiffPixelY ( float  dTileX,
float  dTileY 
)
float net.osmand.plus.views.OsmandMapTileView.calcDiffTileX ( float  dx,
float  dy 
)
float net.osmand.plus.views.OsmandMapTileView.calcDiffTileY ( float  dx,
float  dy 
)
void net.osmand.plus.views.OsmandMapTileView.calculatePixelRectangle ( Rect  pixelRect,
float  cx,
float  cy,
float  ctilex,
float  ctiley,
RectF  tileRect 
)
void net.osmand.plus.views.OsmandMapTileView.calculateTileRectangle ( Rect  pixRect,
float  cx,
float  cy,
float  ctilex,
float  ctiley,
RectF  tileRect 
)
void net.osmand.plus.views.OsmandMapTileView.dragToAnimate ( float  fromX,
float  fromY,
float  toX,
float  toY,
boolean  notify 
) [protected]
void net.osmand.plus.views.OsmandMapTileView.drawEmptyTile ( Canvas  cvs,
float  x,
float  y,
float  ftileSize,
boolean  nightMode 
) [protected]
Returns:
y tile based on (int) zoom

These methods do not consider rotating

int net.osmand.plus.views.OsmandMapTileView.getRotatedMapXForPoint ( double  latitude,
double  longitude 
)
int net.osmand.plus.views.OsmandMapTileView.getRotatedMapYForPoint ( double  latitude,
double  longitude 
)

Returns real tile size in pixels for float zoom .

Returns:
x tile based on (int) zoom
Returns:
y tile based on (int) zoom
boolean net.osmand.plus.views.OsmandMapTileView.isPointOnTheRotatedMap ( double  latitude,
double  longitude 
)
void net.osmand.plus.views.OsmandMapTileView.moveTo ( float  dx,
float  dy 
)
void net.osmand.plus.views.OsmandMapTileView.rotateToAnimate ( float  rotate) [protected]
void net.osmand.plus.views.OsmandMapTileView.setLatLon ( double  latitude,
double  longitude 
)
void net.osmand.plus.views.OsmandMapTileView.setLatLonAnimate ( double  latitude,
double  longitude,
boolean  notify 
) [protected]

Adds listener to control when map is dragging

void net.osmand.plus.views.OsmandMapTileView.surfaceChanged ( SurfaceHolder  holder,
int  format,
int  width,
int  height 
)
void net.osmand.plus.views.OsmandMapTileView.tileDownloaded ( DownloadRequest  request)
void net.osmand.plus.views.OsmandMapTileView.zoomToAnimate ( float  zoom,
boolean  notify 
) [protected]

Member Data Documentation

Handler net.osmand.plus.views.OsmandMapTileView.handler = new Handler() [protected]
RectF net.osmand.plus.views.OsmandMapTileView.latlonRect = new RectF() [protected]
final Log net.osmand.plus.views.OsmandMapTileView.log = LogUtil.getLog(OsmandMapTileView.class) [static, protected]
RectF net.osmand.plus.views.OsmandMapTileView.tilesRect = new RectF() [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines