Skip to content

Commit

Permalink
Update partner map.
Browse files Browse the repository at this point in the history
  • Loading branch information
kimadactyl committed Oct 19, 2018
1 parent 43880f0 commit 8d93fc4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/components/map/_map.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
var markerArray = []
<% markers.each do |m| %>
marker = L.marker(<%= [m[:lat], m[:lon]] %>, {icon: mapIcon}).addTo(map);
marker.bindPopup("<a href='/places/<%= m[:id] %>'><%= m[:name] %></a>", { permanent: true, closeButton: false });
marker.bindPopup("<a href='/partners/<%= m[:id] %>'><%= m[:name] %></a>", { permanent: true, closeButton: false });
markerArray.push(marker);
<% end %>

Expand Down
6 changes: 5 additions & 1 deletion app/components/map/map_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ def zoom
end

def styles
if markers.length > 1 || properties[:style] == :full
if properties[:style] == :full
' map--multiple'
elsif properties[:style] == :single
' map--single'
elsif markers.length > 1
' map--multiple'
else
' map--single'
Expand Down
2 changes: 1 addition & 1 deletion app/views/partners/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<% end %>
<% if @map.length > 0 %>
<%= render_component "map", points: @map, site: @current_site.slug %>
<%= render_component "map", points: @map, site: @current_site.slug, style: :single %>
<% end %>
</div>
</div>
Expand Down

0 comments on commit 8d93fc4

Please sign in to comment.