Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion text API

View parsed - Show only message text

Received: by 10.11.53.23 with SMTP id b23mr915781cwa;
        Sun, 02 Oct 2005 23:57:30 -0700 (PDT)
Return-Path: <nos...@econym.demon.co.uk>
Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85])
        by mx.googlegroups.com with ESMTP id v23si706908cwb.2005.10.02.23.57.30;
        Sun, 02 Oct 2005 23:57:30 -0700 (PDT)
Received-SPF: neutral (googlegroups.com: 194.217.242.85 is neither permitted nor denied by domain of nos...@econym.demon.co.uk)
Received: from econym.demon.co.uk ([83.104.52.64])
	by anchor-post-35.mail.demon.net with smtp (Exim 4.42)
	id 1EMKAq-00017U-HL
	for Google-Maps-API@googlegroups.com; Mon, 03 Oct 2005 06:51:44 +0000
Message-ID: <e6YERfAfYNQDFwmm@econym.demon.co.uk>
Date: Mon, 3 Oct 2005 07:56:31 +0100
To: Google-Maps-API@googlegroups.com
From: Mike Williams <nos...@econym.demon.co.uk>
Subject: Re: text API
References: <1128315997.745366.67030@g44g2000cwa.googlegroups.com>
In-Reply-To: <1128315997.745366.67030@g44g2000cwa.googlegroups.com>
MIME-Version: 1.0
X-Mailer: Turnpike Integrated Version 4.02 S <y6w6i7iXF7su4e1qhLHXuschMm>

If you really don't want to convert your text into XML, then I suggest
you start like this:

Grab the XML example code from my tutorial

   http://www.econym.demon.co.uk/googlemaps/basic3.htm

Then make the following changes to the XML processing bit to convert it
to text processing:

* use request.responseText instead of request.responseXML

* rip out all the getElementsBtTagName and getAttribue stuff and replace
it with the string.split() method:


    var gpsDoc = request.responseText;
    
    // Split it on 'newline' into an array of lines 
    var markers = gpsDoc.split('\n');

    // Loop through the lines
    for (var i = 0; i < markers.length; i++) {

        // If empty don't process
        if (!markers[i]){break}

        // Split each line on ':' into an array of parts
        var part = markers[i].split(':');
        
        // Grab the parts
        var date = part[0];
        var name = part[1];
        var lng = parseFloat(part[2]);
        var lat = parseFloat(part[3]);

        var marker =  new GMarker(new GPoint(lng,lat));
        map.addOverlay(marker);
    }




Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google