added support for text labels. This also adds getCentroid methods to all
geometries. Thanks crschmidt for the great help with this patch, and thanks to camptocamp for the initial work on this and rcoup for creating the first patches. r=crschmidt (closes #1895) git-svn-id: http://svn.openlayers.org/trunk/openlayers@9262 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -256,6 +256,27 @@ OpenLayers.Geometry.Collection = OpenLayers.Class(OpenLayers.Geometry, {
|
||||
}
|
||||
return area;
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: getCentroid
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Geometry.Point>} The centroid of the collection
|
||||
*/
|
||||
getCentroid: function() {
|
||||
return this.components.length && this.components[0].getCentroid();
|
||||
/*
|
||||
var centroid;
|
||||
for (var i=0, len=this.components.length; i<len; i++) {
|
||||
if (!centroid) {
|
||||
centroid = this.components[i].getCentroid();
|
||||
} else {
|
||||
centroid.resize(this.components[i].getCentroid(), 0.5);
|
||||
}
|
||||
}
|
||||
return centroid;
|
||||
*/
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: getGeodesicLength
|
||||
|
||||
Reference in New Issue
Block a user