[OpenLayers-Users] GPX with empty labels

Martin Mares mj at ucw.cz
Mon Jun 10 08:33:49 PDT 2013


Hello!

> See http://trac.osgeo.org/openlayers/ticket/1439 for the ticket where
> this change was discussed. And note that it is 5 years old, so I
> wonder what version you were using when you got a result that worked
> for you. The ticket also suggests using a regular expression instead
> of an isNaN check. Maybe you want to create a pull request?

I can improve the condition which checks whether the value is a number,
which would solve the case I have stumbled upon, but infinitely many
other cases would remain.

The root cause is that we do not distinguish between textual and numeric
properties, so whenever we get a style property, which looks like a number,
we parse it as a number and then convert it back to a string if needed.

Unfortunately, the conversion from a string to a number and back is lossy:
for example, all the strings "0", "00", "0.0", "-0", and "+0" are interpreted
as "0".

This is obviously not right and I am willing to fix it, but I admit I do not
see a simple solution. Could you please give me a hint?

---

By the way, what is the reason for translating empty names to the string
"undefined"?

				Have a nice fortnight
-- 
Martin `MJ' Mares                          <mj at ucw.cz>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
return(ECRAY); /* Program exited before being run */


More information about the Users mailing list