Title: Google Maps API
Last modified: August 21, 2016

---

# Google Maps API

 *  Resolved [wowzimmer](https://wordpress.org/support/users/wowzimmer/)
 * (@wowzimmer)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/google-maps-api-4/)
 * I’ve been trying to get Google Maps to load in individual posts using the Google
   API but the map ends up broken every time!
 * I know the Javascript is sound – when I load it on a plain HTML page it works
   perfectly.
 * I understand that loading Javascript can be a little more complicated in WordPress.
   I have finally learnt how to register and enqueue the Google Maps API javascript
   libraries and that is sitting nicely in this themes functions.php file.
 * I have created a couple of .js files for two maps and referenced them in my themes
   header.
 * In the WordPress posts I have simply used the CSS classes for the two maps to
   call the javascript. But every time, the map just doesn’t work properly. The 
   infoboxes don’t open properly, the street view pegman disappears and a multi-
   coloured box appears in the middle of the map.
 * I’ve tried loading the javascript file directly in the post and even pasting 
   all the javascript directly into the post. I still get the same problem.
 * In terms of trouble shooting I’ve already switched my theme back to twentytwelve
   and twentyeleven but it makes no difference.
 * Does anybody know what I might be missing here? It’s caused me a significant 
   amount of grief so far and I am no further forward!!!!
 * Many thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [wowzimmer](https://wordpress.org/support/users/wowzimmer/)
 * (@wowzimmer)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/google-maps-api-4/#post-3694872)
 * #map img{max-width: inherit;}
 * Got the answer from StackOverflow. Was convinced that I had messed up loading
   the Javascript into WordPress as it seems like such a complicated task compared
   to basic HTML. I hadn’t even considered CSS but am pleased to report that this
   did the trick!

Viewing 1 replies (of 1 total)

The topic ‘Google Maps API’ is closed to new replies.

## Tags

 * [enqueue](https://wordpress.org/support/topic-tag/enqueue/)
 * [google maps api](https://wordpress.org/support/topic-tag/google-maps-api/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [wowzimmer](https://wordpress.org/support/users/wowzimmer/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/google-maps-api-4/#post-3694872)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
