XPLMRegisterMapCreationHook
XPLM_API void XPLMRegisterMapCreationHook(
XPLMMapCreatedCallback_f callback,
void * refcon);
Registers your callback to receive a notification each time a new map is constructed in X-Plane. This callback is the best time to add your custom map layer using XPLMCreateMapLayer().
Note that you will not be notified about any maps that already exist—you can use XPLMMapExists() to check for maps that were created previously.