Skip to content

Commit a9d929f

Browse files
committed
Fix things broken by OL changes.
1 parent 5d7b536 commit a9d929f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

js/hcmc_ol.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ hol.VERSION = '1.2b';
115115
* @type {string}
116116
* @default
117117
*/
118-
hol.OLVERSION = '9.2.3';
118+
hol.OLVERSION = ol.util.VERSION;
119119

120120
/**
121121
* Constants in hol namespace used
@@ -3012,7 +3012,7 @@ hol.VectorLayer.prototype.timelineChange = function(sender){
30123012

30133013
if (this.timelinePanZoom){
30143014
let feats = [...featNumsToKeepShowing, ...featNumsToShowNew];
3015-
console.log(feats);
3015+
//console.log(feats);
30163016
if ((feats.length > 1)||((feats.length === 1) && (this.features[feats[0]].getGeometry().GeometryType !== 'Point'))){
30173017
this.centerOnFeatures(feats);
30183018
}
@@ -3541,11 +3541,13 @@ hol.VectorLayer.prototype.centerOnFeatures = function(featNums){
35413541
var i, maxi, geomCol, extent, el, leftMargin = 20, rightMargin, bottomMargin = 20, opts, geoms = [];
35423542
try{
35433543
for (i=0, maxi=featNums.length; i<maxi; i++){
3544-
geoms.push(this.features[featNums[i]].getGeometry());
3544+
let g = this.features[featNums[i]].getGeometry();
3545+
if (g !== undefined){
3546+
geoms.push(g);
3547+
}
35453548
}
35463549
if (geoms.length > 0){
3547-
geomCol = new ol.geom.GeometryCollection();
3548-
geomCol.setGeometries(geoms);
3550+
geomCol = new ol.geom.GeometryCollection(geoms);
35493551
extent = geomCol.getExtent();
35503552
//Now we need to allow for the fact that a big block of the map
35513553
//is invisible under the navigation, info and doc panels.

0 commit comments

Comments
 (0)