blob: a2e3cff6195a759d46a07a0d06847d9d8111516a (
plain)
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
|
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<title>reaspect | $.geo</title>
<meta name="description" content="jQuery Geo reaspect method">
<meta name="author" content="Ryan Westphal">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../css/style.css?v=2">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
</head>
<body>
<div id="reaspect" data-role="page">
<div data-role="header" data-theme="b">
<h1>reaspect</h1>
</div>
<div data-role="content">
<table>
<tr>
<th>return type</th>
<td>Array ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ) </td>
</tr>
<tr>
<th>syntax</th>
<td>$.geo.reaspect( Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ), Number ratio )</td>
</tr>
<tr>
<th>usage</th>
<td><pre><code>var widescreenBbox = $.geo.reaspect( bbox, 16 / 9 )</pre></code></td>
</tr>
</table>
<p>The reaspect method creates a new bbox with the same center as the original but forcing the ratio of width to height to a specific value.</p>
<p>If the original width is greater than the original height (think a landscape printout) then the width of the new bbox will be the same as the original but the new height will change to fit the ratio. If the original height is greater than the original width (think a portrait printout) then the new bbox height will remain unchanged but the width will to fit the ratio.</p>
<p>This function is not defined in JTS.</p>
</div>
</div> <!-- end of #container -->
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquerygeo.com/jquery.geo-1.0a4.min.js"></script>
<script src="../js/script.js"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</body>
</html>
|