I have solved this problem. Just in case someone else run into this issue. Here is the fix.
The problem is caused by a WordPress plugin Wordfence Security installed at the parent or root domain level, it affects the subdomains. I had to disable the plugin at the parent domain level, after that, i successfully added the map code at the subdomain.