aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Perles2016-01-12 11:10:10 +0100
committerBruno Perles2016-01-12 11:10:10 +0100
commit4784b3ba4578fcc881fd52737c4b0b55b46835d0 (patch)
tree5bb8606771d6fc0bdd6f98ee55b6de6eeba1039b
parent07e616b1145ce7e42a9c3820cb7eef6a52f49ecf (diff)
downloadchouette-core-4784b3ba4578fcc881fd52737c4b0b55b46835d0.tar.bz2
Fix bug on negative point
-rw-r--r--app/maps/route_section_map.rb1
-rw-r--r--app/maps/route_section_selector_map.rb6
2 files changed, 2 insertions, 5 deletions
diff --git a/app/maps/route_section_map.rb b/app/maps/route_section_map.rb
index cfa40d481..de4d5e746 100644
--- a/app/maps/route_section_map.rb
+++ b/app/maps/route_section_map.rb
@@ -30,7 +30,6 @@ class RouteSectionMap < ApplicationMap
else
points = route_section.stop_areas.map{|point| OpenLayers::Geometry::Point.new(point.longitude, point.latitude).transform("EPSG:4326", "EPSG:900913")}
geometry_editable_layer = OpenLayers::Layer::Vector.new("user_geometry", {:projection => projection("EPSG:4326"), :styleMap => Design::RouteSectionStyleMap.new(helpers).style_map})
- #geometry_editable_layer = OpenLayers::Layer::Vector.new("user_geometry", {:projection => projection("EPSG:4326")})
geometry_editable_features = OpenLayers::Feature::Vector.new(OpenLayers::Geometry::LineString.new(points))
page.assign :geometry_editable_features, geometry_editable_features
end
diff --git a/app/maps/route_section_selector_map.rb b/app/maps/route_section_selector_map.rb
index 425a6750a..7287c4d8a 100644
--- a/app/maps/route_section_selector_map.rb
+++ b/app/maps/route_section_selector_map.rb
@@ -96,11 +96,9 @@ EOF
end
def clean_route_section_line(line)
- point_array = line.to_s.scan(/\d+[.]\d+\s\d+[.]\d+/)
- proj = OpenLayers::Projection.new('proj')
-
+ point_array = line.to_s.scan(/-?\d+[.]\d+\s-?\d+[.]\d+/)
point_array.map do |point|
- point = point.scan(/\d+[.]\d+/)
+ point = point.scan(/-?\d+[.]\d+/)
lat = point[0].to_f
lng = point[1].to_f
[lat, lng]