LuciadCPillar 2023.1.04
|
An MGRS text provider that notifies callbacks whenever the currently visible zone/square of a given Map changes. More...
#include <luciad/layers/grids/mgrs/MgrsGridTextProvider.h>
Classes | |
class | ICallback |
This callback can be used to be notified whenever the currently visible zone/square changes, by giving you its formatted location text. More... | |
Public Member Functions | |
MgrsGridTextProvider (const std::shared_ptr< Map > &map) | |
Constructs a new MgrsGridTextProvider for the given Map. More... | |
~MgrsGridTextProvider () | |
void | addCallback (std::shared_ptr< ICallback > callback) |
Adds the given callback to the MgrsGridTextProvider. More... | |
void | removeCallback (const std::shared_ptr< ICallback > &callback) |
Removes the given callback from the MgrsGridTextProvider. More... | |
An MGRS text provider that notifies callbacks whenever the currently visible zone/square of a given Map changes.
Typically used to update a UI element in combination with an MGRS grid on the map, although this is not mandatory.
The text is formatted with a maximum precision of 100km squares.
MgrsGridTextProvider must be instantiated on the UI thread, and its registered ICallbacks are only called on the UI thread.
See the Working with MGRS article for more information.
|
explicit |
Constructs a new MgrsGridTextProvider for the given Map.
MgrsGridTextProvider must be instantiated on the UI thread.
map | the Map. Cannot be nullptr . |
NullArgumentException | when the Map is nullptr . |
luciad::MgrsGridTextProvider::~MgrsGridTextProvider | ( | ) |
void luciad::MgrsGridTextProvider::addCallback | ( | std::shared_ptr< ICallback > | callback | ) |
Adds the given callback to the MgrsGridTextProvider.
After calling this method, the MgrsGridTextProvider
starts calling the given callback instance.
callback | a callback instance. Cannot be nullptr . |
NullArgumentException | when the callback is nullptr . |
void luciad::MgrsGridTextProvider::removeCallback | ( | const std::shared_ptr< ICallback > & | callback | ) |
Removes the given callback from the MgrsGridTextProvider.
After calling this method, the MgrsGridTextProvider
stops calling the given callback instance.
callback | a callback instance. Cannot be nullptr . |
NullArgumentException | when the callback is nullptr . |