Rework coordinates to avoid scientific formatting of small numbers. Fixes #1509

This commit is contained in:
Andy Allan 2017-06-23 14:03:57 +01:00
parent ab3df6fc56
commit 396f2e28dd
12 changed files with 76 additions and 37 deletions

View file

@ -185,8 +185,8 @@ class Node < ActiveRecord::Base
add_metadata_to_xml_node(el, self, changeset_cache, user_display_name_cache)
if visible?
el["lat"] = format("%.7f", lat)
el["lon"] = format("%.7f", lon)
el["lat"] = lat.to_s
el["lon"] = lon.to_s
end
add_tags_to_xml_node(el, node_tags)

View file

@ -2,7 +2,7 @@ json.type "Feature"
json.geometry do
json.type "Point"
json.coordinates [ note.lon, note.lat ]
json.coordinates [ note.lon.to_f, note.lat.to_f ]
end
json.properties do