MapControl classes in Carmenta Engine
A Carmenta Engine MapControl is a class used to integrate a map View into the GUI of an application. The MapControl will typically replace the drawable of the view with its own drawable connected to the control's window on the screen.
You can write an application without using a MapControl, creating your own WindowDrawable or ExternalDrawable to display the map view in a window on screen. But using a MapControl for this has several advantages:
It's much easier to implement. Carmenta Engine provides several different, ready-to-use, MapControl classes for different languages and different GUI frameworks.
The MapControl classes provide sophisticated scheduling mechanisms, the applications usually don't have to worry about how often to update the map. Even with multiple controls in the same application, the scheduling will make sure all controls get updated when needed, and still leave enough time on the GUI thread to handle user input. See Efficient Integration of Map Controls in GUI Applications for more details.
MapControls provide a standard way to handle user input, like mouse, keyboard and touch events. Various tools, like the built-in StandardTool or custom tools implementing the ITool interface, let the user interact with the map, regardless of which MapControl class is used.
The table below lists all the MapControl implementations provided by Carmenta Engine. If needed, these can be sub-classed to provide some special feature while still using all the base functionality of the control. Note that the links in the table are only active for the currently selected language; select another language to go to the other implementations.
Class name | Language | GUI framework | Platforms | Defined in module |
---|---|---|---|---|
MapControl | C++ | None, abstract base class | Windows, Linux, Android | CECore |
QtMapControl | C++ | Qt Widgets | Windows, Linux, Android | Header-only |
QtQuickMapControl | C++ | Qt Quick | Windows, Linux, Android | Header-only |
X11MapControl | C++ | X11 | Linux | Header-only |
C# | Windows Forms | Windows | CECore, Carmenta.Engine.ver.Forms.nupkg | |
C# | WPF (Windows Presentation Foundation) | Windows | CEControls, Carmenta.Engine.ver.Controls.nupkg | |
C# | .NET Maui | Windows, Android | Carmenta.Engine.ver.Maui.nupkg | |
C# | .NET 6 | Android | Carmenta.Engine.ver.Android.nupkg | |
MapControl | Java | Java AWT | Windows, Linux | CEAwt |
MapControl | Java | Java Android | Android | CEAndroid |