My FF2 Firebug is having trouble setting breakpoints.
That might be as simple as the missing </html> tag from your page.

----

The arrowheads get a custom property 'mypoly_num' which you are trying
to derive from your XML data attribute "poly_num", fair enough.
There is are basic errors in your logic reading that from XML though:
        var pts = [];
        for (var i=0; i< pts.length-1; i++) {
        var poly_num = lines[a].getAttribute("poly_num");

First up you've just defined pts as an empty array.  Empty arrays have
no length.  The loop will not execute.

Next, if the loop did execute, you'd be trying to get data from
lines[a].  'a' hasn't been defined yet, maybe you meant 'i'

Next, if the loop did execute, all the values for "poly_num" would be
read in turn, and each time the old value of variable poly_num would
be overwritten.
When the loop exits, poly_num will be left at the last value.

Then the code goes on to read all the polyline data in turn, create
polylines and arrowheads.  But all arrowheads for all polylines will
be created with exactly the same "poly_num" value.  Because you never
actually got a poly_num value to begin with, all of the arrowheads
will get a null value just now.

If you must use that value from XML, read it at the same time as you
read the other bits of data for each polyline in turn.

----

But, the 'poly_num' that is used in your sidebar clicks to reference
polylines has absolutely nothing to do with that.   That poly_num is
just derived from a count of how many polylines there are.
So when the hide/show routine is run, you're just hoping that the
arrowheads with property 'mypoly_num' = X have something to do with a
polyline gpolys[X]

They don't at the moment, since every arrowheads 'mypoly_num' property
is always null.

----

It'd seem smart to call the arrowhead creating code from within the
polyline creating routine, so that everything actually uses the same
references.  You can choose whether to make up a reference for each
polyline, or use something read from the XML ; but be consistent.
Making something up (from the poly count) has the advantage that you
can code it to always be unique - no chance of accidentally slipping
an error into the XML data with a duplicate reference.

----

You have to pay attention to detail with this stuff ; you have to read
what you write ; put yourself in the browser's place and try to carry
out the instructions you give it.

-- 
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