Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement datarefs to report map coordinates, zoom and range #202

Merged
merged 2 commits into from
May 26, 2024

Conversation

mjh65
Copy link
Collaborator

@mjh65 mjh65 commented Mar 15, 2024

This PR implements the enhancement requested in #198.

The first commit refactors some existing code to put a small wrapper class around the X-Plane API calls. Despite this, the callbacks are still a little more 'C' than 'C++' (reinterpret casts are used), and perhaps could be improved by some more complex (and less readable?) template code.

The second commit adds 4 new datarefs to allow other X-Plane components to obtain the Avitab map coordinates (map centre), the zoom level, and an approximation of the distance from top to bottom of the visible map.

@mjh65 mjh65 linked an issue Mar 15, 2024 that may be closed by this pull request
@mjh65 mjh65 requested a review from fpw March 15, 2024 14:55
mjh65 added 2 commits May 5, 2024 11:41
AppFunctions API is extended to allow MapApp to report changed values on
each update. This is a no-op in standalone environments. In the XPlane
environment the values are used for the new datarefs when requested.
@fpw fpw merged commit 6b48f9f into fpw:master May 26, 2024
@mjh65 mjh65 deleted the pr_issue198_datarefs branch May 28, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement r/o datarefs for map lat / long
2 participants