On Dec 13, 4:33 pm, "[email protected]" <[email protected]>
wrote:
> The xml is a simple storage, each lot has an i number of vertexes
> stored <lati></lati><loni></loni> where i is the index for that lots
> range of vertexes. I want to take this data and draw a polygon. This
> is what I figured it would be..
It's an array of GLatLngs, as you are constructing. It's not easy to
debug a code listing, but your code seems to be ok, except for
polyPoint = new GLatLng(
x[0].getElementsByTagName("lat"+(j+1))[0].childNode[0].nodeValue,
x[0].getElementsByTagName("lon"+(j+1))[0].childNodes[0].nodeValue );
because those nodeValues are strings, and GLatLng needs numbers. Use
parseFloat() to make numbers.
You would probably be better off using a structure like
<points>
<point lat="x" lon="y">
<point lat="x1" lon="y1">
<points>
or
<points>
<point>
<lat>x</lat>
<lon>y</lat>
</point>
<point>
<lat>x1</lat>
<lon>y1</lon>
</point>
<points>
rather than individually numbered elements. You can then use
getElementsByTagName and loop through the array of point elements.
However the structure you have may well work if you convert to
numbers. If you can't get it to work, please provide a link as
requested in the posting guidelines. It's far easier to debug
something in a browser with Firebug.
Andrew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---