Page 1 of 1

GoogleMap API and getting the value from my address content block

Posted: Sun Dec 02, 2007 1:09 pm
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>');