geojs 1.8.2 → 1.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -603,13 +603,18 @@ var util = {
603
603
  * this is the same as the average of all the points of the lines of the
604
604
  * perimeter.
605
605
  *
606
- * @param {geo.geoPosition[]} coor An array of coordinates.
606
+ * @param {geo.geoPolygon} coor An array of coordinates. This can also be
607
+ * a polygon object with an ``outer`` element with an array of
608
+ * coordinates.
607
609
  * @returns {geo.geoPosition|undefined} The position for the center, or
608
610
  * `undefined` if no such position exists.
609
611
  * @memberof geo.util
610
612
  */
611
613
  centerFromPerimeter: function (coor) {
612
614
  var position, p0, p1, w, sumw, i;
615
+ if (coor && coor.outer) {
616
+ coor = coor.outer;
617
+ }
613
618
  if (!coor || !coor.length) {
614
619
  return;
615
620
  }