Bingo! this is it for sure. Case sensitive. JavaScript is "loose" and will just create OnLoadMap along side with the real, existing onLoadMap.
Code:
if (onMapLoaded != null)
map.OnLoadMap = onMapLoaded;
should be:
Code:
if (onMapLoaded != null)
map.onLoadMap = onMapLoaded;
Debugger in visual studio shows:
map.OnLoadMap {...}
map.onLoadMap undefined