Няма описание http://j1x-huginn.herokuapp.com

_show.html.erb 1.0KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
  2. <h3>Recent Event Map</h3>
  3. <% events = @agent.events.with_location.order("id desc").limit(500) %>
  4. <% if events.length > 0 %>
  5. <div id="map_canvas" style="width:800px; height:800px"></div>
  6. <script type="text/javascript">
  7. var mapOptions = {
  8. center: new google.maps.LatLng(<%= events.first.lat %>, <%= events.first.lng %>),
  9. zoom:15,
  10. mapTypeId:google.maps.MapTypeId.ROADMAP
  11. };
  12. var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
  13. </script>
  14. <% events.each do |event| %>
  15. <%= render "shared/map_marker", event: event %>
  16. <% end %>
  17. <% else %>
  18. <p>
  19. No events found.
  20. </p>
  21. <% end %>
  22. <h3>POST URL</h3>
  23. <p>
  24. Location data containing <code>latitude</code> and <code>longitude</code> can be posted to this URL:<br/>
  25. <ul>
  26. <li><code class="selectable-text"><%= web_requests_url(user_id: @agent.user_id, agent_id: @agent.id, secret: @agent.options['secret']) %></code></li>
  27. </ul>
  28. </p>