Dear xelawho,
*I think I already mentioned that I tried to modified the Mike's code so
this the way that i tried to create a function like below*
*

function addLines()
{
 GDownloadUrl("http://geoca.persiangig.com/line.xml";, function(point,
responseCode)
  {
   var xml = GXml.parse(point);
   var lines = xmlDoc.documentElement.getElementsByTagName("line");

          // read each line
          for (var i = 0; i < lines.length; i++)
                  {
            // get any line attributes
            var colour = lines[a].getAttribute("colour");
            var width  = parseFloat(lines[a].getAttribute("width"));
            // read each point on that line
            var points = lines[a].getElementsByTagName("tpoint");
            var pts = [];

            for (var i = 0; i < points.length; i++) {
               pts[i] = new GPoint(parseFloat(points[i].getAttribute("lat")),
                                   parseFloat(points[i].getAttribute("lng")));
            }
            gmap.addOverlay(new GPolyline(pts,colour,width));
          }
});
}

*I can connect to my XML file and read the point data for 3 markers but not
for polylines!
I really did not understand what you mean by"asking the odd question here"
but do you really think this is Odd question?

On Tue, Nov 23, 2010 at 1:02 PM, xelawho <[email protected]> wrote:

> Hi Behseini,
>
> I can tell you from experience that you can put a map together without
> knowing too much about javascript, just by copying and pasting other
> people's code and asking the odd question here, but you have to be
> very careful about what you copy and what you change if you don't
> understand what it does.
>
> Have a look at Mike's original code:
> // read each line
>          for (var a = 0; a < lines.length; a++) {
>            // get any line attributes
>            var colour = lines[a].getAttribute("colour");
>
> and yours:
> // read each line
>          for (var i = 0; i < lines.length; i++)
>                  {
>            // get any line attributes
>            var colour = lines[a].getAttribute("colour");
>
> see the difference?
> also, I doubt that:
> var points = lines[a].getElementsByTagName("tpoint");
>
> is going to fly, but I may be wrong...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps API V2" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-api?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" 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