When using your'e maps with javascript, you can solve this with a javascript listener. Paste this snippet into the <script> tags somewhere before the output of the html MAP file in the source code (for example, in the <head> section, like me):
var head = document.getElementsByTagName('head')[0]; var insertBefore = head.insertBefore; head.insertBefore = function (newElement, referenceElement){ if(newElement.href && newElement.href.indexOf('//fonts.googleapis.com/css?family=Roboto') > -1) { console.info('Prevented Roboto font from loading!'); return; } // intercept style elements for modern browsers if(newElement.tagName.toLowerCase() === 'style' && newElement.innerHTML.indexOf('.gm-style') > -1){ console.info('Prevented .gm-style from loading!'); return; } insertBefore.call(head, newElement, referenceElement); };
It will not βbiteβ all dynamically loaded calls into the header, since the Google methods used in different view updates are different. This applies only to the head.insertBefore method.
/ Only in modern browsers, like 2017, not ie8 (but with mods it will be). It works for our cases , but I do not know if this method supports other material.
source share