#include <maplayer.h>
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 MapAdapter * | mapadapter () 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 |
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.
enum LayerType [inherited] |
sets the type of a layer, see Layer class doc for further information
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 |
MapLayer | ( | QString | layername, | |
MapAdapter * | mapadapter, | |||
bool | takeevents = true | |||
) |
MapLayer constructor.
This is used to construct a map layer.
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" |
void addGeometry | ( | Geometry * | geometry | ) | [inherited] |
adds a Geometry object to this Layer
Please notice the different LayerTypes (MapLayer and GeometryLayer) and the differences
geometry | the new Geometry |
References Geometry::boundingBox().
void clearGeometries | ( | ) | [inherited] |
void geometryClicked | ( | Geometry * | geometry, | |
QPoint | point | |||
) | [signal, inherited] |
bool isVisible | ( | ) | const [inherited] |
return true if the layer is visible
QString layername | ( | ) | const [inherited] |
returns the layer's name
Layer::LayerType layertype | ( | ) | const [inherited] |
returns the LayerType of the Layer
There are two LayerTypes: MapLayer and GeometryLayer
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.
void removeGeometry | ( | Geometry * | geometry | ) | [inherited] |
void setVisible | ( | bool | visible | ) | [slot, inherited] |
if visible is true, the layer is made visible
visible | if the layer should be visible |