Hi & welcome,
using C++ code to this sort of thing would obviously be possible, but it's far from a good idea.
The Canvas system has been designed to support scripting via Nasal, which includes support for event handling.
I am familiar with both, the C++ side of the Canvas system, as well as the Nasal side.
The point being that it would take you roughly 150 lines of boilerplate code to do something like this in C++, whereas you can come up with a moving-map display in Nasal using very little code (at most 30), making it interactive would take another 20 lines.
We also have a dedicated mapping/charting API using a MVC design, which makes it rather straightforward to hook up arbitrary event handlers to a map to make it interactive.
In other words, using C++ to implement something like this without any obvious advantage is kinda controversial, unless you want to learn more about C++ coding and the Canvas system in simgear.
It would be kinda like using inline assembly language in a C++ file to write a "hello world" app, or like using C++ code to show an alert() box in firefox, instead of simply using JavaScript ...
For a basic "copy & paste" demo, take a look at this, which you can execute via the Nasal Console:
http://wiki.flightgear.org/Nasal_Consolehttp://wiki.flightgear.org/Canvas_Snipp ... e_tile_mapCanvas Event Handling is introduced here:
http://wiki.flightgear.org/Canvas_-_Event_HandlingThe dedicated mapping/charting API using MVC is introduced here:
http://wiki.flightgear.org/Canvas_MapStructureIf you'd still like to learn more about the C++ side of the Canvas system, you might want to take a look at the following wiki articles:
http://wiki.flightgear.org/Canvas_Developmenthttp://wiki.flightgear.org/Canvas_Sandbox