Skip to content

Commit

Permalink
fix function name embedding, adding some unused coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
gabor committed Jul 30, 2010
1 parent e33320e commit ee341a4
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 18 deletions.
13 changes: 13 additions & 0 deletions bin/xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ my %ids;

$| = 1;


my %map_coordinates = (
africa => [20, 0, 8],
asia => [95, 45, 8],
central_america => [9, 10, 8],
europe => [15.029297, 49.61071, 8],
north_america => [10, 10, 8],
oceania => [134.296875, -25.641526, 8],
south_america => [-63.63, -25.00, 8],
);



my $tt = Template->new({
PRE_PROCESS => [ 'lib/macros' ],
POST_CHOMP => 1,
Expand Down
4 changes: 3 additions & 1 deletion lib/layout
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
title="basic" />
<link rel="shortcut icon" href="/groups/favicon.ico">
<!-- This key good for http://www.pm.org/groups -->
<script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=1&amp;key=ABQIAAAAjrB1EtK9LGPa_E4v8BqfIhTlJQKl_2NMosGPJ4kJAF_u_Vcv4hQ6A7lpErcC3Q23mBu5eRPQ_SGvBA&amp;sensor=false"></script>
<script type="text/javascript"
src="http://maps.google.com/maps?file=api&amp;v=1&amp;key=ABQIAAAAjrB1EtK9LGPa_E4v8BqfIhTlJQKl_2NMosGPJ4kJAF_u_Vcv4hQ6A7lpErcC3Q23mBu5eRPQ_SGvBA&amp;sensor=false">
</script>

<script type="text/javascript" src="/groups/map.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions src/groups/continent.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[%
WRAPPER layout title = "Perl Mongers: $continent"
onload="initialize()"
onunload="GUnload()"
onload="initialize"
onunload="GUnload"
%]

<script type="text/javascript">
Expand Down
4 changes: 2 additions & 2 deletions src/groups/country.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[%
WRAPPER layout title = "Perl Mongers: $continent"
onload="initialize()"
onunload="GUnload()"
onload="initialize"
onunload="GUnload"
%]

<script type="text/javascript">
Expand Down
4 changes: 2 additions & 2 deletions src/groups/group.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[% title = name _ " (" _ location _ ") Perl Mongers" | html_entity;
subtitle = name;
WRAPPER layout title = title
onload="initialize()"
onunload="GUnload()"
onload="initialize"
onunload="GUnload"
%]

<script type="text/javascript">
Expand Down
31 changes: 20 additions & 11 deletions src/groups/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ var asia = new GPoint(95, 45);
var africa = new GPoint(20, 0);
var sa = new GPoint(-63.63, -25.00);



var map;
function onLoad() {
// Center the map
Expand Down Expand Up @@ -75,17 +77,24 @@ function initialize() {
max: coords[0][1],
min: coords[0][1],
}
for(i = 1; i < coords.length; i++) {
latitude['min'] = Math.min(coords[i][0], latitude['min']);
latitude['max'] = Math.max(coords[i][0], latitude['max']);
longitude['min'] = Math.min(coords[i][1], longitude['min']);
longitude['max'] = Math.max(coords[i][1], longitude['max']);
}
//var zoom = 13; // TODO should be calculated?
//alert(longitude['min'] + " " + longitude['max']);
//alert(latitude['min'] + " " + latitude['max']);
longitude['center'] = (longitude['max'] + longitude['min'])/2;
latitude['center'] = (latitude['max'] + latitude['min'])/2;
// if (map_coordinates[file_name]) {
// longitude['center'] = map_coordinates[file_name][0];
// latitude['center'] = map_coordinates[file_name][1];
// zoom = map_coordinates[file_name][2];
// } else {
// for(i = 1; i < coords.length; i++) {
// latitude['min'] = Math.min(coords[i][0], latitude['min']);
// latitude['max'] = Math.max(coords[i][0], latitude['max']);
// longitude['min'] = Math.min(coords[i][1], longitude['min']);
// longitude['max'] = Math.max(coords[i][1], longitude['max']);
// }

//var zoom = 13; // TODO should be calculated?
//alert(longitude['min'] + " " + longitude['max']);
//alert(latitude['min'] + " " + latitude['max']);
longitude['center'] = (longitude['max'] + longitude['min'])/2;
latitude['center'] = (latitude['max'] + latitude['min'])/2;
// }

if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map-canvas"));
Expand Down

0 comments on commit ee341a4

Please sign in to comment.