Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Fixed broken arctic fires #167

Ryan Boller396aec7ee4c7
diff --git a/web/js/data/wv.data.results.js b/web/js/data/wv.data.results.js
index a41976dbc..57ac53b95 100644
--- a/web/js/data/wv.data.results.js
+++ b/web/js/data/wv.data.results.js
@@ -815,7 +815,16 @@ wv.data.results.transform = function(projection) {
var projGeom = geom.clone()
.transform(wv.map.CRS_WGS_84, projection);
granule.geometry[projection] = projGeom;
- granule.centroid[projection] = projGeom.getInteriorPoint();
+
+ if (projGeom instanceof ol.geom.Polygon) {
+ granule.centroid[projection] = projGeom.getInteriorPoint();
+ }
+ else {
+ // Assuming that projGeom is a ol.geom.MultiPolygon
+ granule.centroid[projection] =
+ projGeom.getInteriorPoints().getPoint(0);
+ }
+
return granule;
};