If you want to add a dynamic Google map to your CB user profiles that automatically generates coordinates based upon each user’s address, don’t worry. It is very easy and can be done with FREE extensions.
Just follow these steps (note: This is for a Joomla 1.5.X site, NOT a 1.0.X site):
1. Download and install the Google map Joomla plugin from Mike Reumer (
tech.reumer.net). You can download the file here:
joomlacode.org/gf/project/mambot_google1/frs/. Install it using the normal Joomla component installer. Be sure to enable (publish) the plugin. You can define many elements of the plugin’s performance with the configuration parameters or override them when you insert the plugin tag (in step 4). Don't forget to get and insert your Google map API key!
2. Hack your Joomla installation’s index.php file to allow the plugin to work within extensions as described by Mike Reumer here:
tech.reumer.net/google-maps/documentatio...ct-joomla-1.5.x.html
To perform the hack, add these lines at line 84 after “$mainframe->render();:”:
JPluginHelper::importPlugin('content');
$tmp_row->text = JResponse::getBody();
$tmp_params = new JParameter(null);
$mainframe->triggerEvent('onMap', array( &$tmp_row, &$tmp_params ), true );
JResponse::«»setBody($tmp_row->text);
Your index.php file is probably (hopefully) locked-down, for security reasons. So you may need to ask your hosting provider to temporarily adjust permissions, while you make the hack.
3. In the Community Builder Field Manager, create new ‘Text Field’ type user fields for ‘street address’, ‘city’, ‘state’, and ‘zip code’. As with any other CB field, you will have to decide if you want these fields to be required fields, whether they should display on the user profile, and if they should show on the registration form. (You probably want to say ‘yes’ to all 3.) Write down the database field names for each of these. (Example: ‘cb_streetaddress’, ‘cb_city’, ‘cb_state’, ‘cb_zip’.)
4. Create another new field of the type=’Fields delimiter’. Name it ‘Google Map’. In the description, enter this tag:
{mosmap address='[cb_streetaddress], [cb_city], [cb_state] [cb_zip]’}
Within the square brackets, use the correct database field names that you wrote down in step 3.
Set ‘Show on Profile’ to ‘Yes: on 1 Line’.
Set ‘Show at Registration?’ to ‘No’.
5. To add additional functionality, add the usual plugin tag details as described at
tech.reumer.net For example, to add a driving directions popup window, include “dir=’1’” within the curly brackets.
6. For an example of this process in action, please see
www.locallyowneddayton.com/member-profil...le/littleriobio.html
The plugin tag used in this example is {mosmap address='[cb_busstreet1], [cb_city], [cb_state] [cb_zip]'|text='[name]'|zoom='11'|dir='1'}.
Post edited by: JComeskey, at: 2009/03/09 22:20
Post edited by: JComeskey, at: 2009/03/09 22:22
Post edited by: JComeskey, at: 2009/03/09 22:25