anoved / gpxtruder

Make 3D-printable elevation models of GPX tracks.
http://gpxtruder.xyz/
MIT License
69 stars 23 forks source link

iOS 8 display error #15

Closed anoved closed 9 years ago

anoved commented 9 years ago

Preview display error in Mobile Safari (iOS 8). Note NaN values in SCAD code view too.

anoved commented 9 years ago

The error is occuring in the Vector3D constructor. The bigger picture is that the problem occurs in the openjscad .setJsCad() method. Basemap display works. Remix code is being inserted successfully.

anoved commented 9 years ago

Actually, since elevation Z coordinates appear as NaN in the remix code, the Vector3D constructor is probably choking on those non-numeric values. The root problem must occur earlier, in my code.

anoved commented 9 years ago

22b2091 confirms getElementsByTagName('ele')[0].innerHTML is returning undefined for pt elevation. (parseFloat(undefined) is NaN)

anoved commented 9 years ago

Fixed as of c04f0ff; Mobile Safari seems to have an issue using .innerHTML to get XML node values. Using .textContent instead.