aboutsummaryrefslogtreecommitdiffstats
path: root/app/maps
diff options
context:
space:
mode:
authorAlban Peignier2012-05-29 08:57:01 +0200
committerAlban Peignier2012-05-29 08:57:01 +0200
commit244de985c6c00b6385e9af47f9dec08de1eec6c5 (patch)
treeba555108ea422d3e981b9b1a98c215d38a8cc831 /app/maps
parentae65f9661b288b367d5f1f3e5fd8797852127110 (diff)
downloadchouette-core-244de985c6c00b6385e9af47f9dec08de1eec6c5.tar.bz2
Include html_safe an ready? in ApplicationMap#to_html
Diffstat (limited to 'app/maps')
-rw-r--r--app/maps/application_map.rb4
-rw-r--r--app/maps/line_map.rb4
-rw-r--r--app/maps/network_map.rb4
3 files changed, 11 insertions, 1 deletions
diff --git a/app/maps/application_map.rb b/app/maps/application_map.rb
index a4d8a84ab..dffb2501c 100644
--- a/app/maps/application_map.rb
+++ b/app/maps/application_map.rb
@@ -34,7 +34,9 @@ class ApplicationMap
end
def to_html(options = {})
- "<div id=\"#{id}\" class=\"#{default_class}\"></div> #{map.to_html(options)}"
+ if not respond_to?(:ready?) or ready?
+ "<div id=\"#{id}\" class=\"#{default_class}\"></div> #{map.to_html(options)}".html_safe
+ end
end
def kml
diff --git a/app/maps/line_map.rb b/app/maps/line_map.rb
index 128b98dd2..a7a9f892d 100644
--- a/app/maps/line_map.rb
+++ b/app/maps/line_map.rb
@@ -29,4 +29,8 @@ class LineMap < ApplicationMap
end
+ def ready?
+ Chouette::StopArea.bounds.present?
+ end
+
end
diff --git a/app/maps/network_map.rb b/app/maps/network_map.rb
index cedabdf6e..35283a48f 100644
--- a/app/maps/network_map.rb
+++ b/app/maps/network_map.rb
@@ -28,4 +28,8 @@ class NetworkMap < ApplicationMap
end
+ def ready?
+ Chouette::StopArea.bounds.present?
+ end
+
end