<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I am trying to get a client-side openlayers function that can determine if 2 geometries are within x miles of each other. First, I'm trying to develop a prototype of said methodology using spatial filters. My end result is wrong (false).&nbsp; (there are no river crossings)<br><br>Here is the test:<br>fishkill = new OpenLayers.Geometry.Point(-73.903094, 41.534933);<br>//(Fishkill, NY 12524)<br>fishkill = fishkill.transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));<br><br>poughkeepsie = new OpenLayers.Geometry.Point(-73.87089, 41.640904);<br>//( Poughkeepsie, NY 12603)<br>poughkeepsie = poughkeepsie.transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>var tolerance = 20;<br>filter = new
 OpenLayers.Filter.Spatial({type: OpenLayers.Filter.Spatial.DWITHIN,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value: poughkeepsie, distance:tolerance, distanceUnits: 'mi'})<br>alert('Result: ' + filter.evaluate(fishkill));<br><br><br>This test returns false, indicating to me that fishkill is NOT within 20 miles of poughkeepsie (this is wrong, the points are actually about 9 miles apart.) <br><br>Anyone see what I'm doing wrong?<br></td></tr></table>