Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
Adds an icon and makes a couple of minor non breaking changes
  • Loading branch information
jokd committed Sep 11, 2023
1 parent 066d494 commit bd64d38
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 24 deletions.
1 change: 1 addition & 0 deletions css/svg/material-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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

0 comments on commit bd64d38

Please sign in to comment.