Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a range check. #815

Merged
merged 1 commit into from
Apr 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ var GeojsImageViewerWidgetExtension = function (viewer) {
pixelmapData = valuesWithBoundaries;
}
layerParams.data = pixelmapData;
const categoryMap = pixelmapElement.categories;
const boundaries = pixelmapElement.boundaries;
layerParams.style = {
color: (d, i) => {
const categoryMap = pixelmapElement.categories;
const boundaries = pixelmapElement.boundaries;
if (d < 0 || d > categoryMap.length) {
if (d < 0 || d >= categoryMap.length) {
console.warn(`No category found at index ${d} in the category map.`);
return 'rgba(0, 0, 0, 0)';
}
Expand Down Expand Up @@ -390,11 +390,9 @@ var GeojsImageViewerWidgetExtension = function (viewer) {
}
const params = this._generateOverlayLayerParams(response, overlayItemId, overlay);
const layerType = (overlay.type === 'pixelmap') ? 'pixelmap' : 'osm';
const overlayLayer = this.viewer.createLayer(layerType, params);
const proj = this._getOverlayTransformProjString(overlay);

overlayLayer.id(overlay.id);
overlayLayer.gcs(proj);
const overlayLayer = this.viewer.createLayer(layerType, Object.assign({}, params, {id: overlay.id, gcs: proj}));
this.annotationLayer.moveToTop();
this.trigger('g:drawOverlayAnnotation', overlay, overlayLayer);
const featureEvents = geo.event.feature;
overlayLayer.geoOn(
Expand Down