![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Unified dialog for adding a layer from a web service or a file. More...
#include <addbasemapdialog.h>
Public Types | |
| enum | Tab { XyzTiles = 0 , WmsWmts = 1 , Wcs = 2 , ArcGisRest = 3 , LocalFile = 4 , Wfs = 5 } |
| The dialog's pages, in the order they appear. More... | |
Public Member Functions | |
| AddBasemapDialog (QWidget *parent=nullptr) | |
| ~AddBasemapDialog () override | |
| void | setPreferredExtent (const QRectF &lonLatBounds) |
| Limits a feature request to the ground the map is looking at. | |
| void | connectToWFS () |
| Asks the WFS at the address now entered what it holds. | |
| QString | wfsStatus () const |
| OpenSWMMVisLayer * | createLayer (QObject *parent) const |
| Creates and returns the layer the current page describes. | |
| void | setInitialTab (int index) |
Unified dialog for adding a layer from a web service or a file.
The dialog's pages, in the order they appear.
Named because createLayer() dispatches on the current page and callers open the dialog on a chosen one; bare indices in two files is how that goes wrong quietly.
Wfs is last rather than beside the other OGC services, which would read better, because DialogLayoutPersistence remembers the selected page by index – renumbering would silently open somebody's saved dialog on a different service.
| Enumerator | |
|---|---|
| XyzTiles | |
| WmsWmts | |
| Wcs | |
| ArcGisRest | |
| LocalFile | |
| Wfs | |
|
explicit |
|
override |
| void AddBasemapDialog::connectToWFS | ( | ) |
Asks the WFS at the address now entered what it holds.
Public because it is what the page's Connect button does, and a test should press the button rather than reach past it.
| OpenSWMMVisLayer * AddBasemapDialog::createLayer | ( | QObject * | parent | ) | const |
Creates and returns the layer the current page describes.
Not always a basemap. The WFS page yields a vector layer of features for the layer tree rather than a picture to sit behind the model, and that layer has already been fetched by the time this is called – see fetchWFSThenAccept().
Caller owns the returned object. Returns nullptr on failure.
| parent | Qt parent for the new layer object. |
| void AddBasemapDialog::setInitialTab | ( | int | index | ) |
| void AddBasemapDialog::setPreferredExtent | ( | const QRectF & | lonLatBounds | ) |
Limits a feature request to the ground the map is looking at.
Longitude and latitude. Only the WFS page uses it: a feature service holds a country and a model needs one catchment, so without this the request is bounded only by a feature count and returns an arbitrary few thousand from wherever the service starts counting.
| lonLatBounds | The map's current extent, or a null rectangle. |
| QString AddBasemapDialog::wfsStatus | ( | ) | const |
What the WFS page is currently saying. Empty until it has said something.