/
snippets
34 lines (28 loc) · 1.75 KB
/
snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!-- Removed dropdown list for now -->
<!-- <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Location <span class="caret"></span></a>
<ul class="dropdown-menu">
<% @countries.each do |country| %>
<li> <%= link_to country, filter_tours_path(country: country) %> </li>
<% end %>
</ul>
</li> -->
// This was started to center the map on the location between start and finish.
// var centerLat = @tour.start_location.latitude - @tour.finish_location.latitude
// var centerLong = @tour.start_location.longitude - @tour.finish_location.longitude
// <%= if centerLat < 0? x = -1 : x = 1 %>
// <%= x = -1 %>
// <%= else %>
// <%= x = 1 %>
// <% end %>
//
// <%= if centerLong < 0 %>
// <%= y = -1 %>
// <%= else %>
// <%= y = 1 %>
// <% end %>
//
// var centerLatLng = {lat: <%= @tour.start_location.latitude + (x * ((@tour.start_location.latitude - @tour.finish_location.latitude).abs)/2) %>, lng: <%= @tour.start_location.longitude + ((@tour.start_location.longitude - @tour.finish_location.longitude).abs)/2 * y) %>};
//
<!-- <%= centerLat = ((@tour.start_location.latitude - @tour.finish_location.latitude).abs)/2 + @tour.start_location.latitude %>
<%= centerLong = ((@tour.start_location.longitude - @tour.finish_location.longitude).abs)/2 + @tour.start_location.longitude %>}; -->