Hi Duncan, 

I have tinkered with the API previously - the xml import is.. 'ok'.

Too many points (in the form of a polyline) and it will crash Safari
and if i remember correctly firefox too, it works fine on IE as IE
uses a different method to draw the polylines (VML).

You can be dirty and throw a complete unedited gpx file at it -
(convert your gps file to gpx - its the best standard for them, google
gpsbabel):

var request = GXmlHttp.create();
request.open("GET", "http://www.coolreflections.co.uk/gmaps/tracks6.xml";, true);
request.onreadystatechange = function() {
  if (request.readyState == 4) {
    var xmlDoc = request.responseXML;
    var markers = xmlDoc.documentElement.getElementsByTagName("trkpt");
    var points = []
    for (var i = 0; i < markers.length; i++) {
     points.push(new GPoint(parseFloat(markers[i].getAttribute("lon")),
                             parseFloat(markers[i].getAttribute("lat"))));
    }
    map.addOverlay(new GPolyline(points));
  }
}
request.send(null);


The xml file it imports is in the format:

<trkpt lat="51.582634" lon="-2.834516">
  <ele>-13.801758</ele>
<time>2005-07-02T11:36:47Z</time>
</trkpt>

This is just a quick and dirty example almost straight from the documentation.

Regards,

-g

On 7/8/05, Duncan Barclay <[EMAIL PROTECTED]> wrote:
>  Hi,
>  
>  That looks really nice, especially the London bombing map.
>  
>   I have been trying to use the Google Maps API, but can't work out how to
> get javascript to like getting the points and other data from an XML file. 
> I will have to look into it a bit more.
>  
>  It is quite amazing what you can do with the new API isn't it ...
>  
>  Duncan
>  
>  
>  
> Kosso wrote: 
> hi.
>  I've been knocking up this since the trip to the USA and events yesterday
>  
>  
>  http://geepster.com
>  
>  Currently making it all db-driven and asynchronous - and RSS reading ;)
>  
>  
>  
>  
>  
> On 7/6/05, Kim Plowright <[EMAIL PROTECTED]> wrote: 
> > 
> > Probably even more off topic, and hello list, sorry, I lurk as I'm *so*
> not techy enough for most of the conversations... 
> >   
> > But has everyone seen this flickr / google earth mix? Appols if it has
> done the rounds... 
> >   
> > http://www.flickr.com/groups/topic/50193/ 
> >   
> > And a slightly unrelated note, and a tad off topic.... could anyone shed
> any light on how easy this would be to achieve... 
> >   
> > In Our Time - Melvyn's weekly newsletter. 
> > He tends to dictate it whilst walking around London - cue much merriment
> about getting rained on, etc. How easy would it be to strip out location /
> placename data from the emails, and map 'Where's Melvyn?' on to google maps?
> Possibly with a link to download/listen again to the episode he talks about?
> > A very silly idea, I know, but quite cute... I'm interested in ideas that
> spatially locate programming and content. You could imagine being stood on
> waterloo bridge and your mobile suddenly going off, delivering you that
> week's podcast... 
> >   
> > Kim 
> > (BBC type, project manager in Interactive Drama and Entertainment, can't
> code for toffee...) 
>  
>


-
Sent via the backstage.bbc.co.uk discussion group.  To unsubscribe, please 
visit http://backstage.bbc.co.uk/archives/2005/01/mailing_list.html.

Reply via email to