You the man, Mike, thanks a lot! Checking if isNaN(latN) brought me back to a point in the code where I try to calculate the geodesic arc between 2 identical GLatLngs. I believe this behaviour originates from the algorithm for the union operation, which uses circled doubly linked lists and does not necessarily start at the beginning of a polygon so that, when reaching the closing vertex, the resulting polygon would contain two identical vertices one after the other; I'll have to look into this.
Well, I am fixing the geodesic issue in the function for now. Thanks again, this thing really vexed me. Best regards Götz On 24 Feb., 16:52, Mike Williams <[email protected]> wrote: > It turns out that there's at least one point in your fPoints array that > is Not A Number. I think it happens when the bearing is due East. > > The atan2(), sin() and cos() functions shouldn't ever return NaN, and > your only sqrt() is always operating on a non-negative value, so my > guess would be that the asin() on the line > var d = 2*asin(sqrt( ... )); > might be being passed a number greater than 1. > > I suggest creating a temporary copy of your page and adding the line > if (isNaN(d)) { crash } > or if that doesn't catch it > if (isNaN(latN)) { crash } > > Catch the crash with a debugger and investigate the details of the > calculations that caused the NaN. > > --http://econym.org.uk/gmap > The Blackpool Community Church Javascript Team --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
