<commit_before><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>RouteBoxer Documentation: Examples</title>
    <link rel="stylesheet" type="text/css" href="http://code.google.com/css/codesite.css"></link>
    <link rel="stylesheet" type="text/css" href="http://gmaps-utility-library.googlecode.com/svn/trunk/util/docs/template/local_extensions.css"></link>
    <link rel="stylesheet" type="text/css" href="examples.css"></link>
    <script type="text/javascript" src="http://code.google.com/js/prettify.js"></script>
    <script type="text/javascript">
    var current = 1;
    function slide(n) {
      document.getElementById("slide-" + current).style.display = "none";
      document.getElementById("tab-" + current).style.backgroundColor = "#e0e0e0";
      document.getElementById("tab-" + current).style.zIndex = 100 - (10 * current);
      document.getElementById("slide-" + n).style.display = "block";
      document.getElementById("tab-" + n).style.backgroundColor = "#ffffff";
      document.getElementById("tab-" + n).style.zIndex = 100;
      current = n;
    }
    </script>
  </head>
  <body onload="prettyPrint()">
<h1>RouteBoxer</h1>

<p>The RouteBoxer class generates a set of <a href="http://code.google.com/apis/maps/documentation/v3/reference.html#LatLngBounds"><code>LatLngBounds</code></a> objects
that are guaranteed to cover every point within a specified distance of a path, such as that generated for a route by the
<a href="http://code.google.com/apis/maps/documentation/v3/reference.html#DirectionsService"><code>DirectionsService</code></a> class.
The primary use case for this class is to support implementing Search along a route against a Spatial db that supports bounding box queries.</p>

<p>Note that it is not the intention of the class to limit the bounding boxes to <b>only</b> those regions within the specified distance of the route, which
is not impossible given that routes are not rectangular. Consequently searches performed using these bounding boxes may return results up to ~3x the
given distance from the route (twice the distance across the diagonal of a square with sides of the given distance).</p>

<h2>How to use the class</h2>

<p>To use the RouteBoxer class, first load the RouteBoxer.js file into your page:</p>

<pre class="prettyprint">&lt;script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/routeboxer/src/RouteBoxer.js"&gt;&lt;/script&gt;</pre>

<p>Then create a <a href="reference.html"><code>RouteBoxer</code></a> object, and pass an array of
<a href="http://code.google.com/apis/maps/documentation/v3/reference.html#LatLng"><code>google.maps.LatLng</a></code> objects and a distance to the <code>RouteBoxer.box()</code> method.
If implementing search along a route the <code>overview_polyline</code> property of a
<a href="http://code.google.com/apis/maps/documentation/v3/reference.html#DirectionsRoute"><code>google.maps.DirectionsRoute</code></a>
object contains a suitable array of <code>LatLng</code> objects:</p>

<pre class="prettyprint">var directionService = new google.maps.DirectionsService();
var rboxer = new RouteBoxer();
var distance = 20; // km<commit_msg>Fix a typo in the RouteBoxer docs.<commit_after><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>RouteBoxer Documentation: Examples</title>
    <link rel="stylesheet" type="text/css" href="http://code.google.com/css/codesite.css"></link>
    <link rel="stylesheet" type="text/css" href="http://gmaps-utility-library.googlecode.com/svn/trunk/util/docs/template/local_extensions.css"></link>
    <link rel="stylesheet" type="text/css" href="examples.css"></link>
    <script type="text/javascript" src="http://code.google.com/js/prettify.js"></script>
    <script type="text/javascript">
    var current = 1;
    function slide(n) {
      document.getElementById("slide-" + current).style.display = "none";
      document.getElementById("tab-" + current).style.backgroundColor = "#e0e0e0";
      document.getElementById("tab-" + current).style.zIndex = 100 - (10 * current);
      document.getElementById("slide-" + n).style.display = "block";
      document.getElementById("tab-" + n).style.backgroundColor = "#ffffff";
      document.getElementById("tab-" + n).style.zIndex = 100;
      current = n;
    }
    </script>
  </head>
  <body onload="prettyPrint()">
<h1>RouteBoxer</h1>

<p>The RouteBoxer class generates a set of <a href="http://code.google.com/apis/maps/documentation/v3/reference.html#LatLngBounds"><code>LatLngBounds</code></a> objects
that are guaranteed to cover every point within a specified distance of a path, such as that generated for a route by the
<a href="http://code.google.com/apis/maps/documentation/v3/reference.html#DirectionsService"><code>DirectionsService</code></a> class.
The primary use case for this class is to support implementing Search along a route against a Spatial db that supports bounding box queries.</p>

<p>Note that it is not the intention of the class to limit the bounding boxes to <b>only</b> those regions within the specified distance of the route, which
is not possible given that routes are not rectangular. Consequently searches performed using these bounding boxes may return results up to ~3x the
given distance from the route (twice the distance across the diagonal of a square with sides of the given distance).</p>

<h2>How to use the class</h2>

<p>To use the RouteBoxer class, first load the RouteBoxer.js file into your page:</p>

<pre class="prettyprint">&lt;script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/routeboxer/src/RouteBoxer.js"&gt;&lt;/script&gt;</pre>

<p>Then create a <a href="reference.html"><code>RouteBoxer</code></a> object, and pass an array of
<a href="http://code.google.com/apis/maps/documentation/v3/reference.html#LatLng"><code>google.maps.LatLng</a></code> objects and a distance to the <code>RouteBoxer.box()</code> method.
If implementing search along a route the <code>overview_polyline</code> property of a
<a href="http://code.google.com/apis/maps/documentation/v3/reference.html#DirectionsRoute"><code>google.maps.DirectionsRoute</code></a>
object contains a suitable array of <code>LatLng</code> objects:</p>

<pre class="prettyprint">var directionService = new google.maps.DirectionsService();
var rboxer = new RouteBoxer();
var distance = 20; // km
{'fraction_non_alphanumeric': 0.14863468634686347, 'fraction_numerical': 0.01062730627306273, 'mean_word_length': 4.791452991452991, 'pattern_counts': {'":': 0, '<': 125, '<?xml version=': 0, '>': 125, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3803789', 'n_tokens_mistral': 2159, 'n_tokens_neox': 2039, 'n_words': 553}