Fix zIndex handling for hitdetection

getZIndex returns number|undefined, so Number conversion is unnecessary, but
undefined was converted to NaN instead of zero.
This commit is contained in:
Maximilian Krög
2021-02-10 00:05:24 +01:00
parent 5a7e4dfaf6
commit 8645a3109d

View File

@@ -114,7 +114,7 @@ export function createHitDetectionImageData(
})
);
}
const zIndex = Number(style.getZIndex());
const zIndex = style.getZIndex() || 0;
let byGeometryType = featuresByZIndex[zIndex];
if (!byGeometryType) {
byGeometryType = {};