Smarty

How to implement google map in smarty?

Hi friends ,

the following script will discuss for how to implement google map in smarty application.

1) Sign up for API key of googlemap

http://code.google.com/apis/maps/signup.html

2) Create a google map class.

Googlemap implementation in smarty - Anil kumar panigrahi
Googlemap implementation in smarty - Anil Labs

 

3) Create a tpl file, and add below code :

{php}

$key="Your API Key";
$gm = & new EasyGoogleMap($key);
$gm->SetMarkerIconStyle('STAR');
$gm->SetMapZoom(10);

$city ="baruva";
$country = "india";
$gm->SetAddress($city,$country);
$gm->SetInfoWindowText("This is address .");

$gm->SetInfoWindowText("Anil Labs - http://www.anillabs.com");
echo $gm->GmapsKey();
echo $gm->MapHolder();
echo $gm->InitJs();
echo $gm->GetSideClick();
echo $gm->UnloadMap();

{/php}

6 thoughts on “How to implement google map in smarty?”

  1. Hi,
    I know the Google Translate API and done a small application.
    I need smarty plugin for Google Translate API to change the content of my application into the selected language .
    As like there is plug in for Google Map, Google Analytic ; like that I need Google Translate in smarty.
    Can u please help me

  2. hi dear, i’m no used for google map in smarty because
    Fatal error: Class ‘EasyGoogleMap’ not found in … , help me.

  3. Hi,I am getting error “Fatal error: Uncaught exception ‘SmartyException’ with message ‘{php} is deprecated, set allow_php_tag = true to enable’ ”

    Please help me how to solve this.Thanks!

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.