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: minor changes for the multiselection plugin #1833

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
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
49 changes: 27 additions & 22 deletions src/featureinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,30 +266,34 @@ const Featureinfo = function Featureinfo(options = {}) {
};

const addLinkListener = function addLinkListener(el) {
el.addEventListener('click', (e) => {
e.preventDefault();
const targ = e.target;
let modalStyle = '';
switch (targ.target) {
case 'modal-full':
{
modalStyle = 'max-width:unset;width:98%;height:98%;resize:both;overflow:auto;display:flex;flex-flow:column;';
break;
}
default:
{
modalStyle = 'resize:both;overflow:auto;display:flex;flex-flow:column;';
break;
// Check if element already has a listener
if (el && !el.hasAttribute('onClickModal')) {
el.addEventListener('click', (e) => {
e.preventDefault();
const targ = e.target;
let modalStyle = '';
switch (targ.target) {
case 'modal-full':
{
modalStyle = 'max-width:unset;width:98%;height:98%;resize:both;overflow:auto;display:flex;flex-flow:column;';
break;
}
default:
{
modalStyle = 'resize:both;overflow:auto;display:flex;flex-flow:column;';
break;
}
}
}
Modal({
title: targ.title,
content: `<iframe src="${targ.href}" class=""style="width:100%;height:99%"></iframe>`,
target: viewer.getId(),
style: modalStyle,
newTabUrl: targ.href
Modal({
title: targ.title,
content: `<iframe src="${targ.href}" class=""style="width:100%;height:99%"></iframe>`,
target: viewer.getId(),
style: modalStyle,
newTabUrl: targ.href
});
});
});
el.setAttribute('onClickModal', 'true');
}
};

/**
Expand Down Expand Up @@ -670,6 +674,7 @@ const Featureinfo = function Featureinfo(options = {}) {
return Component({
name: 'featureInfo',
clear,
addLinkListener,
getHitTolerance,
getPin,
getSelectionLayer,
Expand Down
11 changes: 9 additions & 2 deletions src/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,15 @@ const Viewer = function Viewer(targetOption, options = {}) {
return undefined;
};

const getQueryableLayers = function getQueryableLayers() {
const queryableLayers = getLayers().filter(layer => layer.get('queryable') && layer.getVisible());
const getQueryableLayers = function getQueryableLayers(includeImageFeatureInfoMode = false) {
const queryableLayers = getLayers().filter(layer => {
if (layer.get('queryable') && layer.getVisible()) {
return true;
} else if (includeImageFeatureInfoMode && layer.get('queryable') && layer.get('imageFeatureInfoMode') === 'always') {
return true;
}
return false;
});
return queryableLayers;
};

Expand Down
Loading