bonjour tout le monde,
je voudrais actualiser ma google map sans passer par la balise html
meta mais avec ajax,
j'ai consulte beaucoup de sujet sur ce forum et sur google en general,
je sais que je dois utiliser un          setInterval(loadMarkers(map),
30000);

avec loadmarkers une fonction qui englobe GXmlHttp, mais je ne sais
pas comment l'inserer dans mon code que je vous passe :
-----------------------------------------------------------------------------------------
var agenceBlue = new GIcon();
    agenceBlue.image = 'http://labs.google.com/ridefinder/images/
mm_20_blue.png';
    agenceBlue.shadow = 'http://labs.google.com/ridefinder/images/
mm_20_shadow.png';
    agenceBlue.iconSize = new GSize(14, 22);
    agenceBlue.shadowSize = new GSize(22, 20);
    agenceBlue.iconAnchor = new GPoint(8, 22);
    agenceBlue.infoWindowAnchor = new GPoint(5, 1);

    var agenceRed = new GIcon();
    agenceRed.image = 'http://labs.google.com/ridefinder/images/
mm_20_red.png';
    agenceRed.shadow = 'http://labs.google.com/ridefinder/images/
mm_20_shadow.png';
    agenceRed.iconSize = new GSize(14, 22);
    agenceRed.shadowSize = new GSize(22, 20);
    agenceRed.iconAnchor = new GPoint(8, 22);
    agenceRed.infoWindowAnchor = new GPoint(5, 1);

    var agenceOrange = new GIcon();
    agenceOrange.image = 'http://labs.google.com/ridefinder/images/
mm_20_orange.png';
    agenceOrange.shadow = 'http://labs.google.com/ridefinder/images/
mm_20_shadow.png';
    agenceOrange.iconSize = new GSize(14, 22);
    agenceOrange.shadowSize = new GSize(22, 20);
    agenceOrange.iconAnchor = new GPoint(8, 22);
    agenceOrange.infoWindowAnchor = new GPoint(5, 1);

        var customIcons = [];

    customIcons["agence valide"] = agenceBlue;
    customIcons["agence non valide"] = agenceRed;
    customIcons["agence moyenne"] = agenceOrange;

var map;
    function load() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.addControl(new GScaleControl());
        map.setCenter(new GLatLng(33.759666,9.470214),6);


        GDownloadUrl("data1.xml", function(data) {
          var xml = GXml.parse(data);
          var entites =
xml.documentElement.getElementsByTagName("entite");
          for (var i = 0; i < entites.length; i++) {
            var nom = entites[i].getAttribute("nom");
            var adresse = entites[i].getAttribute("adresse");
            var type = entites[i].getAttribute("type");
            var point = new
GLatLng(parseFloat(entites[i].getAttribute("lat")),
 
parseFloat(entites[i].getAttribute("lng")));
            var entite = createEntite(point, nom, adresse, type);
            map.addOverlay(entite);
          }
        });

      }
    }

    function createEntite(point, nom, adresse, type) {
      var entite = new GMarker(point, customIcons[type]);
      var html = "<b>" + nom + "</b> <br/>" + adresse;
      GEvent.addListener(entite, 'click', function() {
        entite.openInfoWindowHtml(html);
                map.panTo(entite.fromLatLngToDivPixel(entite.getPoint()));
      });
      return entite;
    }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to