Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. %script{:src => "//maps.google.com/maps/api/js?v=3.13&sensor=false&libraries=geometry", :type => "text/javascript"}
  2. %script{:src => "//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.14/src/markerclusterer_packed.js", :type => "text/javascript"}
  3.  
  4. ........
  5.  
  6. .col-lg-8.col-sm-8.col-md-8.col-xs-12
  7. #map
  8. %br/
  9.  
  10. ......
  11.  
  12. :javascript
  13. handler = Gmaps.build('Google');
  14. handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
  15. markers = handler.addMarkers(#{raw @hash.to_json});
  16. handler.bounds.extendWith(markers);
  17. handler.fitMapToBounds();
  18. handler.getMap().setZoom(16);
  19. });
  20.  
  21. def show
  22. set_park
  23. @hash = Gmaps4rails.build_markers(@park) do |park, marker|
  24. marker.lat park.latitude
  25. marker.lng park.longitude
  26. marker.infowindow park.address
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement