Ticket #1192: getVertice_getEdges.00.patch
| File getVertice_getEdges.00.patch, 6.0 kB (added by fredj, 1 year ago) |
|---|
-
lib/OpenLayers/Geometry.js
old new 186 186 }, 187 187 188 188 /** 189 * Method: getVertices 190 * Returns all the vertices of the geometry.This method is 191 * defined in subclasses. 192 * 193 * Return: 194 * {Array(<OpenLayers.Geometry.Point>)} Vertices 195 */ 196 getVertices: function() { 197 return []; 198 }, 199 200 /** 201 * Method: getEdges 202 * Returns all the edges of the geometry.This method is 203 * defined in subclasses. 204 * 205 * Return: 206 * {Array(<OpenLayers.Geometry.Point>)} Edges 207 */ 208 getEdges: function() { 209 return []; 210 }, 211 212 /** 189 213 * Method: toString 190 214 * Returns the Well-Known Text representation of a geometry 191 215 * -
lib/OpenLayers/Feature/Vector.js
old new 179 179 }, 180 180 181 181 /** 182 * Method: getVertices 183 * Returns all the vertices of the geometry. 184 * 185 * Return: 186 * {Array(<OpenLayers.Geometry.Point>)} Vertices 187 */ 188 getVertices: function() { 189 if (this.geometry) { 190 return this.geometry.getVertices(); 191 } else { 192 return []; 193 } 194 }, 195 196 /** 197 * Method: getEdges 198 * Returns all the edges of the geometry. 199 * 200 * Return: 201 * {Array(<OpenLayers.Geometry.Point>)} Edges 202 */ 203 getEdges: function() { 204 if (this.geometry) { 205 return this.geometry.getEdges(); 206 } else { 207 return []; 208 } 209 }, 210 211 /** 182 212 * Method: destroyPopup 183 213 * HACK - we need to decide if all vector features should be able to 184 214 * delete popups -
lib/OpenLayers/Geometry/Polygon.js
old new 38 38 arguments); 39 39 }, 40 40 41 /** 42 * Method: getEdges 43 * Returns all the edges of the geometry. 44 * 45 * Return: 46 * {Array(<OpenLayers.Geometry.Point>)} Edges 47 */ 48 getEdges: function() { 49 var edges = []; 50 for (var i = 0; i < this.components.length; i++) { 51 edges = edges.concat(this.components[i].getEdges()); 52 } 53 return edges; 54 }, 55 41 56 /** 42 57 * APIMethod: getArea 43 58 * Calculated by subtracting the areas of the internal holes from the -
lib/OpenLayers/Geometry/Point.js
old new 116 116 toShortString: function() { 117 117 return (this.x + ", " + this.y); 118 118 }, 119 120 121 /** 122 * Method: getVertices 123 * Returns all the vertices of the geometry. 124 * 125 * Return: 126 * {Array(<OpenLayers.Geometry.Point>)} Vertices 127 */ 128 getVertices: function() { 129 return [this]; 130 }, 119 131 120 132 /** 121 133 * APIMethod: move -
lib/OpenLayers/Geometry/LinearRing.js
old new 81 81 82 82 return added; 83 83 }, 84 85 /** 86 * Method: getVertices 87 * Returns all the vertices of the geometry. 88 * 89 * Return: 90 * {Array(<OpenLayers.Geometry.Point>)} Vertices 91 */ 92 getVertices: function() { 93 return this.components.slice(0, this.components.length - 1); 94 }, 95 84 96 85 97 /** 86 98 * APIMethod: removeComponent -
lib/OpenLayers/Geometry/Collection.js
old new 97 97 return strings.join(","); 98 98 }, 99 99 100 100 101 /** 102 * Method: getVertices 103 * Returns all the vertices of the geometry. 104 * 105 * Return: 106 * {Array(<OpenLayers.Geometry.Point>)} Vertices 107 */ 108 getVertices: function() { 109 var vertices = []; 110 for(var i = 0; i < this.components.length; i++) { 111 vertices = vertices.concat(this.components[i].getVertices()); 112 } 113 return vertices; 114 }, 115 116 /** 101 117 * APIMethod: calculateBounds 102 118 * Recalculate the bounds by iterating through the components and 103 119 * calling calling extendBounds() on each item. -
lib/OpenLayers/Geometry/LineString.js
old new 28 28 }, 29 29 30 30 /** 31 * Method: getVertices 32 * Returns all the vertices of the geometry. 33 * 34 * Return: 35 * {Array(<OpenLayers.Geometry.Point>)} Vertices 36 */ 37 getVertices: function() { 38 return this.components; 39 }, 40 41 /** 42 * Method: getEdges 43 * Returns all the edges of the geometry. 44 * 45 * Return: 46 * {Array(<OpenLayers.Geometry.Point>)} Edges 47 */ 48 getEdges: function() { 49 var edges = []; 50 for (var i = 0; i < this.components.length - 1; i++) { 51 var start = this.components[i].clone(); 52 var stop = this.components[i + 1].clone(); 53 edges = edges.concat(new OpenLayers.Geometry.LineString([start, stop])); 54 } 55 return edges; 56 }, 57 58 /** 31 59 * APIMethod: removeComponent 32 60 * Only allows removal of a point if there are three or more points in 33 61 * the linestring. (otherwise the result would be just a single point)
