MoSync 3.3
MAP::LayerMapViewport Class Reference

Simple slippy map viewport. More...

#include <MAP/LayerMapViewport.h>

Inheritance diagram for MAP::LayerMapViewport:
MAP::MapViewport MAPUtil::Broadcaster< ILayerMapViewportListener > MAP::ILayerListener MAP::IMapCacheListener MAPUtil::Broadcaster< IMapViewportListener >

List of all members.

Public Member Functions

 LayerMapViewport ()
virtual ~LayerMapViewport ()
Vector< Layer * > & getLayers ()
void addLayer (Layer *layer)
void removeLayer (Layer *layer)
void clearLayers ()
void selectNextLayer ()
void selectLayer (int layer)
void selectItem (int index)
void selectNextItem ()
void selectPreviousItem ()
void activateSelectedItem ()
void centerAndScaleToLayer ()
virtual bool handleKeyPress (int keyCode)
virtual bool handleKeyRelease (int keyCode)
virtual void contentChanged (Layer *sender)
void updateMap ()
MapSourcegetMapSource () const
void setMapSource (MapSource *source)
LonLat getCenterPosition () const
void setCenterPosition (LonLat targetLonLat, bool immediate, bool isPointerEvent)
void setCenterPosition (LonLat targetLonLat, MagnificationType magnification, bool immediate, bool isPointerEvent)
PixelCoordinate getCenterPositionPixels () const
MagnificationType getMagnification () const
void setMagnification (MagnificationType magnification)
bool showLonLat () const
void setShowLonLat (bool enabled)
bool showHairlineCross () const
void setShowHairlineCross (bool enabled)
bool showPixelScale () const
void setShowPixelScale (bool enabled)
void startGlide ()
void stopGlide ()
FontgetFont () const
void setFont (Font *font)
void scroll (MapViewportScrollDirection direction, bool largeStep)
void zoomIn ()
void zoomOut ()
void setWidth (int width)
void setHeight (int height)
virtual void tileReceived (MapCache *sender, MapTile *tile, bool foundInCache)
virtual void jobComplete (MapCache *sender)
virtual void error (MapCache *sender, int error)
MAPoint2d worldPixelToViewport (PixelCoordinate wpx)
PixelCoordinate viewportToWorldPixel (MAPoint2d pt)
void centerAndScaleToRectangle (LonLat lowerLeft, LonLat upperRight)
int getWidth ()
int getHeight () const
int getScaledWidth () const
int getScaledHeight () const
virtual void drawViewport (Point origin)
void beginZooming (const MAPoint2d &p1, const MAPoint2d &p2)
void updateZooming (const MAPoint2d &p1, const MAPoint2d &p2)
void endZooming ()
bool isZooming ()
void beginPanning (const MAPoint2d &p)
void updatePanning (const MAPoint2d &p)
void endPanning ()
void moveCenterPositionInPixels (int xdelta, int ydelta)
void setScale (double scale)
double getScale ()
void addListener (IMapViewportListener *listener)
void removeListener (IMapViewportListener *listener)
Vector< IMapViewportListener * > * getListeners ()
void addListener (ILayerMapViewportListener *listener)
void removeListener (ILayerMapViewportListener *listener)
< ILayerMapViewportListener * > * 
getListeners ()

Protected Member Functions

virtual void drawOverlay (Rect &bounds, MagnificationType magnification)
void panSelectionIntoView ()
virtual void onViewportUpdated ()
virtual void onError (int code)

Detailed Description

Simple slippy map viewport.

Constructor & Destructor Documentation

Member Function Documentation

void MAP::LayerMapViewport::selectItem ( int  index)
virtual bool MAP::LayerMapViewport::handleKeyPress ( int  keyCode) [virtual]

Handles key press. Returns true if handled.

Reimplemented from MAP::MapViewport.

virtual bool MAP::LayerMapViewport::handleKeyRelease ( int  keyCode) [virtual]

Handles key release. Returns true if handled.

Reimplemented from MAP::MapViewport.

virtual void MAP::LayerMapViewport::contentChanged ( Layer sender) [virtual]

Implements MAP::ILayerListener.

virtual void MAP::LayerMapViewport::drawOverlay ( Rect bounds,
MagnificationType  magnification 
) [protected, virtual]

Reimplemented from MAP::MapViewport.

void MAP::MapViewport::updateMap ( ) [inherited]

Map update scope

MapSource* MAP::MapViewport::getMapSource ( ) const [inline, inherited]

Map source property

void MAP::MapViewport::setMapSource ( MapSource source) [inherited]

Center position property

void MAP::MapViewport::setCenterPosition ( LonLat  targetLonLat,
bool  immediate,
bool  isPointerEvent 
) [inherited]
void MAP::MapViewport::setCenterPosition ( LonLat  targetLonLat,
MagnificationType  magnification,
bool  immediate,
bool  isPointerEvent 
) [inherited]

Magnification property

void MAP::MapViewport::setMagnification ( MagnificationType  magnification) [inherited]
bool MAP::MapViewport::showLonLat ( ) const [inline, inherited]
void MAP::MapViewport::setShowLonLat ( bool  enabled) [inherited]
bool MAP::MapViewport::showHairlineCross ( ) const [inline, inherited]
void MAP::MapViewport::setShowHairlineCross ( bool  enabled) [inherited]
bool MAP::MapViewport::showPixelScale ( ) const [inline, inherited]
void MAP::MapViewport::setShowPixelScale ( bool  enabled) [inherited]
void MAP::MapViewport::startGlide ( ) [inherited]
void MAP::MapViewport::stopGlide ( ) [inherited]
Font* MAP::MapViewport::getFont ( ) const [inline, inherited]

Returns currently used font.

void MAP::MapViewport::setFont ( Font font) [inline, inherited]

Sets font property.

void MAP::MapViewport::scroll ( MapViewportScrollDirection  direction,
bool  largeStep 
) [inherited]

Scrolls the map in the specified direction.

void MAP::MapViewport::zoomIn ( ) [inherited]

Increases magnification by 1 step, i.e. a factor of two.

void MAP::MapViewport::zoomOut ( ) [inherited]
void MAP::MapViewport::setWidth ( int  width) [inherited]
void MAP::MapViewport::setHeight ( int  height) [inherited]
virtual void MAP::MapViewport::tileReceived ( MapCache sender,
MapTile tile,
bool  foundInCache 
) [virtual, inherited]

Called when a requested tile has been received into cache from map source.

Implements MAP::IMapCacheListener.

virtual void MAP::MapViewport::jobComplete ( MapCache sender) [virtual, inherited]

Called when a tile job is completed.

Implements MAP::IMapCacheListener.

virtual void MAP::MapViewport::error ( MapCache sender,
int  code 
) [virtual, inherited]

Called when an error occurred, likely when MapSource failed to download tile.

Implements MAP::IMapCacheListener.

Converts from global map pixels to viewport pixels.

Converts from viewport pixels to global map pixels.

void MAP::MapViewport::centerAndScaleToRectangle ( LonLat  lowerLeft,
LonLat  upperRight 
) [inherited]
int MAP::MapViewport::getWidth ( ) [inline, inherited]
int MAP::MapViewport::getHeight ( ) const [inline, inherited]
int MAP::MapViewport::getScaledWidth ( ) const [inline, inherited]

References floor().

int MAP::MapViewport::getScaledHeight ( ) const [inline, inherited]

References floor().

virtual void MAP::MapViewport::drawViewport ( Point  origin) [virtual, inherited]
void MAP::MapViewport::beginZooming ( const MAPoint2d p1,
const MAPoint2d p2 
) [inherited]
void MAP::MapViewport::updateZooming ( const MAPoint2d p1,
const MAPoint2d p2 
) [inherited]
void MAP::MapViewport::endZooming ( ) [inherited]
bool MAP::MapViewport::isZooming ( ) [inherited]
void MAP::MapViewport::beginPanning ( const MAPoint2d p) [inherited]
void MAP::MapViewport::updatePanning ( const MAPoint2d p) [inherited]
void MAP::MapViewport::endPanning ( ) [inherited]
void MAP::MapViewport::moveCenterPositionInPixels ( int  xdelta,
int  ydelta 
) [inherited]
void MAP::MapViewport::setScale ( double  scale) [inherited]
double MAP::MapViewport::getScale ( ) [inherited]
virtual void MAP::MapViewport::onViewportUpdated ( ) [protected, virtual, inherited]
virtual void MAP::MapViewport::onError ( int  code) [protected, virtual, inherited]
void MAPUtil::Broadcaster< IMapViewportListener >::addListener ( IMapViewportListener *  listener) [inline, inherited]

Add a listener. Clients should call this to register for notification.

void MAPUtil::Broadcaster< IMapViewportListener >::removeListener ( IMapViewportListener *  listener) [inline, inherited]

Remove a listener. Clients should call this to unregister for notification.

void MAPUtil::Broadcaster< ILayerMapViewportListener >::addListener ( ILayerMapViewportListener *  listener) [inline, inherited]

Add a listener. Clients should call this to register for notification.

void MAPUtil::Broadcaster< ILayerMapViewportListener >::removeListener ( ILayerMapViewportListener *  listener) [inline, inherited]

Remove a listener. Clients should call this to unregister for notification.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines