This issue is probably w/ the django serialization of these values, not w/ the mapbox gl js library itself. In javascript, decimal numbers must always be formatted with dots, not commas (dots and commas have specific meanings in JS).
I think this is a simple bug - we probably just need to modify our templates (at least these two lines: https://github.com/archesproject/arches/blob/master/arches/app/templates/javascript.htm#L235-L236 <https://github.com/archesproject/arches/blob/master/arches/app/templates/javascript.htm#L235-L236>) so that these numbers are not formatted for presentation (localized) and rather the raw values are preserved, probably using “unlocalize” (https://docs.djangoproject.com/en/1.8/topics/i18n/formatting/#unlocalize <https://docs.djangoproject.com/en/1.8/topics/i18n/formatting/#unlocalize>). - Rob > On Jan 8, 2018, at 9:31 AM, Adam Cox <[email protected]> wrote: > > Ah, I understand now. Interesting. I've been looking around at Mapbox > documentation and tickets... not finding much on whether or not commas would > break that library, only this https://github.com/mapbox/mapbox-java/issues/39 > <https://github.com/mapbox/mapbox-java/issues/39> which suggests that maybe > the issue has been at least been considered at some point in the js-gl > library. That said, it may be not wise to count on it. > > I think the best solution would be to find where in the map widget the > coordinates are pulled from the database and force them back to using "." > instead of ",". > https://github.com/archesproject/arches/blob/master/arches/app/media/js/views/components/widgets/map.js > > <https://github.com/archesproject/arches/blob/master/arches/app/media/js/views/components/widgets/map.js>. > If you want to start working on that, you should be able to copy that file > into the corresponding location in your project (from wherever you have > Arches installed or cloned) and begin modifying it. > > Adam > > On Mon, Jan 8, 2018 at 10:49 AM, Angela Feliu <[email protected] > <mailto:[email protected]>> wrote: > Hello Adam, > > The problem is that using USE_L10N = True that formats numbers and dates and > calendars in Spanish (and we need so for models) > the configuration for map centers comes like this from server data. > > > > El dilluns, 8 gener de 2018 12:43:30 UTC+1, Angela Feliu va escriure: > Hello I have checked that when in settings we use format numbers, dates, and > calendars according to the current locale and we translate web to Spanish, > Arches doen't work correctly as in the moment of creating map > > mapDefaultX: 2,18415123653, > mapDefaultY: 41,3969621191, > > So it throws javascript error > > <https://lh3.googleusercontent.com/-pspyRwFvQHk/WlNZT3bGGaI/AAAAAAAAAm4/5ESK1JNs4ek3kVFIqw_hmTKX5DiW98PgACLcBGAs/s1600/Captura.PNG> > > > -- > -- To post, send email to [email protected] > <mailto:[email protected]>. To unsubscribe, send email to > [email protected] > <mailto:archesproject%[email protected]>. For more information, > visit https://groups.google.com/d/forum/archesproject?hl=en > <https://groups.google.com/d/forum/archesproject?hl=en> > --- > You received this message because you are subscribed to the Google Groups > "Arches Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. > > > -- > -- To post, send email to [email protected]. To unsubscribe, > send email to [email protected]. For more > information, visit https://groups.google.com/d/forum/archesproject?hl=en > <https://groups.google.com/d/forum/archesproject?hl=en> > --- > You received this message because you are subscribed to the Google Groups > "Arches Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- -- To post, send email to [email protected]. To unsubscribe, send email to [email protected]. For more information, visit https://groups.google.com/d/forum/archesproject?hl=en --- You received this message because you are subscribed to the Google Groups "Arches Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
