IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Template SMARTY Google Maps


Sujet :

Langage PHP

Mode arborescent

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre habitué
    Inscrit en
    Juillet 2007
    Messages
    8
    Détails du profil
    Informations forums :
    Inscription : Juillet 2007
    Messages : 8
    Par défaut Template SMARTY Google Maps
    Bonjour,
    J'utilise actuellement le code suivant :

    INTEGRATING GOOGLE MAPS WITH SMARTY TEMPLATES
    ---------------------------------------------

    Integrating with Smarty is as simple as assigning the necessary vars to the
    template and then displaying them. Note: This example does not cover how to
    setup Smarty, please use the Smarty documentation.

    Example:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    <?php
        require('Smarty.class.php');
        require('GoogleMapAPI.class.php');
     
        $smarty = new Smarty();
        $map = new GoogleMapAPI();
     
        // setup database for geocode caching
        $map->setDSN('mysql://USER:PASS@localhost/GEOCODES');
        // enter YOUR Google Map Key
        $map->setAPIKey('YOURGOOGLEMAPKEY');
     
        // create some map markers
        $map->addMarkerByAddress('621 N 48th St # 6 Lincoln NE 68502','PJ Pizza','<b>PJ Pizza</b>');
        $map->addMarkerByAddress('826 P St Lincoln NE 68502','Old Chicago','<b>Old Chicago</b>');
        $map->addMarkerByAddress('3457 Holdrege St Lincoln NE 68502',"Valentino's","<b>Valentino's</b>");
     
        // assign Smarty variables;
     
        $smarty->assign('google_map_header',$map->getHeaderJS());
        $smarty->assign('google_map_js',$map->getMapJS());
        $smarty->assign('google_map_sidebar',$map->getSidebar());
        $smarty->assign('google_map',$map->getMap());
     
        // display the template
        $smarty->display('index.tpl');
        ?>
    contents of index.tpl:
    ----------------------

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
        <head>
        {$google_map_header}
        {$google_map_js}
        <!-- necessary for google maps polyline drawing in IE -->
        <style type="text/css">
          v\:* {ldelim}
            behavior:url(#default#VML);
         {rdelim} 
        </style>
        </head>
        <body onload="onLoad()">
        <table>
          <tr>
            <td>{$google_map}</td>
            <td>{$google_map_sidebar}</td>
          </tr>
        </table>
        </body>
        </html>
    sauf le problème est le suivant: la carte google maps est figée. Elle a un fond gris et ne bouge pas (piece jointe).
    Quelqu'un a une idée ?
    Merci bcp
    Images attachées Images attachées  

Discussions similaires

  1. [Google Maps] IE6 refuse d'ouvrir ma page
    Par Shyboy dans le forum APIs Google
    Réponses: 5
    Dernier message: 03/10/2006, 08h47
  2. [SimpleXML] Google Maps, Problème d'encoding dans une boucle
    Par yahn dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 23/09/2006, 19h40
  3. [google maps] probleme avec ie
    Par kowabounga dans le forum Général Python
    Réponses: 1
    Dernier message: 14/09/2006, 15h20
  4. Utilisation d'un template avec une map
    Par bonano dans le forum Langage
    Réponses: 6
    Dernier message: 09/08/2006, 21h26
  5. 4D & Google Maps
    Par gbardy dans le forum 4D
    Réponses: 1
    Dernier message: 30/06/2006, 07h32

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo