I have used the following code from the examples googles
documentation, however I need to add a second XML import, i have a php
that will export the xml (and its working) but where do I put the next
GDownloadURL?

    <script type="text/javascript">
    //<![CDATA[



    var iconBlue = new GIcon();
    iconBlue.image = '/schooltest/i/mm_20_blue.png';
    iconBlue.shadow = '/schooltest/i/mm_20_shadow.png';
    iconBlue.iconSize = new GSize(12, 20);
    iconBlue.shadowSize = new GSize(22, 20);
    iconBlue.iconAnchor = new GPoint(6, 20);
    iconBlue.infoWindowAnchor = new GPoint(5, 1);

    var iconRed = new GIcon();
    iconRed.image = '/schooltest/i/mm_20_red.png';
    iconRed.shadow = '/schooltest/i/mm_20_shadow.png';
    iconRed.iconSize = new GSize(12, 20);
    iconRed.shadowSize = new GSize(22, 20);
    iconRed.iconAnchor = new GPoint(6, 20);
    iconRed.infoWindowAnchor = new GPoint(5, 1);

    var iconYellow = new GIcon();
    iconYellow.image = '/schooltest/i/mm_20_yellow.png';
    iconYellow.shadow = '/schooltest/i/mm_20_shadow.png';
    iconYellow.iconSize = new GSize(12, 20);
    iconYellow.shadowSize = new GSize(22, 20);
    iconYellow.iconAnchor = new GPoint(6, 20);
    iconYellow.infoWindowAnchor = new GPoint(5, 1);

    var iconSCP = new GIcon();
    iconSCP.image = '/schooltest/i/mm_20_green.png';
    iconSCP.shadow = '/schooltest/i/mm_20_shadow.png';
    iconSCP.iconSize = new GSize(12, 20);
    iconSCP.shadowSize = new GSize(22, 20);
    iconSCP.iconAnchor = new GPoint(6, 20);
    iconSCP.infoWindowAnchor = new GPoint(5, 1);

    var customIcons = [];
    customIcons["p"] = iconBlue;
    customIcons["s"] = iconRed;
    customIcons["sp"] = iconYellow;
        customIcons["x"] = iconSCP;

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
            map.enableDoubleClickZoom();
        map.enableScrollWheelZoom();

            map.addMapType(G_PHYSICAL_MAP);
                map.addMapType(G_SATELLITE_3D_MAP);
                map.addControl(new GLargeMapControl());
                map.addControl(new GScaleControl());
                map.addControl(new GMapTypeControl());
//              map.setMapType(G_HYBRID_MAP);
//        map.addControl(new GSmallMapControl());
//        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(54.564020, -1.312933), 12);

        GDownloadUrl("phpsqlajax_genxml3.php", function(data) {
          var xml = GXml.parse(data);
          var markers = xml.documentElement.getElementsByTagName
("marker");
          for (var i = 0; i < markers.length; i++) {
            var name = markers[i].getAttribute("name");
            var address = markers[i].getAttribute("address");
            var type = markers[i].getAttribute("type");
                        var area = markers[i].getAttribute("area");
            var town = markers[i].getAttribute("town");
            var postcode = markers[i].getAttribute("postcode");
                        var telephone = markers[i].getAttribute("telephone");
            var fax = markers[i].getAttribute("fax");
            var start = markers[i].getAttribute("start");
            var finish = markers[i].getAttribute("finish");
            var point = new GLatLng(parseFloat(markers[i].getAttribute
("lat")),
                                    parseFloat(markers[i].getAttribute
("lng")));
            var marker = createMarker(point, name, address, area,
town, postcode, telephone, fax, start, finish, type)
            map.addOverlay(marker);


          }
        });




      var point = new GLatLng(54.564020, -1.312933);
      var marker = createTabbedMarker(point, ["Tab 1 contents", "Tab 2
contents","Tab 3 contents","Tab 4 contents"],
["One","Two","Three","Four"]);
      map.addOverlay(marker);



      }
    }
        function createTabbedMarker(point,htmls,labels) {
                var xt = "x";
        var marker = new GMarker(point, customIcons[xt]);
        GEvent.addListener(marker, "click", function() {
          // adjust the width so that the info window is large enough
for this many tabs
          if (htmls.length > 2) {
            htmls[0] = '<div style="width:'+htmls.length*88+'px">' +
htmls[0] + '<\/div>';
          }
          var tabs = [];
          for (var i=0; i<htmls.length; i++) {
            tabs.push(new GInfoWindowTab(labels[i],htmls[i]));
          }
          marker.openInfoWindowTabsHtml(tabs);
        });
        return marker;
      }
          function createMarker(point, name, address, area, town, postcode,
telephone, fax, start, finish, type) {
      var marker = new GMarker(point, customIcons[type]);
      var html = "";
          if (area > "")
  {
    html ="<b>" + name + "</b><br/>" + address + "<br/>"+area+ "<br/
>"+town+ "<br/>"+postcode.toUpperCase()+ "<br/>Tel:"+telephone+ "<br/
>Fax:"+fax+ "<br/><b>Start:</b> "+start+ "<br/><b>Finish:</b> "+finish
+"<br><a href='#'>link</a>";
  }
else
  {
html= "<b>" + name + "</b><br/>" + address + "<br/>"+town+ "<br/
>"+postcode.toUpperCase()+ "<br/>Tel:"+telephone+ "<br/>Fax:"+fax+
"<br/><b>Start:</b> "+start+ "<br/><b>Finish:</b> "+finish+"<br><a
href='#'>link</a>";

  }
    GEvent.addListener(marker, 'click', function() {
        marker.openInfoWindowHtml(html);
      });
      return marker;
    }
    //]]>
  </script>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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