Recently, I’ve been working with the Google Maps API in order to plot locations that are stored as custom post type meta data in the WordPress database.
The general functionality is as follows:
- For each of the locations stored in the database
- Generate a pin for the location
- In addition to creating a pin, create an information window that shows the pin’s location
The information windows that sit above the flags are also called infowindow
within the context of the API.
The Google Maps API documentation is pretty good in covering stuff like this, but I did run into a couple of gotchas when working with it, so I thought I’d document them here just in case anyone runs into the same problem.