Skip to content

Commit

Permalink
templates.flights.[view|map]: remove obsolete add_trace code
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasLohner committed Jul 15, 2012
1 parent 3b66a02 commit a6399a8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 59 deletions.
27 changes: 0 additions & 27 deletions skylines/public/js/flight.js
Expand Up @@ -274,33 +274,6 @@ function addContest(name, lonlat, times, visible) {
return markers;
}

/**
* Function: addTrace
*
* Add a flight trace optimization path to the map.
*
* Parameters:
* lonlat - {Array(Object)} Array of LonLat pairs
*/

function addTrace(lonlat, color) {
var points = new Array();
for (var i = 0, len = lonlat.length; i < len; i++) {
points.push(new OpenLayers.Geometry.Point(lonlat[i][0], lonlat[i][1]).
transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) );
}

var trace = new OpenLayers.Geometry.LineString(points);
trace.clip = 1;

//var color = colors[0];
var feature = new OpenLayers.Feature.Vector(trace, { color: color });
feature.renderIntent = 'trace';

map.getLayersByName("Flight")[0].addFeatures(feature);
};


/**
* Function: getAllFlightsBounds
*
Expand Down
16 changes: 0 additions & 16 deletions skylines/templates/flights/map.html
@@ -1,18 +1,5 @@
<?python
page = 'flights'

def add_trace_turnpoints(turnpoints):
def jsonify(location):
return '[{},{}]'.format(location.longitude, location.latitude)

return ','.join([jsonify(location) for location in turnpoints.locations])

def add_trace(contest_type, trace_type, color):
trace_turnpoints = flight.get_optimised_contest_trace(contest_type, trace_type)
if trace_turnpoints is None:
return None

return 'addTrace([{}], "{}");'.format(add_trace_turnpoints(trace_turnpoints), color);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Expand Down Expand Up @@ -64,9 +51,6 @@
${h.json.dumps(trace.contests)}
);

${add_trace('olc_plus', 'classic', '#FF2C73')}
${add_trace('olc_plus', 'triangle', '#9F14FF')}

/* ]]> */
<py:if test="defined('other_flights')">
<py:for each="flight, trace in other_flights">
Expand Down
16 changes: 0 additions & 16 deletions skylines/templates/flights/view.html
@@ -1,18 +1,5 @@
<?python
page = 'flights'

def add_trace_turnpoints(turnpoints):
def jsonify(location):
return '[{},{}]'.format(location.longitude, location.latitude)

return ','.join([jsonify(location) for location in turnpoints.locations])

def add_trace(contest_type, trace_type, color):
trace_turnpoints = flight.get_optimised_contest_trace(contest_type, trace_type)
if trace_turnpoints is None:
return None

return 'addTrace([{}], "{}");'.format(add_trace_turnpoints(trace_turnpoints), color);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Expand Down Expand Up @@ -64,9 +51,6 @@
${h.json.dumps(trace.contests)}
);

${add_trace('olc_plus', 'classic', '#FF2C73')}
${add_trace('olc_plus', 'triangle', '#9F14FF')}

/* ]]> */
<py:if test="defined('other_flights')">
<py:for each="flight, trace in other_flights">
Expand Down

0 comments on commit a6399a8

Please sign in to comment.