Adding a google.maps.Map object to the DOM messes up web page's fonts

24 views
Skip to first unread message

Tom Tanner

unread,
Nov 26, 2017, 7:47:23 PM11/26/17
to Google Maps JavaScript API v3
I currently have an `index.html` set up something like this:

<head>
  ... Load local CSS files ...
</head>
<body>
 
<div class="product"></div>
 
<script src="mapscript.js"></script>
</body>

In my JS, I have this:
var mapControl= new MapControl(mapControlForm, mapDiv);

`mapDiv` is of course defined as `document.getElementsByClassName("product")[0]`. When I load `index.html` in my browser, I see the fonts I set for a split second before they change. When I go to other pages on my site, my fonts work fine. When I remove the line of code defining `mapControl`, the fonts work, but the map does not load. 

How do I make sure my fonts don't get messed up when my browser loads the JS file that puts a GMap on the DOM?

Michael Geary

unread,
Nov 27, 2017, 1:59:08 AM11/27/17
to google-map...@googlegroups.com
I don't know if anyone can advise you without more information. What is "mapscript.js", and what is the "MapControl" class? These are not part of the Google Maps API.

There is a MapControl in the Bing Maps API; is that what you're referring to? Or is this some wrapper around the Google Maps API?

The Google Maps API code is pretty careful to not interfere with other styles on your page. But that doesn't help if this "mapscript.js" messes up the styles.

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-maps-js-api-v3+unsubscri...@googlegroups.com.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
Visit this group at https://groups.google.com/group/google-maps-js-api-v3.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages