aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/assets/stylesheets/stop_areas.css.scss12
-rw-r--r--app/maps/stop_area_map.rb16
-rw-r--r--app/maps/style_map/stop_areas_style_map.rb13
-rw-r--r--app/views/stop_areas/_stop_area.html.erb8
-rw-r--r--app/views/stop_areas/show.kml.erb1
5 files changed, 34 insertions, 16 deletions
diff --git a/app/assets/stylesheets/stop_areas.css.scss b/app/assets/stylesheets/stop_areas.css.scss
index 046066b9f..1f1624dd7 100644
--- a/app/assets/stylesheets/stop_areas.css.scss
+++ b/app/assets/stylesheets/stop_areas.css.scss
@@ -98,6 +98,18 @@
float: left;
padding-right: 10px;
+ .area_type {
+ width: 25px;
+ height: 64px;
+ float: left;
+ margin-right: 10px;
+
+
+ a {
+ text-decoration: none;
+ }
+ }
+
}
}
diff --git a/app/maps/stop_area_map.rb b/app/maps/stop_area_map.rb
index ecf94fc42..e0735e0a4 100644
--- a/app/maps/stop_area_map.rb
+++ b/app/maps/stop_area_map.rb
@@ -13,18 +13,12 @@ class StopAreaMap < ApplicationMap
def map
@map ||= MapLayers::Map.new(id, :projection => projection("EPSG:900913"), :controls => controls) do |map, page|
page << map.add_layer(MapLayers::OSM_MAPNIK)
+ page << map.add_layer(google_physical)
+ page << map.add_layer(google_streets)
+ page << map.add_layer(google_hybrid)
+ page << map.add_layer(google_satellite)
- stop_area.lines.each do |line|
- #page << map.add_layer(kml_layer(line, :styleMap => StyleMap::LineStyleMap.new({:line_color => line.color}).style_map))
- page << map.add_layer(kml_layer(polymorphic_path([referential, line, :stop_areas], :format => :kml), :styleMap => StyleMap::StopAreasStyleMap.new(true).style_map))
- end
-
- styles = {"default" => {:strokeColor => "red"},
- "select" => {:strokeColor => "red",
- :strokeWidth => 4}
- }
-
- page.assign "edit_stop_area_layer", kml_layer( polymorphic_path( [referential, stop_area], :format => :kml, :default => editable?), :style_map => StyleMap::StopAreasStyleMap.new(false, false, {}, styles).style_map)
+ page.assign "edit_stop_area_layer", kml_layer( polymorphic_path( [referential, stop_area], :format => :kml, :default => editable?), :style_map => StyleMap::StopAreasStyleMap.new.style_map)
page << map.add_layer(:edit_stop_area_layer)
# if editable?
diff --git a/app/maps/style_map/stop_areas_style_map.rb b/app/maps/style_map/stop_areas_style_map.rb
index 8bfeaa2df..468f670f2 100644
--- a/app/maps/style_map/stop_areas_style_map.rb
+++ b/app/maps/style_map/stop_areas_style_map.rb
@@ -16,8 +16,13 @@ class StyleMap::StopAreasStyleMap < StyleMap::GenericStyleMap
:labelAlign => "ct",
:labelXOffset => 0,
:labelYOffset => -15,
- :pointRadius => 16,
+ :pointRadius => 1,
:externalGraphic => "/assets/map/${areaType}.png",
+ :graphicWidth => 25,
+ :graphicHeight => 25,
+ :graphicOpacity => 1,
+ :graphicXOffset => 12.5,
+ :graphicYOffset => 12.5,
:display => true
}
@@ -37,8 +42,12 @@ class StyleMap::StopAreasStyleMap < StyleMap::GenericStyleMap
:labelAlign => "ct",
:labelXOffset => 0,
:labelYOffset => -15,
- :pointRadius => 16,
:externalGraphic => "/assets/map/${areaType}.png",
+ :graphicWidth => 25,
+ :graphicHeight => 25,
+ :graphicOpacity => 1,
+ :graphicXOffset => 12.5,
+ :graphicYOffset => 12.5,
:display => true
}
diff --git a/app/views/stop_areas/_stop_area.html.erb b/app/views/stop_areas/_stop_area.html.erb
index be230c931..56c153226 100644
--- a/app/views/stop_areas/_stop_area.html.erb
+++ b/app/views/stop_areas/_stop_area.html.erb
@@ -1,4 +1,9 @@
<%= div_for(stop_area) do %>
+ <%= link_to([@referential, stop_area], :class => "preview") do %>
+ <div class="area_type">
+ <%= image_tag "map/" + stop_area.area_type.to_s.downcase + ".png" %>
+ </div>
+ <% end %>
<%= link_to stop_area.name, [@referential, stop_area] %>
<div class="info">
<p>
@@ -6,9 +11,6 @@
<span class="warning"><%= t('.no_position') %></span> -
<% end %>
</p>
- <p>
- <%= stop_area.street_name %> <%= stop_area.country_code %>
- </p>
<p>
<%= t('.lines') %> <% stop_area.lines.each do |line| %>
<span class="line"><%= line.number %></span>
diff --git a/app/views/stop_areas/show.kml.erb b/app/views/stop_areas/show.kml.erb
index 661144f4a..f30597f24 100644
--- a/app/views/stop_areas/show.kml.erb
+++ b/app/views/stop_areas/show.kml.erb
@@ -3,6 +3,7 @@
<Document>
<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>
</Document>