Sha256: 92ec20db48428bfed536443b6bca7de3fb8682580e4ffa6094441153188342f8

Contents?: true

Size: 1.99 KB

Versions: 2

Compression:

Stored size: 1.99 KB

Contents

<% content_for(:head) do %>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"> </script>
<script type="text/javascript" src="/javascripts/gmaps4rails.js"> </script>
<script type="text/javascript">
	var gmaps4rails_map;
	var gmaps4rails_Options;
	var gmaps4rails_ctaLayer;
	var gmaps4rails_model;

	jQuery(document).ready(function() {
		gmaps4rails_init("User");
	});


  function gmaps4rails_init(model) {
	  gmaps4rails_model = model;
	  var myLatLng = new google.maps.LatLng(0,0);
	  gmaps4rails_Options = {
	  	    zoom: 0,
	  	    center: myLatLng,
	  	    mapTypeId: google.maps.MapTypeId.ROADMAP
	    	  }
	  gmaps4rails_map = new google.maps.Map(document.getElementById("gmaps4rails_canvas"), gmaps4rails_Options);
		create_map();
}

	function create_map(filter_value) {
		var date = new Date();
		//adding the date (which is a unique parameter, enables to bypass google map's cache on google server)
		var request = 'http://furious-robot-66.heroku.com/gmaps.xml?model=' + gmaps4rails_model + '&time=' + date.getTime();
		if (!(filter_value == null))
			{
			split_filter_value = filter_value.split('+');
			if (!(split_filter_value[0] == null))
				{
					request += '&filter=' + split_filter_value[0];
				}
			if (!(split_filter_value[1] == null))
				{
				request += '&options=' + split_filter_value[1];
				}
			}
	  gmaps4rails_ctaLayer = new google.maps.KmlLayer(request);
	  gmaps4rails_ctaLayer.setMap(gmaps4rails_map);
	}

	function gmaps4rails_raz(){
	  gmaps4rails_map = new google.maps.Map(document.getElementById("gmaps4rails_canvas"), gmaps4rails_myOptions);
  }

function gmaps4rails_resfreshmap()
   {
	 gmaps4rails_raz();
   var index = document.gmaps4rails_form.gmaps4rails_list.selectedIndex;
   var filter_value = document.gmaps4rails_form.gmaps4rails_list.options[index].value;
	 create_map(filter_value);
   }
</script>
<% end %>

<div id="gmaps4rails_canvas" style="width:100%; height:100%"></div>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gmaps4rails-0.0.13 app/views/gmaps4rails/_map.html.erb
gmaps4rails-0.0.12 app/views/gmaps4rails/_map.html.erb