Permalink
Browse files

removed dead code

  • Loading branch information...
trey0 committed Nov 1, 2012
1 parent 53de8c0 commit 7e192f1e708a96f6878b2339c6b9fbd27ef9138b
@@ -1,152 +0,0 @@
-// __BEGIN_LICENSE__
-// Copyright (C) 2008-2010 United States Government as represented by
-// the Administrator of the National Aeronautics and Space Administration.
-// All Rights Reserved.
-// __END_LICENSE__
-
-if (! window.geocamTiePoint) { window.geocamTiePoint = {}; }
-
-/* draggableOverlay.js exports the following symbols to the geocamTiePoint
- * namespace:
- *
- * geocamTiePoint.DraggableOverlay class
- *
- */
-
-(function() {
-
- // helpful examples:
- //
- // http://code.google.com/p/overlay-tiler/source/browse/static/overlay.js
- // http://techylinguist.com/posts/2012/02/03/google-maps-overlay-js-coffeescript/
-
- function getCssMatrix(transform) {
- // returns the css matrix specification for the specified
- // transform. transform should be a 3 x 3 matrix that maps from
- // overlay pixel coordinates to draggable map DOM element pixel
- // coordinates.
-
- return ('matrix(' +
- [transform.values[0][0],
- transform.values[1][0],
- transform.values[0][1],
- transform.values[1][1],
- transform.values[0][2],
- transform.values[1][2]] +
- ')');
- }
-
- function getMercatorToDivTransform(proj) {
- // returns a transform matrix that maps from EPSG:900913
- // spherical mercator coordinates to draggable map DOM element
- // pixel coordinates.
-
- // pick arbitrary coordinates as samples for linear fit
- var ne = new google.maps.LatLng(30, 30);
- var sw = new google.maps.LatLng(0, 0);
-
- var neDiv = proj.fromLatLngToDivPixel(ne);
- var swDiv = proj.fromLatLngToDivPixel(sw);
- var divSize = {
- x: neDiv.x - swDiv.x,
- y: neDiv.y - swDiv.y
- };
-
- var neMeters = latLonToMeters(ne);
- var swMeters = latLonToMeters(sw);
- var meterSize = {
- x: neMeters.x - swMeters.x,
- y: neMeters.y - swMeters.y
- };
-
- var scale = {
- x: (divSize.x / meterSize.x),
- y: (divSize.y / meterSize.y)
- };
- var translation = {
- x: (neDiv.x - neMeters.x * scale.x),
- y: (neDiv.y - neMeters.y * scale.y)
- };
-
- return new Matrix(3, 3,
- [[scale.x, 0, translation.x],
- [0, scale.y, translation.y],
- [0, 0, 1]]);
- }
-
- var DraggableOverlay = function(imageUrl, alignTransform, opts) {
- var el = this.el_ = document.createElement('img');
- // el.style.width = el.style.height = '1px';
- el.onload = this.setup_.bind(this);
- el.src = imageUrl;
- el.style.position = 'absolute';
- el.style.webkitTransformOrigin = '0 0';
- el.style.opacity = '0.5';
-
- this.alignTransform = alignTransform;
- this.opts = opts;
- };
-
- DraggableOverlay.prototype = new google.maps.OverlayView;
-
- DraggableOverlay.prototype.setup_ = function() {
- if (!this.added_) {
- window.setTimeout(this.setup_.bind(this), 50);
- return;
- }
-
- this.getPanes().overlayImage.appendChild(this.el_);
- this.retriggerDom_('mousedown');
- this.retriggerDom_('mouseup');
- };
-
- var requestAnimFrame = window.requestAnimationFrame ||
- window.webkitRequestAnimationFrame ||
- window.mozRequestAnimationFrame;
-
- DraggableOverlay.prototype.draw = function() {
- if (!this.added_) {
- // not ready yet
- return;
- }
- requestAnimFrame(this.draw_.bind(this), this.el_);
- };
-
- DraggableOverlay.prototype.draw_ = function() {
- this.el_.style.webkitTransform = this.computeTransform_();
- };
-
- DraggableOverlay.prototype.computeTransform_ = function() {
- var mercatorToDivTransform =
- getMercatorToDivTransform(this.getProjection());
- var T = mercatorToDivTransform.multiply(this.alignTransform);
- return getCssMatrix(T);
- };
-
- DraggableOverlay.prototype.onAdd = function() {
- this.added_ = true;
- };
-
- DraggableOverlay.prototype.onRemove = function() {
- this.el_.parentNode.removeChild(this.el_);
- };
-
- DraggableOverlay.prototype.retriggerDom_ = function(eventName) {
- var that = this;
- this.el_.addEventListener(eventName, function(e) {
- google.maps.event.trigger(that, eventName, e);
- });
- };
-
- DraggableOverlay.prototype.changed = function() {
- google.maps.event.trigger(this, 'change');
- this.draw();
- };
-
- /**********************************************************************
- * EXPORTS
- **********************************************************************/
-
- geocamTiePoint.DraggableOverlay = DraggableOverlay;
-
-})();
@@ -1,33 +0,0 @@
-// __BEGIN_LICENSE__
-// Copyright (C) 2008-2010 United States Government as represented by
-// the Administrator of the National Aeronautics and Space Administration.
-// All Rights Reserved.
-// __END_LICENSE__
-
-var angle = 0;
-
-/*
-function saveImage() {
- $.post('',{'angle':angle})
- .success(function (data, status, jqXHR) {
- var json = data;
- $("#rotate_image").src = json.imageUrl;
- })
-}
-*/
-function rotateLeftButtonClicked() {
- angle = angle - 90;
- (document
- .getElementById('rotate_image')
- .style['-webkit-transform'] = 'rotate(' + angle + 'deg)');
-
- $('#angle_value').val(angle);
-}
-
-function rotateRightButtonClicked() {
- angle = angle + 90;
- (document
- .getElementById('rotate_image')
- .style['-webkit-transform'] = 'rotate(' + angle + 'deg)');
- $('#angle_value').val(angle);
-}
@@ -1,40 +0,0 @@
-{% load templatetag_handlebars %}
-
-{% comment %}
-Handlebar templates go here. e.g.:
-{% tplhandlebars "tpl-infos" %}
- {{total}} {% trans "result(s)." %}
- <p>{% trans "Min" %}: {{min}}</p>
- <p>{% trans "Max" %}: {{max}}</p>
-{% endtplhandlebars %}
-{% endcomment %}
-
-{% comment %}{% tplhandlebars "_application" %}{% endcomment %}
-{% verbatim %}
-<script type="text/x-handlebars" data-template-name="_application">
- <span class="debug">This is the Application Template</span>
-</script>
-{% endverbatim %}
-{% comment %}{% endtplhandlebars %}{% endcomment %}
-
-{% comment %}{% tplhandlebars "overlay_list" %}{% endcomment %}
-{% verbatim %}
-<script type="text/x-handlebars" data-template-name="overlay_list">
- <span class="debug">This is OverlayList</span>
- <ul id="overlay_list">
- {{#each overlay in controller}}
- <li><a {{action showOverlayAction overlay target="App.router" href=true}}>{{overlay.name}}</a></li>
- {{/each}}
- </ul>
-</script>
-{% endverbatim %}
-{% comment %}{% endtplhandlebars %}{% endcomment %}
-
-{% comment %}{% tplhandlebars "overlay_align" %}{% endcomment %}
-{% verbatim %}
-<script type="text/x-handlebars" data-template-name="overlay_align">
- <span class="debug">This is overlay_align</span>
- <div class="map" id="map_canvas"></div>
-</script>
-{% endverbatim %}
-{% comment %}{% endtplhandlebars %}{% endcomment %}
@@ -1,8 +0,0 @@
-{% extends "base.html" %}
-{% block head %}
-<title>Success!</title>
-{% endblock %}
-{% block contents %}
-<p>Successfully created new overlay! Click <a href="{% url geocamTiePoint_overlayId id %}">here</a> to continue.<br>
- (Status: {{ status }})</p>
-{% endblock %}
@@ -1,11 +0,0 @@
-{% extends "base.html"%}
-{% block head %}
-<title>Create New Overlay</title>
-{% endblock %}
-{% block contents %}
-<form enctype="multipart/form-data" action="new.html" method="post">
- {% csrf_token %}
- {{ form.as_p }}
- <input type="submit" value="Submit" />
-</form>
-{% endblock %}
@@ -1,19 +0,0 @@
-{% extends "base.html" %}
-
-{% block head %}
-<title>Overlay Index</title>
-{% endblock head %}
-
-{% block contents %}
-<h3>Overlays</h3>
-<div style="margin-bottom:8px;">[<a href="{% url geocamTiePoint_overlayNew %}">New Overlay</a>]</div>
-<table>
- {% for overlay in overlays %}
- <tr>
- <td><a href="{% url geocamTiePoint_overlayId key=overlay.key %}">{{ overlay.name }}</a></td>
- <td><a href="{% url geocamTiePoint_overlayId key=overlay.key %}">edit</a></td>
- <td><a href="{% url geocamTiePoint_overlayDelete key=overlay.key %}">delete</a></td>
- </tr>
- {% endfor %}
-</table>
-{% endblock contents %}
@@ -1,41 +0,0 @@
-{% extends "base.html" %}
-
-{% block head %}
-<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
-{% endblock head %}
-
-{% block style %}
-{{ block.super }}
-<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}geocamTiePoint/css/overlay-view.css"></link>
-{% endblock style %}
-
-{% block scripts %}
-{{ block.super }}
-<script type="text/javascript">
- var overlay = {{ overlayJson|safe }};
- var settings = {{ settings|safe }};
-</script>
-<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true&libraries=places"></script>
-<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
-<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}external/js/markerwithlabel.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}external/js/ExtDraggableObject.js"></script>
-
-<script type="text/javascript" src="{{ STATIC_URL }}geocamTiePoint/js/util.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}geocamTiePoint/js/coords.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}geocamTiePoint/js/overlay-preview.js"></script>
-{% endblock scripts %}
-
-{% block jsInit %}
-initialize();
-{% endblock jsInit %}
-
-{% block contents %}
-<div class="top">
- <div class="action_section" style="float:left;">
- <input type="button" value="export" onClick="window.location='{% url geocamTiePoint_overlayExportInterface overlay.key %}'" />
- </div>
-</div>
-<div id="map_canvas" style="width:100%; height:100%;"></div>
-{% endblock contents %}
@@ -1,60 +0,0 @@
-{% extends "base.html" %}
-
-{% block head %}
-<title>{{ overlay.name }}</title>
-<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
-{% endblock head %}
-
-{% block style %}
-{{ block.super }}
-<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}geocamTiePoint/css/overlay-view.css"></link>
-{% endblock style %}
-
-{% block contents %}
-<div class="top">
- <input type="text" id="title" class="title" value="{{ overlay.name }}" /><br>
- <div class="action_section" style="float:left;">
- <input type="text" id="searchTextField" class="searchTextField">
- <span style="padding-right: 100px;"></span>
- <input type="button" id="save_button" value="save" onClick="saveButtonClicked()">
- <input type="button" id="warp_button" value="warp" onClick="warpButtonClicked({{ overlay.key }})" />
- <input type="button" value="preview" onClick="window.location='/overlay/{{overlay.key}}/preview.html'" />
- <input type="button" value="export" onClick="window.location='{% url geocamTiePoint_overlayExportInterface overlay.key %}'" />
- <input type="button" value="reset" onClick="resetButtonClicked()" />
- <input type="button" value="undo" onClick="undo()" />
- <input type="button" value="redo" onClick="redo()" />
- </div>
-</div>
-<table class="map_area">
- <tr>
- <td><div class="map" id="map_canvas"></div></td>
- <td><div class="map" id="image_canvas"></div></td>
- </tr>
-</table>
-<div class="bottom">
-
-</div>
-{% endblock contents %}
-
-{% block scripts %}
-{{ block.super }}
-<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true&libraries=places"></script>
-<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
-<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}external/js/markerwithlabel.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}external/js/matrix.js"></script>
-
-<script type="text/javascript" src="{{ STATIC_URL }}geocamTiePoint/js/optimize.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}geocamTiePoint/js/transform.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}geocamTiePoint/js/util.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}geocamTiePoint/js/coords.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}geocamTiePoint/js/undo.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL }}geocamTiePoint/js/overlay-view.js"></script>
-{% endblock scripts %}
-
-{% block jsInit %}
- var overlay = {{ overlayJson|safe }};
- var settings = {{ settings|safe }};
- $(initialize);
-{% endblock %}
Oops, something went wrong.

0 comments on commit 7e192f1

Please sign in to comment.