diff options
| author | Luc Donnet | 2012-04-12 17:33:32 +0200 |
|---|---|---|
| committer | Luc Donnet | 2012-04-12 17:33:32 +0200 |
| commit | 6fa0c28ca62cf8add9f5e610dba2294beee707fe (patch) | |
| tree | 91606f61338e67931566591e9f37c51644d2a20c | |
| parent | ef16bc107b87f2157e9c38a02da5bc085ae43f4f (diff) | |
| download | chouette-core-6fa0c28ca62cf8add9f5e610dba2294beee707fe.tar.bz2 | |
Add picture for stop_areas
| -rw-r--r-- | app/assets/images/map/boardingposition.png | bin | 0 -> 3440 bytes | |||
| -rw-r--r-- | app/assets/images/map/commercialstoppoint.png | bin | 0 -> 3561 bytes | |||
| -rw-r--r-- | app/assets/images/map/quay.png | bin | 0 -> 3407 bytes | |||
| -rw-r--r-- | app/assets/images/map/stopplace.png | bin | 0 -> 3809 bytes | |||
| -rw-r--r-- | app/maps/style_map/stop_areas_style_map.rb | 40 | ||||
| -rw-r--r-- | app/views/stop_areas/index.kml.erb | 1 |
6 files changed, 12 insertions, 29 deletions
diff --git a/app/assets/images/map/boardingposition.png b/app/assets/images/map/boardingposition.png Binary files differnew file mode 100644 index 000000000..f3ffe75d9 --- /dev/null +++ b/app/assets/images/map/boardingposition.png diff --git a/app/assets/images/map/commercialstoppoint.png b/app/assets/images/map/commercialstoppoint.png Binary files differnew file mode 100644 index 000000000..2c87dc31a --- /dev/null +++ b/app/assets/images/map/commercialstoppoint.png diff --git a/app/assets/images/map/quay.png b/app/assets/images/map/quay.png Binary files differnew file mode 100644 index 000000000..a2bd8e954 --- /dev/null +++ b/app/assets/images/map/quay.png diff --git a/app/assets/images/map/stopplace.png b/app/assets/images/map/stopplace.png Binary files differnew file mode 100644 index 000000000..b5058573e --- /dev/null +++ b/app/assets/images/map/stopplace.png 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 %> |
