/
isGeodetic.html
70 lines (65 loc) · 2.78 KB
/
isGeodetic.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>TEMPLATE example</title>
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
<meta name="description" content="An example of TEMPLATE">
<meta name="author" content="Ryan Westphal">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<style type="text/css">
#map
{
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
</style>
</head>
<body>
<div>
<div id="map">
</div>
<div class="info">
<div class="links">
<a href="../" class="docLink">< docs</a>
<a href="http://jsfiddle.net/ryanttb/==JSFIDDLE==/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle ></a>
</div>
<h1>Is Geodetic?</h1>
<table class="tests">
<tr><th>[-71.05, 42.36]</th><td></td></tr> <!-- position / Point -->
<tr><th>[-8102018.97, 5011809.33]</th><td></td></tr>
<tr><th>[-72.78, 40.99, -69.33, 43.69]</th><td></td></tr> <!-- bbox -->
<tr><th>[-8102018.97, 5011809.33, -7718610.83, 5418454.32]</th><td></td></tr>
<tr><th>[[-72.78, 43.32], [-71.33, 42.43]]</th><td></td></tr> <!-- LineString / MultiPoint -->
<tr><th>[[-8102018.97, 5011809.33], [-7718610.83, 5418454.32]]</th><td></td></tr>
<tr><th>[[[-72.78, 43.32], [-71.33, 42.43], [-70.12, 43.16], [-72.78, 43.32]]]</th><td></td></tr> <!-- Polygon / MultiLineString-->
<tr><th>[[[-8102018.97, 5011809.33], [-7718610.83, 5418454.32], [-8102018.83, 5418454.32], [-8102018.97, 5011809.33]]]</th><td></td></tr>
<tr><th>[[[[-72.78, 43.32], [-71.33, 42.43], [-70.12, 43.16], [-72.78, 43.32]]]]</th><td></td></tr> <!-- MultiPolygon -->
<tr><th>[[[[-8102018.97, 5011809.33], [-7718610.83, 5418454.32], [-8102018.83, 5418454.32], [-8102018.97, 5011809.33]]]]</th><td></td></tr>
</table>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
<script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
<script>
$(function () {
// create a map
var map = $("#map").geomap({
center: [-71.0595678, 42.3604823],
zoom: 8
});
$( ".tests tr" ).each( function( ) {
var testJson = $( this ).find( "th" ).text(),
testVal = testJson != "" ? JSON.parse( testJson ) : "",
isGeodetic = $.geo._isGeodetic( testVal );
$( this ).find( "td" ).text( isGeodetic ? "geodetic" : "projected" );
} );
});
</script>
</body>
</html>