3 <html lang="en" class="no-js">
7 <title>include | $.geo</title>
8 <meta name="description" content="jQuery Geo include method">
9 <meta name="author" content="Ryan Westphal">
11 <meta name="viewport" content="width=device-width, initial-scale=1.0">
13 <link rel="stylesheet" href="../css/style.css?v=2">
14 <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
19 <div id="include" data-role="page">
20 <div data-role="header" data-theme="b">
24 <div data-role="content">
28 <td>Array ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ) </td>
32 <td>$.geo.include( null | Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ), Array position ( <a href="http://geojson.org/geojson-spec.html#positions" rel="external">GeoJSON position</a> ) | Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ) )</td>
36 <td><pre><code>var bboxOfCoord = $.geo.include( null, [ -70, 42 ] );
37 var sameAsSecondArgument = $.geo.include( null, [ -71, 41, -69, 43 ] );
38 var includeCoord = $.geo.include( bbox, [ -70, 42 ] );
39 var includeBbox = $.geo.include( bbox, [ -71, 41, -69, 43 ] );</code></pre></td>
43 <p>The include method expands a bbox to include either a coordinate or another bbox. The expanded bbox is returned.</p>
45 <p>If the first argument is null or undefined, the result is a new bbox and will contain the second argument.</p>
47 <p>For efficency, if the first argument is a valid bbox, it is modified in-place and a reference is returned.</p>
49 <p>If the second argument is not a coordinate or bbox, this function returns the first argument.</p>
51 <p>This function is similar to Envelope.expandToInclude in JTS.</p>
53 </div> <!-- end of #container -->
55 <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
56 <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
57 <script src="../js/script.js"></script>
58 <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>