MapLayer Class Reference

MapLayer class. More...

#include <maplayer.h>

Inheritance diagram for MapLayer:

Layer

List of all members.

Public Types

enum  LayerType { MapLayer, GeometryLayer }
 sets the type of a layer, see Layer class doc for further information More...

Public Slots

void setVisible (bool visible)
 if visible is true, the layer is made visible

Signals

void geometryClicked (Geometry *geometry, QPoint point)
 This signal is emitted when a Geometry is clicked.

Public Member Functions

void addGeometry (Geometry *geometry)
 adds a Geometry object to this Layer
void clearGeometries ()
 removes all Geometry objects from this Layer
bool isVisible () const
 return true if the layer is visible
QString layername () const
 returns the layer's name
Layer::LayerType layertype () const
 returns the LayerType of the Layer
const MapAdaptermapadapter () const
 returns the layer´s MapAdapter
 MapLayer (QString layername, MapAdapter *mapadapter, bool takeevents=true)
 MapLayer constructor.
void removeGeometry (Geometry *geometry)
 removes the Geometry object from this Layer


Detailed Description

MapLayer class.

There are two different layer types:

MapLayers also can display Geometry objects. The difference to the GeometryLayer is the repainting. Objects that are added to a MapLayer are "baken" on the map. This means, when you change it´s position for example the changes are not visible until a new offscreen image has been drawn. If you have "static" Geometries which won´t change their position this is fine. But if you want to change the objects position or pen you should use a GeometryLayer. Those are repainted immediately on changes.

Author:
Kai Winter <kaiwinter@gmx.de>

Member Enumeration Documentation

enum LayerType [inherited]

sets the type of a layer, see Layer class doc for further information

Enumerator:
MapLayer  uses the MapAdapter to display maps, only gets refreshed when a new offscreen image is needed
GeometryLayer  gets refreshed everytime when a geometry changes


Constructor & Destructor Documentation

MapLayer ( QString  layername,
MapAdapter mapadapter,
bool  takeevents = true 
)

MapLayer constructor.

This is used to construct a map layer.

Parameters:
layername The name of the Layer
mapadapter The MapAdapter which does coordinate translation and Query-String-Forming
takeevents Should the Layer receive MouseEvents? This is set to true by default. Setting it to false could be something like a "speed up hint"


Member Function Documentation

void addGeometry ( Geometry geometry  )  [inherited]

adds a Geometry object to this Layer

Please notice the different LayerTypes (MapLayer and GeometryLayer) and the differences

Parameters:
geometry the new Geometry

References Geometry::boundingBox().

void clearGeometries (  )  [inherited]

removes all Geometry objects from this Layer

This method removes all Geometry objects from this Layer.

void geometryClicked ( Geometry geometry,
QPoint  point 
) [signal, inherited]

This signal is emitted when a Geometry is clicked.

A Geometry is clickable, if the containing layer is clickable. The layer emits a signal for every clicked geometry

Parameters:
geometry The clicked Geometry
point The coordinate (in widget coordinates) of the click

bool isVisible (  )  const [inherited]

return true if the layer is visible

Returns:
if the layer is visible

QString layername (  )  const [inherited]

returns the layer's name

Returns:
the name of this layer

Layer::LayerType layertype (  )  const [inherited]

returns the LayerType of the Layer

There are two LayerTypes: MapLayer and GeometryLayer

Returns:
the LayerType of this Layer

const MapAdapter * mapadapter (  )  const [inherited]

returns the layer´s MapAdapter

This method returns the MapAdapter of this Layer, which can be useful to do coordinate transformations.

Returns:
the MapAdapter which us used by this Layer

void removeGeometry ( Geometry geometry  )  [inherited]

removes the Geometry object from this Layer

This method removes a Geometry object from this Layer.

void setVisible ( bool  visible  )  [slot, inherited]

if visible is true, the layer is made visible

Parameters:
visible if the layer should be visible


The documentation for this class was generated from the following files:

Generated on Wed Jul 29 12:38:10 2009 for QMapControl by  doxygen 1.5.9