/usr/share/doc/libjs-jquery-geo-doc/html/examples/geometry.html is in libjs-jquery-geo-doc 1.0~b1+ds1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>proj test</title>
<meta name="description" content="Small test of $.geo.proj">
<meta name="author" content="Ryan Westphal">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<style type="text/css">
label
{
display: block;
margin: .25em;
}
label span
{
display: inline-block;
font-weight: bold;
width: 8em;
}
#lblStatus
{
background: #ee4;
border-radius: .5em;
padding: .5em;
}
</style>
</head>
<body>
<div>
<a href="../" class="docLink">< docs</a>
<h1>
proj test</h1>
<p>
This page has a couple basic interactive tests of the default $.geo.proj object.</p>
<h2>
direct conversion</h2>
<p>
Enter a lon/lat in the top inputs (remember, longitude is first here and throughout jQuery Geo but usually spoken second) & click fromGeodetic to convert it to web mercator and store the new values in the bottom two inputs. Click toGeodetic to reverse.</p>
<label>
<span>longitude</span>
<input type="text" id="txtLon" value="-71.0597732" />
</label>
<label>
<span>latitude</span>
<input type="text" id="txtLat" value="42.3584308" />
</label>
<button type="button" id="cmdFrom">
\/ fromGeodetic</button>
<button type="button" id="cmdTo">
/\ toGeodetic</button>
<label>
<span>web mercator x</span>
<input type="text" id="txtX" value="-7910337.768509507" />
</label>
<label>
<span>web mercator y</span>
<input type="text" id="txtY" value="5214822.77694091" />
</label>
<h2>
osm nominatim</h2>
<p>
Enter a search term in the input and click search. If successful, geodetic & web mercator coordinates are written to the inputs above. This example uses MapQuest's OSM API: <a href="http://open.mapquestapi.com/nominatim/">http://open.mapquestapi.com/nominatim</a>.</p>
<label>
<span>query</span>
<input type="text" id="txtQuery" value="Boston,MA" />
</label>
<button type="button" id="cmdSearch">search</button>
<h2>
status</h2>
<p>
Status result for any test.</p>
<div id="lblStatus">
ready</div>
</div>
<script src="/usr/share/javascript/jquery/jquery.min.js"></script>
<script src="/usr/share/javascript/excanvas/excanvas.min.js"></script>
<script src="/usr/share/javascript/jsrender/jsrender.min.js"></script>
<script src="/usr/share/javascript/jquery-mousewheel/jquery.mousewheel.min.js"></script>
<script src="/usr/share/javascript/jquery-ui/ui/jquery.ui.widget.min.js"></script>
<script src="/usr/share/javascript/jquery-geo/jquery.geo.full.min.js"></script>
<script>
$(function () {
$("#cmdFrom").click(function () {
try {
var projected = $.geo.proj.fromGeodetic([[parseFloat($("#txtLon").val()), parseFloat($("#txtLat").val())]]);
$("#txtX").val(projected[0][0])
$("#txtY").val(projected[0][1])
$("#lblStatus").html("done " + (new Date()).toString());
} catch (e) {
$("#lblStatus").html("error" + e.toString());
}
});
$("#cmdTo").click(function () {
try {
var geodetic = $.geo.proj.toGeodetic([[parseFloat($("#txtX").val()), parseFloat($("#txtY").val())]]);
$("#txtLon").val(geodetic[0][0])
$("#txtLat").val(geodetic[0][1])
$("#lblStatus").html("done " + (new Date()).toString());
} catch (e) {
$("#lblStatus").html("error" + e.toString());
}
});
$("#cmdSearch").click(function () {
try {
var query = "http://open.mapquestapi.com/nominatim/v1/search?format=json&q=" + $("#txtQuery").val();
$.ajax({
url: query,
dataType: "jsonp",
jsonp: "json_callback",
success: function (result) {
if (result && result.length > 0) {
$("#txtLon").val(result[0].lon)
$("#txtLat").val(result[0].lat)
var projected = $.geo.proj.fromGeodetic([[result[0].lon, result[0].lat]]);
$("#txtX").val(projected[0][0])
$("#txtY").val(projected[0][1])
$("#lblStatus").html("done " + (new Date()).toString());
} else {
$("#lblStatus").html("nothing found :(");
}
},
error: function (xhr) {
$("#lblStatus").html(xhr.statusText);
}
});
} catch (e) {
$("#lblStatus").html("error" + e.toString());
}
});
});
</script>
</body>
</html>
|