MapControl (C++ base class) Class
This element is not available using the selected API.
This element is not available using the selected API.
In this article
An abstract C++ base class for a MapControl that displays a View.
Members of this class should only be accessed from the GUI thread. Exceptions to this rule are noted on the documentation page for each individual member.
The Thread Access Verifier will enforce this rule when it is active.
More details about thread safety and the main thread of the application can be found in Threading model, GUI.
class MapControl : public IMapControl
A Carmenta Engine MapControl is used to integrate a map view into the UI of an application. Carmenta Engine provides several different MapControl classes, for different API:s and UI platforms; for a complete list see MapControl classes in Carmenta Engine.
This MapControl class is the abstract base class of all other C++ map control classes. It cannot be used by itself, an application needs to subclass it to integrate it with whatever UI framework it is using, or use one of the provided subclasses.
A subclass must override the getWindow method and return the WindowHandle of the window the control should draw into. The application or subclass must also "feed" the control with events/messages received from the UI system, typically by just passing all Windows messages to the control.
Examples of how this can be subclassed can be found in Sample application using C++ and Windows API (Win32) and Sample application using C++ and Microsoft Foundation Class Library.
If you subclass directly from MapControl (C++ base class) you should always implement a destructor and, as the first statement in the destructor, call waitForBackgroundThreadEvents. This will halt the destruction of the control until any pending events from background threads have been handled and ensures that the control does not receive any new events while it is being destroyed.
The default behavior of the MapControl (C++ base class) is to re-throw exceptions that occur when it calls into the Carmenta Engine kernel. You can override the onError method if you want to suppress this behavior, for example if you want to send the errors to an application log or display a custom error dialog.
MapControl (C++ base class)
MapControl (Qt OpenGLWidget)
MapControl (Qt Quick)
MapControl (X11)
Windows, Linux, Android
The MapControl (C++ base class) type has the following members.
Name | Description |
---|---|
MapControl | Initializes a new instance of the C++ MapControl (C++ base class) base class. |
Name | Description |
---|---|
IMapControl::guiDelayMinimum | The minimum amount of time in milliseconds that needs to pass between an update ending and another one starting. Inherited from IMapControl |
IMapControl::guiDelayPercentage | The percentage of the previous update time used to delay the next update. Inherited from IMapControl |
IMapControl::isConnected | Gets a value that tells whether the MapControl (C++ base class) implementation is connected to a View. Inherited from IMapControl |
Gets a value that tells whether the current platform supports touch input. | |
IMapControl::requestUpdatesInAdvance | Allows an extra paint event to be posted by the internal view update scheduler before the previous paint event was handled. Inherited from IMapControl |
IMapControl::tool | Gets or sets the ITool that is used by the MapControl (C++ base class) implementation. Inherited from IMapControl |
IMapControl::toolTimerInterval | The interval used by the MapControl (C++ base class) implementation to update tools. Inherited from IMapControl |
IMapControl::touchTool | Gets or sets the ITouchTool that is used by the MapControl (C++ base class) implementation. Inherited from IMapControl |
IMapControl::updateInterval | The update interval used by the MapControl implementation. Inherited from IMapControl |
IMapControl::updateMode | Gets or sets the update mode used by the MapControl (C++ base class) implementation. Inherited from IMapControl |
IMapControl::view | Gets or sets the View that is displayed by the MapControl implementation. Inherited from IMapControl |
Name | Description |
---|---|
Returns the monotonic time in microseconds. | |
getWindow | Gets the native window that the MapControl (C++ base class) is associated with. |
keyDown | Forwards a key down event to the MapControl (C++ base class). |
keyUp | Forwards a key up event to the MapControl (C++ base class). |
mouseDoubleClick | Forwards a mouse double click event to the MapControl (C++ base class). |
mouseDown | Forwards a mouse down event to the MapControl (C++ base class). |
mouseMove | Forwards a mouse move event to the MapControl (C++ base class). |
mouseUp | Forwards a mouse up event to the MapControl (C++ base class). |
mouseWheel | Forwards a mouse wheel event to the MapControl (C++ base class). |
onAreaChanged | Called when the connected View fires the View::areaChanged event. |
onBusy | Called when the control is busy drawing or loading data. |
onCustomDraw | Called when the connected View fires the View::customDraw event. |
onCustomDrawBackground | Called when the connected View fires the View::customDrawBackground event. |
onError | Called when an operation raises an exception. |
onHoverChanged | Called when the connected View fires the View::hoverChanged event. |
onIdle | Occurs after an update when all data has been loaded. |
onRequestToolTimerElapsed | May be called from a background thread to indicate a tool timer has elapsed. |
onRequestUpdate | May be called from a background thread to request an update. |
onSelectionChanged | Called when the connected View fires the View::selectionChanged event. |
onToolTimerElapsed | Call this to update tools that implement IToolTimerSink. |
onUpdated | Called when the connected View fires the View::updated event. |
onUpdating | Called when the connected View fires the View::updating event. |
paint | Forwards a paint event to the MapControl (C++ base class). |
releaseCapture | Virtual function called by the control to release a previously captured mouse. |
setCapture | Virtual function called by the control to capture the mouse. |
setCursor | Virtual function called by the control to set the mouse cursor. |
setCustomCursor | Replaces one of the predefined mouse cursors with a custom cursor. |
sizeChanged | Forwards a size changed event with the new width and height to the MapControl (C++ base class). |
touchBegin | Called before forwarding one or more touch events to the MapControl (C++ base class). |
touchDown | Forwards a touch down event to the MapControl (C++ base class). |
touchEnd | Called after forwarding one or more touch events to the MapControl (C++ base class). |
touchMove | Forwards a touch move event to the MapControl (C++ base class). |
touchUp | Forwards a touch up event to the MapControl (C++ base class). |
IMapControl::updateView | Overloaded. Updates the map presentation. Inherited from IMapControl |
waitForBackgroundThreadEvents | Disconnects the MapControl (C++ base class) from event handlers and waits until any pending events from background threads have been handled. |
windowsMessage | Forwards a Windows event to the MapControl (C++ base class). |
In this article
This element is not available using the selected API.
In this article
This element is not available using the selected API.
In this article