I've not tried sorting the XML, but I have tried sorting the sidebar in
my EGeoXml extension.

Example: http://econym.org.uk/gmap/example_egeotestgoo.htm

Code: http://econym.org.uk/gmap/egeoxml.js


Disentangling the EGeoXml stuff, it would look like this:

Instead of adding to the sidebar html each time you parse a marker,
store the info in an array:

  gmarkers.push(marker);
  side_bar_list.push (nom + "$$$" + label + "$$$" + gmarkers.length-1 );

Where "nom" contains the text that controls the sort order and "label"
contains the text to appear in the sidebar.

After parsing all the markers, sort the array

  side_bar_list.sort();

Then read through the sorted array, split it into the original parts,
and generate the side bar html

  side_bar_html = "";
  for (var i=0; i<side_bar_list.length; i++) {
    var bits = side_bar_list[i].split("$$$",3);
    var label = bits[1];
    var n = bits[2];
    side_bar_html += '<a href="javascript:GEvent.trigger(gmarkers['
                  + n + '],\'click\')">' + label + '</a><br>';
  }
  document.getElementById("sidebar").innerHTML = side_bar_html;

-- 
Mike Williams
http://econym.org.uk/gmap



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