Qt → Widgets → Map Display

This component controls how a set of layers are displayed. It' composed by:

  • Display Pixmap: will be the result of all canvas pixmap drawing, i. e., the result of drawing all visible layers.
  • Draft Pixmap: the draft pixmap can be used to draw some feedback on map display.
  • Resize Policy: Used when a canvas is resized. The options are: Fixed, Cut, Center.

When the canvas is resized, the map display makes all the layers are redrawn.

Classes:

  • MapDisplay
  • MultiThreadMapDisplay

Design

From Theory to Practice

Create a new MapDisplay

QSize size(512, 512);
te::qt::widgets::MapDisplay* display = new te::qt::widgets::MapDisplay(size, null);
display->setResizePolicy(te::qt::widgets::MapDisplay::Center);

Adding layers and drawing all

int srid = ...; //projection id
te::gm::Envelope* extent = ...;
std::list<te::map::AbstractLayer*> layers;

te::map::AbstractLayer* l = ...;

layers.push_back(l);

display->setLayerList(layers);
display->setSRID(srid);
display->setExtent(*extent);

Component Summary



Final Remarks

TO BE DONE

References

TO BE DONE


QR Code
QR Code wiki:designimplementation:qt:widgets:mapdsp (generated for current page)