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

Windows Discussion :

API Google maps


Sujet :

Windows

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : France, Rhône (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2007
    Messages : 15
    Points : 15
    Points
    15
    Par défaut API Google maps
    Hi,

    J'ai un petit souci dans l'emploi de l'API Google Maps .
    Je n'ai aucune erreur, la page se charge mais aucun Flag n'est affiché :


    http://www.mercuzot.com/googlemap/carte.html

    Voici mon code :

    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
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    <!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">
      <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <title>Utilisation de XML</title>
        <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA3eQvTSY8_qbMR4pPuz3HrBS27SDEE4cB3Smap6s0jv7IbA-VihR8Kz9xX44f5c2MwidJ0JXpW8fmrg"
          type="text/javascript"></script>
        <script type="text/javascript">
        function load() {
          if (GBrowserIsCompatible()) {
            var map = new GMap2(document.getElementById("map"));
            map.addControl(new GSmallMapControl());
            map.addControl(new GMapTypeControl());
            map.setCenter(new GLatLng(45.55,6.10),9,G_HYBRID_MAP);
    
        function creerMarker(point, onglet1, onglet2) {
          var marker = new GMarker(point);
          var infoTabs = [
            new GInfoWindowTab("Infos", onglet1),
            new GInfoWindowTab("Détails", onglet2)
            ];
          GEvent.addListener(marker, "click", function() {
            marker.openInfoWindowTabsHtml(infoTabs);
            });
          return marker;
          }
    		var adress = null;
            GDownloadUrl("stations.xml", function(data) {
              var xml = GXml.parse(data);
              var markers = xml.documentElement.getElementsByTagName("marker");
              for (var i = 0; i < markers.length; i++) {
    					adress = markers[i].getAttribute("value");
    					geocoder = new GClientGeocoder();
    			  		geocoder.getLatLng(adress,function(point) {
    					if (point)
    						{
    						  var flagdot = new GMarker(point);
    						  map.addOverlay(flagdot);
    						  callback(flagdot);
    						}
    					else 
    					{
    						callback (null);
    					}
    					}
    				);
              }
            });
          }
        }
        </script>
      </head>
      <body onload="load()" onunload="GUnload()">
        <div id="map" style="width: 1003px; height: 635px;"></div>
      </body>
    </html>

  2. #2
    Membre averti
    Profil pro
    Inscrit en
    Septembre 2003
    Messages
    336
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2003
    Messages : 336
    Points : 341
    Points
    341
    Par défaut
    Salut,

    le fichier stations.xml contient bien les infos auxquelles tu t'attends ?
    Les flags se trouvent bien en Rhône-Alpes ?

    Karl.

  3. #3
    Membre à l'essai
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : France, Rhône (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2007
    Messages : 15
    Points : 15
    Points
    15
    Par défaut Oui
    Salut Karl

    Oui, le fichier stations.xml contient bien la liste de mes valeur :

    <?xml version="1.0" encoding="utf-8" ?>
    <markers>
    <marker value="Alpe d Huez"/>
    <marker value="Alpe-du-Grand-Serre"/>
    <marker value="Areches-Beaufort"/>
    <marker value="Auris en Oisans"/>
    </markers>

    Voilà.

  4. #4
    Membre à l'essai
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : France, Rhône (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2007
    Messages : 15
    Points : 15
    Points
    15
    Par défaut Merci Karl
    J'ai trouvé e problème indirectement grâce à toi Karl :
    Il faut préciser le pays !!!

    <?xml version="1.0" encoding="utf-8" ?>
    <markers>
    <marker value="Alpe d Huez,france"/>
    <marker value="Alpe-du-Grand-Serre,france"/>
    <marker value="Areches-Beaufort,france"/>


    Merci encore
    Bye

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Septembre 2003
    Messages
    336
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2003
    Messages : 336
    Points : 341
    Points
    341
    Par défaut
    Impec, n'oublie pas le tag résolu.
    Merci,
    Karl.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. API Google Map et markers en XML
    Par greichka dans le forum APIs
    Réponses: 8
    Dernier message: 21/05/2008, 12h05
  2. API Google Map
    Par jpower dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 2
    Dernier message: 19/11/2007, 22h43
  3. [MySQL] Utilisation de l'API Google Maps
    Par nagadef dans le forum PHP & Base de données
    Réponses: 2
    Dernier message: 11/07/2007, 21h37
  4. [Google Maps] IE6 refuse d'ouvrir ma page
    Par Shyboy dans le forum APIs Google
    Réponses: 5
    Dernier message: 03/10/2006, 08h47
  5. [Google Maps] Intégrer de nouvelles icônes
    Par Shyboy dans le forum APIs Google
    Réponses: 7
    Dernier message: 01/10/2006, 00h30

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