How does platformIO generate. map files, just like compiling them in KEIL can generate. map files. Do you want to change anything in the extra_script file?
.map files is done by the compiler, GCC. You configure PlatformIO to tell GCC to do that via
build_flags. See Generate a .map file - #8 by Krishna_Chaitanya