I confirmed the snippet I provided does not work for Map View, unfortunately.
We cannot provide such in-depth customization help, per our Scope of Support / Terms. I’ve provided the code snippet as a starting point.
If there’s a new or modified code snippet you’d like me to put some eyes on, please update this ticket.
Thank you very much for your understanding.
If you need some coding help, you may want to ask your developer or reference our documentation and list of known customizers.