Google Map Shortcode Version 1.1

The new version of Google Map Shortcode is ready, some bugs were fixed and new features included.

The first release was based on “address”, then to include a point on the maps new instance of google geocoder was need, but google limits the number of this kind of request, read more here.

In this version new custom field “google-map-sc-latlng” was included to save the (Latitude,Longitude) for each address entered:

Now, you can include points on your maps using one of this custom fields considering this:

  • If you use “google-map-sc-address”, the first time that you display a point, the “google-map-sc-latlng” value will be generated automatically.
  • In order to use “google-map-sc-latlng” you need to include the latitude and longitude separated by comma.
  • If you update “google-map-sc-address” you must delete the “google-map-sc-latlng” cause this point will be located based on the previews address.
  • You can use “google-map-sc-latlng” only.
  • If you are planning to display large number of point is better to use “google-map-sc-latlng” or generate them one by one to avoid large number of address requests at the same time. You can generate latitude and longitude using for instance:
  • You can attache more than one point per post/page but based on address or (latitude,longitude) see the example bellow.
  • If you are displaying all the points under specific category, just the first costum field of each post will be used.

The shortcode options can be found in the first release.


This example shows the points attached to the posts under the category 42 cat=”42″ and display the links to the points at the bottom of the map, external_links=”true”.

In this example the map displays some points on South Florida:

and the custom fields looks like this:

Using the post “id” id = “335”.

Using specific address option in the sortcode (not the custom field) address=”3501 S.W. 130th Ave., Davie 33330″,width=”250″, height=”250″ and zoom=”8″.


The Info Window is showed when you are displaying post on your maps for example the posts under a category or when you use the post ID, just in these cases make sense to display the the title, thumbnail and excerpt of your posts.

You can change the html and the css of the Info Windows to cutomize it.

The shortcode name is google-map-sc



Add your suggestions, support the plugin.

91 thoughts on “Google Map Shortcode Version 1.1”

  1. I’ve just found a bug. When displaying map locations with external links, the link is generated using $post->guid.

    The codex says that guid can’t be relied on to give you a working link and that is exactly what I found. I replaced $post->guid with get_permalink() and it now works fine, with the bonus that the link is the full permalink.

    Here is the new line of code (from google-map-shortcode/google-map-shortcode.php):

    $the_link = get_permalink( $post->ID );

    I hope someone finds that useful.

  2. Hi all,
    Is it possible to have a Local Search Control inside the map? and like this, we’ll have the possibility of searching inside the map and to have better precision.

  3. Hi Alain,

    I’ve been a big fan of the plug-in for a while now; good job!

    I was just wondering if you might have any suggestions on the following? I’d like to show a map on pages, but have this be clickable to show a larger version in a modal window/lightbox of some kind. So far I’ve had limited success implementing this; I managed to get the enlarged map to display using the jQuery Shadowbox script, but not all the map tiles seem to load. Any ideas on how this could be achieved successfully?

  4. Hi,

    This looks great – but doesn’t seem to work with WordPress 3.0. Has anyone else had this problem, or do you have any idea why this might be happening?


      1. I am suddenly with Javascript errors, and had to disable the plug-in until i fix this. I am in process of figuring this out and will let you know…

  5. Hello,
    Unfortunately my map isn’t displayed on the site but on my local machine it works perfectly. I have no message about wrong API key.
    I use a map displayed posts from a certain category,

    [google-map-sc width="600" height="600" zoom="10" external_links="true" cat=9]

    I tried to modify the get_bloginfo(‘url’) to get_bloginfo(‘wp_url’) without success.

    Any Idea ?

Leave a Reply

Your email address will not be published. Required fields are marked *