Hi Marcelo I see your point on the altitude being requested 100 times and if I get a string back then I will be able to send it without the loop to get the values for google chart.
However I think I am just sending I call to chart as I really just send this url http://chart.apis.google.com/chart?cht=ls&chs=400x100&chco=000000&chm=B,33cc33,0,0,0&chd=t:274,277,247,275,270,248,252,255,278,251,244,251,251,246,258,260,268,265,263,271,273,273,278,279,274,291,295,291,285,292,286,293,301,311,329,341,334,332,310,280,244,216,212,186,184,158,147,148,147,130,105,96,121,88,81,137,166,188,189,192,199,165,140,117,106,106,105,116,119,125,135,139,145,135,130,138,144,162,191,186,181,206,214,217,224,225,227,225,233,234,255,267,272,277,274,264,262,277,299,285&chds=81,341&chxt=y&chxl=0:| and I get the chart back as an image. I'll certainly have a crack at changing the altitude request method. Thanks for your time and help Cheers Gordon On Oct 23, 9:23 pm, Marcelo <[email protected]> wrote: > Well, I still cannot get the line to disappear, but it could be > because you're making the browser do so much work. > > Aside from the 100 calls to altitude.php you are also calling Google > Charts 100 times! That's 200 http requests before your map can render, > where you could be doing the same with just 2 calls. > > Try reorganizing the strategy: > -- First read the GPX, and append each lat/lon's to a string with some > separator. > -- When that loop has completed call altitude.php once, with that long > string of lat/lon's as parameter. Use the POST method if the string is > too long. > -- Let PHP split the string into individual points, look up the > altitudes, wherever it does that, and return one long string of > altitudes. > -- Use plain text rather than XML to return results from PHP. > -- Then call Google Charts only once, with that long string of > altitudes. > > That's just an overview of a strategy that should allow your page to > load about 100 times faster. > Give it a try and see if the polylines start behaving. > > -- > Marcelo -http://maps.forum.nu > -- > > On Oct 23, 9:27 pm, "[email protected]" > > <[email protected]> wrote: > > Hi Marcelo > > > I am using FF 3.5.3 and one of my friends was getting the same problem > > using safari, it's weird but if I zoom out and then pan out of view > > but then come back the polyline has gone but the points are there (I > > know its an issue which is never likely to happen in real life but > > wanted to try to get it right) > > > The reason I don't use the altitude info in the gpx file is that it is > > so far from correct it is useless unfortunately. > > > I'll have a look at my GDownloadUrl call and try to change it although > > I am not particularly skilled in javascript but I am trying! > > > Thanks > > > Gordon > > > On Oct 23, 8:03 pm, Marcelo <[email protected]> wrote: > > > > On Oct 23, 9:02 pm, Marcelo <[email protected]> wrote: > > > > > I don't see the points disappear, (Firefox 2), > > > > Sorry, I meant I don't see the *polyline* disappear! :-) > > > > -- > > > Marcelo -http://maps.forum.nu > > > -- > > > > but there is another > > > > > problem, and that is that you're asking the browser to do way more > > > > work than necessary. > > > > > You're calling the function getAltitude() maxNodes times, and that is > > > > 100 times GDownloadUrl()! > > > > You could send all points in one call, as POST data, and get back a > > > > long comma separated string that you split() into an array.Then you're > > > > done with just one GDownloadUrl call. > > > > > Other than that, maybe I looked too quickly, but why are you calling > > > > altitude.php if you already have the altitude in the GPX file, in the > > > > field <ele></ele>? > > > > > -- > > > > Marcelo -http://maps.forum.nu > > > > -- > > > > > On Oct 23, 8:45 pm, "[email protected]" > > > > > <[email protected]> wrote: > > > > > I wonder if anyone can help me find out why my polyline disappears > > > > > after zooming right out and back in again? The points remain but the > > > > > polyline disappears. > > > > > >http://80.176.208.244/cycle/downloads/1/gmap.php > > > > > > Thanks > > > > > > Gordon --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
