[OpenLayers-Commits] r10973 - trunk/openlayers/examples

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Fri Dec 17 05:02:05 EST 2010


Author: ahocevar
Date: 2010-12-17 02:02:05 -0800 (Fri, 17 Dec 2010)
New Revision: 10973

Modified:
   trunk/openlayers/examples/simplify-linestring.html
Log:
updated the description and documentation of the example. p=marcjansen, r=me (closes #2869)


Modified: trunk/openlayers/examples/simplify-linestring.html
===================================================================
--- trunk/openlayers/examples/simplify-linestring.html	2010-12-16 19:31:10 UTC (rev 10972)
+++ trunk/openlayers/examples/simplify-linestring.html	2010-12-17 10:02:05 UTC (rev 10973)
@@ -1,7 +1,8 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <title>Simplify LineString</title>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+        <title>Simplify a LineString geometry</title>
         <link rel="stylesheet" href="../theme/default/style.css" type="text/css">
         <link rel="stylesheet" href="style.css" type="text/css">
         <style type="text/css">
@@ -15,19 +16,23 @@
             width: 300px;
             float: left;
         }
+        #docs {
+            clear: both;
+        }
         </style>
     </head>
     <body>
-        <h1 id="title">Simplify a LineString</h1>
+        <h1 id="title">Simplify a LineString geometry</h1>
         <div id="tags">
             Douglas-Peucker, Douglas, Peucker, Peuker, tolerance
         </div>
         <p id="shortdesc">
-            Shows the usage of the utility method "simplifyLineString" that 
-            implements the Douglas-Peucker algorithm to remove "insignificant"
-            vertices from LineString geometries.
+            Shows the usage of the method &quot;simplify&quot; that implements 
+			the Douglas-Peucker algorithm to remove &quot;insignificant&quot; 
+			vertices from LineString geometries.
         </p>
         <div id="control-simplify">
+            <label for="tolerance">Tolerance factor:</label>
             <input name="tolerance" id="tolerance" type="number" min="0" max="1" step="0.02" value="0.1">
             <input type="button" id="simplify" value="Simplify LineString">
             <input type="button" id="animation" value="Start animation">
@@ -38,20 +43,21 @@
         </div>
         <div id="info">
         </div>
-        <div id="docs" style="clear: both;">
+        <div id="docs">
             <p>
-                The method OpenLayers.Util.simplifyLineString can be used to 
-                simplify linestring geometries. Simplification sometimes is 
-                useful to enhance the perfomance of vector rendering or to 
-                reduce complexity of geometries. This might be especially handy 
-                when viewing geometries a small scales.  
+                Instances of OpenLayers.Geometry.LineString have a method simplify,
+                that can be used to simplify linestring geometries.
+                Simplification sometimes is useful to enhance the perfomance of 
+                vector rendering or to reduce complexity of geometries. This 
+                might be especially handy when viewing geometries a small 
+                scales.  
             </p>
             <p>
-                OpenLayers.Util.simplifyLineString is a recursive implementation 
-                of the famous Douglas-Peucker algorithm. It 
-                is controlled by a tolerance factor that defines the threshold 
-                for vertices to be considered "insignificant" for the general 
-                structure of the geometry.                
+                OpenLayers.Geometry.LineString::simplify is a recursive 
+				implementation of the famous Douglas-Peucker algorithm. It is 
+				controlled by a tolerance factor that defines the threshold for 
+				vertices to be considered &quot;insignificant&quot; for the 
+                general structure of the geometry.                
             </p>
             <p>
                 The LineString on the left map can be simplified according to 
@@ -59,12 +65,18 @@
                 Use a value between 0 and 1 for best results. If you navigate 
                 the left map, the right map will show the same location to make 
                 it easier to spot the differeces between the LineStrings.
-            </p>    
+            </p>
             <p>
-                The LineString 
-                represents a part of the coastline of 
-                <a href="http://www.openstreetmap.org/?lat=54.7309684753418&lon=83.1809234619141&zoom=11">this 
-                place in Russia</a> &mdash; found via <a href="http://ryba4.com/python/ramer-douglas-peucker">an
+                You can also use the button &quot;Start animation&quot; to get 
+                results for increasing tolerance-factors from 0.02 to 1.0. The
+                animation can be paused by clicking on the button &quot;Stop
+                animation&quot;. 
+            </p>
+            <p>
+                The LineString represents a part of the coastline of 
+                <a href="http://www.openstreetmap.org/?lat=54.7309684753418&amp;lon=83.1809234619141&amp;zoom=11">this 
+                place southeast of Novosibirsk in Russia</a> &mdash; found via 
+                <a href="http://ryba4.com/python/ramer-douglas-peucker">an
                 example implementation of the algorithm in python</a>.
             </p>
             <p>
@@ -77,10 +89,12 @@
                 (<a href="http://dx.doi.org/10.3138/FM57-6770-U75U-7727">DOI: 
                 10.3138/FM57-6770-U75U-7727</a>).
             </p>
+            <p>See <a href="simplify-linestring.js">simplify-linestring.js</a>
+                for the source code of this example.</p>
         </div>
         <script type="text/javascript" src="../lib/OpenLayers.js">
         </script>
-        <script type="text/javascript" src="simplify-linestring.js">
+        <script type="text/javascript" src="./simplify-linestring.js">
         </script>
     </body>
 </html>



More information about the Commits mailing list