aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Donnet2012-04-12 17:33:32 +0200
committerLuc Donnet2012-04-12 17:33:32 +0200
commit6fa0c28ca62cf8add9f5e610dba2294beee707fe (patch)
tree91606f61338e67931566591e9f37c51644d2a20c
parentef16bc107b87f2157e9c38a02da5bc085ae43f4f (diff)
downloadchouette-core-6fa0c28ca62cf8add9f5e610dba2294beee707fe.tar.bz2
Add picture for stop_areas
-rw-r--r--app/assets/images/map/boardingposition.pngbin0 -> 3440 bytes
-rw-r--r--app/assets/images/map/commercialstoppoint.pngbin0 -> 3561 bytes
-rw-r--r--app/assets/images/map/quay.pngbin0 -> 3407 bytes
-rw-r--r--app/assets/images/map/stopplace.pngbin0 -> 3809 bytes
-rw-r--r--app/maps/style_map/stop_areas_style_map.rb40
-rw-r--r--app/views/stop_areas/index.kml.erb1
6 files changed, 12 insertions, 29 deletions
diff --git a/app/assets/images/map/boardingposition.png b/app/assets/images/map/boardingposition.png
new file mode 100644
index 000000000..f3ffe75d9
--- /dev/null
+++ b/app/assets/images/map/boardingposition.png
Binary files differ
diff --git a/app/assets/images/map/commercialstoppoint.png b/app/assets/images/map/commercialstoppoint.png
new file mode 100644
index 000000000..2c87dc31a
--- /dev/null
+++ b/app/assets/images/map/commercialstoppoint.png
Binary files differ
diff --git a/app/assets/images/map/quay.png b/app/assets/images/map/quay.png
new file mode 100644
index 000000000..a2bd8e954
--- /dev/null
+++ b/app/assets/images/map/quay.png
Binary files differ
diff --git a/app/assets/images/map/stopplace.png b/app/assets/images/map/stopplace.png
new file mode 100644
index 000000000..b5058573e
--- /dev/null
+++ b/app/assets/images/map/stopplace.png
Binary files differ
diff --git a/app/maps/style_map/stop_areas_style_map.rb b/app/maps/style_map/stop_areas_style_map.rb
index 4cf169345..8bfeaa2df 100644
--- a/app/maps/style_map/stop_areas_style_map.rb
+++ b/app/maps/style_map/stop_areas_style_map.rb
@@ -1,12 +1,9 @@
class StyleMap::StopAreasStyleMap < StyleMap::GenericStyleMap
- attr_accessor :styles, :display_label, :context, :terminus
- alias_method :terminus?, :terminus
+ attr_accessor :styles, :display_label
- def initialize(display_label = false, terminus = false, context = {}, styles = {})
+ def initialize(display_label = false, styles = {})
@display_label = display_label
- @terminus = terminus
- @context = context
@styles = styles
end
@@ -19,18 +16,10 @@ class StyleMap::StopAreasStyleMap < StyleMap::GenericStyleMap
:labelAlign => "ct",
:labelXOffset => 0,
:labelYOffset => -15,
- :pointRadius => 4,
- :fillColor => "white",
- :fillOpacity => 1,
- :strokeColor => "black",
- :strokeOpacity => 1,
- :strokeWidth => 2,
- :display => true
- }.tap do |style_basic|
- style_basic.merge! :fontSize =>"11px",
:pointRadius => 16,
- :externalGraphic => "/assets/icons/stop_area_hover.png" if terminus?
- end
+ :externalGraphic => "/assets/map/${areaType}.png",
+ :display => true
+ }
if styles["default"].present?
style.merge styles["default"]
@@ -48,18 +37,11 @@ class StyleMap::StopAreasStyleMap < StyleMap::GenericStyleMap
:labelAlign => "ct",
:labelXOffset => 0,
:labelYOffset => -15,
- :pointRadius => 4,
- :fillColor => "white",
- :fillOpacity => 1,
- :strokeColor => "black",
- :strokeOpacity => 1,
- :strokeWidth => 2,
- :display => true
- }.tap do |style_basic|
- style_basic.merge! :fontSize =>"11px",
:pointRadius => 16,
- :externalGraphic => "/assets/icons/stop_area_hover.png" if terminus?
- end
+ :externalGraphic => "/assets/map/${areaType}.png",
+ :display => true
+ }
+
if styles["select"].present?
select_style.merge styles["select"]
else
@@ -69,8 +51,8 @@ class StyleMap::StopAreasStyleMap < StyleMap::GenericStyleMap
def context
context = {
- :label => :"function(feature) {if(feature.layer.map.getZoom() > 15) { return feature.attributes.name;} else {return '';}}",
- #:display => :"function(feature) {if(feature.layer.map.getZoom() > 13) { return true;} else {return 'none';}}"
+ :label => :" function(feature) {if(feature.layer.map.getZoom() > 13) { return feature.attributes.name;} else {return '';}} ",
+ :areaType => :" function(feature) { return feature.attributes.stop_area_type.toLowerCase();} "
}
end
diff --git a/app/views/stop_areas/index.kml.erb b/app/views/stop_areas/index.kml.erb
index 086b8fb42..a40e99a6c 100644
--- a/app/views/stop_areas/index.kml.erb
+++ b/app/views/stop_areas/index.kml.erb
@@ -4,6 +4,7 @@
<% @stop_areas.where("latitude is not null and longitude is not null").each do |stop_area| %>
<Placemark id="<%= stop_area.id %>" >
<name><%= stop_area.name %></name>
+ <stop_area_type><%= stop_area.area_type %></stop_area_type>
<%= stop_area.geometry.kml_representation.html_safe %>
</Placemark>
<% end %>