Advertisement
Guest User

Untitled

a guest
Aug 4th, 2010
1,197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Smarty 0.84 KB | None | 0 0
  1. {literal}
  2. <script language="javascript">
  3.  
  4.  
  5.    google.load('visualization','1',{'packages': ['geomap']});
  6.    google.setOnLoadCallback(drawMap);
  7.  
  8.  
  9.     function drawMap() {
  10.       var data = new google.visualization.DataTable();
  11.       data.addRows(4);
  12.       data.addColumn('string', 'Location');
  13.       data.addColumn('number', 'Number of links');
  14.  
  15. {/literal}{foreach from=$last5 item=link name=links key=index}
  16. data.setValue({$index},0,'{$link.location|replace:'\'':'\\\''}');
  17. data.setValue({$index},1,{$link.location_count});
  18. {/foreach}{literal}
  19.  
  20.  
  21.      var options = {};
  22.       options['dataMode'] = 'regions';
  23.         options['region'] = 'world';
  24.  
  25.  
  26.       var container = document.getElementById('map');
  27.       var geomap = new google.visualization.GeoMap(container);
  28.  
  29.       geomap.draw(data, options);
  30.   };
  31.  
  32. </script>
  33. {/literal}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement