Permalink
Browse files

updated generate map code for cables, markers and lines

  • Loading branch information...
1 parent f09191d commit 14116d6fbd9af878ee547b9b091720b343bef43f @alonswartz alonswartz committed Dec 27, 2011
Showing with 9 additions and 5 deletions.
  1. +6 −4 generate.py
  2. +3 −1 input/map.html.tmpl
View
@@ -91,8 +91,8 @@ def write_index(self, tag, filepath):
fd.close()
- def write_map(self, template, output):
- """generate map from template"""
+ def write_map(self, template, cables, output):
+ """generate map from template (cables, markers, lines)"""
t = Template(file(template).read())
# markers
@@ -114,7 +114,9 @@ def write_map(self, template, output):
r = self.regions[e.region]
lines.append(line.substitute(num=n, e_ll=e.latlon, r_ll=r.latlon))
- html = t.substitute(MARKERS="\n".join(markers), LINES="\n".join(lines) )
+ html = t.substitute( CABLES=file(cables).read(),
+ MARKERS="\n".join(markers),
+ LINES="\n".join(lines) )
fd = open(output, 'w')
fd.write(html)
@@ -143,7 +145,7 @@ def main():
entries.write_index("usa", "output/usa.index")
entries.write_index("countries", "output/countries.index")
- entries.write_map("input/map.html.tmpl", "output/map.html")
+ entries.write_map("input/map.html.tmpl", "input/cables", "output/map.html")
if __name__ == "__main__":
View
@@ -257,7 +257,9 @@ function initialize() {
mapTypeId: google.maps.MapTypeId.TERRAIN };
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
- // MAPPING DATA GOES HERE
+ ${CABLES}
+ ${MARKERS}
+ ${LINES}
for (var l=0;l<landings.length;l++) {
var land = landings[l];

0 comments on commit 14116d6

Please sign in to comment.