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 /app/maps | |
| parent | ef16bc107b87f2157e9c38a02da5bc085ae43f4f (diff) | |
| download | chouette-core-6fa0c28ca62cf8add9f5e610dba2294beee707fe.tar.bz2 | |
Add picture for stop_areas
Diffstat (limited to 'app/maps')
| -rw-r--r-- | app/maps/style_map/stop_areas_style_map.rb | 40 | 
1 files changed, 11 insertions, 29 deletions
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  | 
