Skip to content

Instantly share code, notes, and snippets.

@maletor
Created July 28, 2011 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maletor/1112701 to your computer and use it in GitHub Desktop.
Save maletor/1112701 to your computer and use it in GitHub Desktop.
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<%= include_javascripts :maptastic %>
<script type="text/javascript">
$j(window).load(function() {
initializeMap();
<% @pharmacies.each do |pharmacy| -%>
<% unless pharmacy.lat.nil? || pharmacy.lon.nil? -%>
// addMarker(new google.maps.LatLng(<%= pharmacy.lat -%>, <%= pharmacy.lon -%>), '<%= escape_javascript h pharmacy.name -%>', '<%= escape_javascript h pharmacy_info_window(pharmacy) -%>');
<% end -%>
<% end -%>
// addMarker(new google.maps.LatLng(<%= current_account.user.lat -%>, <%= current_account.user.lon -%>));
// $j('#pharmacies_form').maptasticMode(<%= params[:page].to_i || 1 %>);
});
</script>
var map;
var markersArray = [];
var bounds = new google.maps.LatLngBounds();
var infoWindow = new google.maps.InfoWindow({ content: "loading..." });
function initializeMap() {
var mapOptions = {
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_div"), mapOptions);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment