What’s this plugin for?
To show a Google Map with your post or page, simply by adding the address into the custom field ‘address’.
For example: Adding “Diepenveenstraat 33, 5043 JL Tilburg, Nederland” to the custom field ‘address’ results in the map at the bottom of the post about the sewing school Avainti.
How to install
- Current stable release is version 0.2
- Upload `rrwd-single-google-map.php` to the `/wp-content/plugins/` directory
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Add ‘<?php rrwd_include_single_google_map(“style”) ?>‘ to the template files single.php and page.php within the loop. e.g. <?php rrwd_include_single_google_map(“width: 500px; height: 400px;” ) ?>
Or leave empty if you want define the style of #map_canvas in the stylesheet,
<?php rrwd_include_google_map(); ?>
in style.php e.g: #map_canvas { width: 500px; height: 400px; padding: 20px 0 20px 0; margin: 0; } - Please report bugs or mail me suggestions at rian@rrwd.nl
How to use
First of all, install the plugin and add the rrwd_include_google_map function call to the single.php and/or post.php templates. Dont forget to add style code to the function call or add the CSS to style.css.
Then in Admin add or edit the post or page in which you want the map to appear and add in custom fields the name address and fill out the address for the Google Map.
This is actually quite flexible.
You can be very detailed like: Saal van Zwanenbergweg 11, 5026 RM, Tilburg, Nederland
Or less detailed like: 5026 RM, Nederland
Or more global like: New York, NY
Or even: New Zeeland
The more details you give, the more accurate the maker will be placed.
How to get this plugin
Download it from WordPress.org
If you like the plugin, please vote for it, or buy me a beer.
FAQ
Question: I don’t see the map
Answer: Check if you have the style filled out in the function call, like:
<?php rrwd_include_single_google_map(“width: 500px; height: 400px; “) ?>
Or check if you have defined the style into your stylesheet like:
#map_canvas {
width: 500px;
height: 400px;
margin: 10px 0 10px 0;
}
No style, no map.
Question: Can I place the map wherever I want??
Answer: You have put the map inside the loop of single.php and/or page.php, and you have to change “style” in some kind of style definition, like:
<?php rrwd_include_single_google_map(“width: 400px; height: 400px;”) ?>
for more explanation about the loop see: http://codex.wordpress.org/The_Loop and http://codex.wordpress.org/The_Loop_in_Action
Question: I get a Fatal error: Cannot instantiate non-existent class: simplexmlelement
Answer: If you get this Fatal error: Cannot instantiate non-existent class: simplexmlelement in /…/wp-content/plugins/rrwd-single-google-map/rrwd-single-google-map.php on line 241
Screenshots
Current Version
Version 0.1, first release, September 8, 2010
Support
If you have questions or suggestions please contact me via e-mail or add a comment in the comment section below.
For Dutch readers: the development of this plugin is described in the post Automatisch Google Maps kaartje bij een WordPress post


Pingback: Automatisch Google Maps kaartje bij een WordPress post « RRWD studie webtoepassingen
Cool plugin! But you don´t show the adress in the google map. Neither when you click on the balloon. Maybe the balloon can be already presented by pageload?
Hi Blukzooi,
Thanks for the compliment and the useful suggestions
I will consider adding them to the next update as extra options.
Cheers, Rian
I get this error:
Fatal error: Call to undefined function rrwd_include_google_map() in /home/bizadmin/public_html/wp-content/themes/Bizzcaster/single.php on line 54
I have the plugin installed and activated. Somehow it thinks the function doesn’t exist.
Any help is appreciated.
Maybe it works if you try
rrwd_include_single_google_map in stead of
rrwd_include_google_map
it works! On all browsers!
A few small suggestions:
I would be great if we can custom fill the balloon with some text and link
it would also be very helpful if we can set the zoomlevel of the map
for the zoom, the link and text it would be great if we can add another custom-field rrwd-balloon and rrwd-zoom
and it would be helpful as well if the custom field : address could be changed into rrwd-address
address is just to generic, lots of people might already have a custom field floating around with that name
Gideon
Hi Gideon,
Thanks for this very good suggestions.
If i have time i will look into them, soon i hope
Kind regards,
Rian