2.0_beta sync to rsa
[platform/framework/web/web-ui-fw.git] / libs / js / jquery-geo-1.0a4 / docs / geo / distance.html
1 <!doctype html>  
2
3 <html lang="en" class="no-js">
4 <head>
5   <meta charset="utf-8">
6
7   <title>distance | $.geo</title>
8   <meta name="description" content="jQuery Geo distance method">
9   <meta name="author" content="Ryan Westphal">
10
11   <meta name="viewport" content="width=device-width, initial-scale=1.0">
12
13   <link rel="stylesheet" href="../css/style.css?v=2">
14   <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
15 </head>
16
17 <body>
18
19   <div id="distance" data-role="page">
20     <div data-role="header" data-theme="b">
21       <h1>distance</h1>
22     </div>
23     
24     <div data-role="content">
25       <table>
26         <tr>
27           <th>return type</th>
28           <td>Number</td>
29         </tr>
30         <tr>
31           <th>syntax</th>
32           <td>$.geo.distance( Object shape1 ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ), Object shape2 ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ) )</td>
33         </tr>
34         <tr>
35           <th>usage</th>
36           <td><pre><code>var distanceBetween = $.geo.distance(
37   { type: &quot;Point&quot;, &quot;coordinates&quot;: [ -71, 40 ] },
38   { type: &quot;Point&quot;, &quot;coordinates&quot;: [ -70.5, 41 ] }
39 )</pre></code></td>
40         </tr>
41       </table>
42       <p>The distance method calculates the distance between two basic GeoJSON geometry objects and returns it in non-geodetic units. The basic shapes are Point, LineString and Polygon. If you are using geomap with its default map service, the distance is in meters because the default projection is web mercator meters.</p>
43       <p>If either argument is not a basic GeoJSON geometry object, this function returns undefined.</p>
44       <p>This function is similar to Geometry.distance in JTS.</p>
45     </div>
46   </div> <!-- end of #container -->
47
48   <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
49   <script src="http://code.jquerygeo.com/jquery.geo-1.0a4.min.js"></script>
50   <script src="../js/script.js"></script>
51   <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
52 </body>
53 </html>
54