Google Maps v3 - Extracting data from .xml file

1,913 views
Skip to first unread message

Trachy

unread,
Jul 7, 2010, 7:41:31 AM7/7/10
to Google Maps JavaScript API v3
Hello,

I try to convert my Google Maps V2 application in a GM V3 one.
In V2, I could retrieve easily data from xml with GXmlHttp.

It looked like :

// *******************************************************************
function recup_traitement_groupe_station(fichier) {

stations=[];

var request = GXmlHttp.create();
request.open("GET", fichier, true);
request.onreadystatechange = function() {
// si les data ont été chargées, le readystate passe à 4
if (request.readyState == 4) {
var xmlDoc = request.responseXML;

// Get markers array

var markers =
xmlDoc.documentElement.getElementsByTagName("marker");
nb_station= markers.length;

for (k = 0; k < markers.length; k++) {

stations[k] = new Station();

// Get marker attributes

stations[classe][k].code =
search_real_char(markers[k].getAttribute("code"));
stations[classe][k].libelle =
search_real_char(markers[k].getAttribute("libelle"));
}
traitement_groupe_station(nb_station);
}}
request.send(null);
return stations;}

// *******************************************************************

How can I do in V3, GXmlHttp doesn't exist ?

Thanks

Trachy

Chad Killingsworth

unread,
Jul 7, 2010, 7:36:19 PM7/7/10
to Google Maps JavaScript API v3

Trachy

unread,
Jul 8, 2010, 11:36:46 AM7/8/10
to Google Maps JavaScript API v3
Thanks

I've used XMLHttpRequest

Trachy

On 8 juil, 01:36, Chad Killingsworth
<chadkillingswo...@missouristate.edu> wrote:
> Try looking at this example:http://code.google.com/apis/maps/documentation/javascript/demogallery...
>
> Chad Killingsworth
> >Trachy- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -
Reply all
Reply to author
Forward
0 new messages