GoogleMap API and getting the value from my address content block

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
haapati
Forum Members
Forum Members
Posts: 20
Joined: Sun Sep 10, 2006 4:14 pm

GoogleMap API and getting the value from my address content block

Post by haapati »

I have a GoogleMapApi class what i included in a site template.

The code look like this:

Code: Select all

{php}
require('GoogleMapAPI.class.php');
global $gCms;
    $map = new GoogleMapAPI('map');
    // enter YOUR Google Map Key
    $map->setAPIKey('MY-CODE');
    
    // create some map markers
$address = $gCms->variables['address'];
    $map->addMarkerByAddress('Someaddress 12 HELSINKI FI','Topic','<b>Some html</b>');
{/php}
In header tag:

Code: Select all

{php} $map->printHeaderJS(); $map->printMapJS(); {/php}
And in the body tag (where the map will show):

Code: Select all

{php} $map->printMap(); {/php}
Then i have a content block called address. How I get the address block value to my php code?

Something like this:

Code: Select all

$map->addMarkerByAddress('".$address." FI','Topic','<b>Some html</b>');
Last edited by haapati on Tue Dec 04, 2007 2:07 pm, edited 1 time in total.
Post Reply

Return to “CMSMS Core”