I’ve been working on modifying the Thesography plugin to include the Google Maps API. So far I’ve had success doing so.
I’m looking to take this one step further and have 1 large Google Map that would display all of my images on 1 map. Then when you hover over a marker, an image thumbnail comes up with the post title. I know the requirements for the Google Maps API to make this possible, but am struggling with trying to get the data out of MySQL.
I’m looking for some coding help that’ll help me extract the following information from a post, IF it has “latlng_readable” in the post_metadata. For the Google Map, I’d like to be able to grab the post title, the post image URL and the “latlng_readable” meta coordinates for the marker pin.
This way I can put this into the Google Maps API so that in the popup box for my marker is a little thumbnail of the image, as well as the title of that image.
Trying using
WP_Query()
using themeta_query
arguments.Something like this:
Now,
$geotagged_posts
is a query object, that should include all Posts that have thelatlng_readable
meta field. You can extract the$post
data from this object the same as any other query object.