I have multiple xml files that I want to download and display onto a
single map, they will be displayed using the elabel function.  I have
no problem getting a single xml file to display, but I've tried
multiple ways to include the second xml file to no avail thus far.

I'm wondering if the problem lies with the variables, using the same
variable in each loop to push the elabels?  Thanks for the help...

Here is my 'starting' code for loading and displaying the two xml
files...


    var mm;
    var mm2;

    if (GBrowserIsCompatible()) {

        // Display the map, with some controls and set the initial
location

        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl3D());
        map.addControl(new GScaleControl);
        map.enableScrollWheelZoom();
        map.setCenter(new GLatLng(38.611, -93.450), 7);
        map.setMapType(G_PHYSICAL_MAP);

        var logo = new GScreenOverlay("http://severeplains.com/maps/
overlays/wxornot.png", new GScreenPoint(1045, 675, "pixels",
"pixels"),new GScreenPoint(300, 150),new GScreenSize(150, 75));
        map.addOverlay(logo);


      // read the markers from the XML
      GDownloadUrl("http://severeplains.com/maps/overlays/dewp.xml";,
function (doc) {
        var elabels_dewp = [];
        var xmlDoc = GXml.parse(doc);
        var markers =
xmlDoc.documentElement.getElementsByTagName("marker");


        for (var i = 0; i < markers.length; i++) {
          // obtain the attribues of each marker
          var lat = parseFloat(markers[i].getAttribute("lat"));
          var lon = parseFloat(markers[i].getAttribute("lon"));
          var point = new GLatLng(lat,lon);
          var data = markers[i].getAttribute("data");
          var pri = markers[i].getAttribute("pri");
          // split the markers into four arrays
          if (parseInt(data) > 0 && parseInt(pri) < 5) {
             var label = new ELabel(point, data, "style3");
             elabels_dewp.push(label);
          }
        }

        mm = new MarkerManager(map);                // NOTE: don't use
GMarkerManager()

        mm.addMarkers(elabels_dewp,0,17);
        mm.refresh();

      });
      }

      // read the markers from the XML
      GDownloadUrl("http://severeplains.com/maps/overlays/visib.xml";,
function (doc) {
        var elabels_visib = [];
        var xmlDoc = GXml.parse(doc);
        var markers =
xmlDoc.documentElement.getElementsByTagName("marker");


        for (var i = 0; i < markers.length; i++) {
          // obtain the attribues of each marker
          var lat = parseFloat(markers[i].getAttribute("lat"));
          var lon = parseFloat(markers[i].getAttribute("lon"));
          var point = new GLatLng(lat,lon);
          var data = markers[i].getAttribute("data");
          var pri = markers[i].getAttribute("pri");
          // split the markers into four arrays
          if (parseInt(data) > 0 && parseInt(pri) < 5) {
             var label = new ELabel(point, data, "style5");
             elabels_visib.push(label);
          }
        }

        mm2 = new MarkerManager(map);                // NOTE: don't
use GMarkerManager()

        mm2.addMarkers(elabels_dewp,0,17);
        mm2.refresh();

      });
      }

    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this
browser");
    }

-- 
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