Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Sep 17, 2020
1 parent 017506b commit e46850d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 56 deletions.
13 changes: 7 additions & 6 deletions src/components/manage/Blocks/DiscodataComponents/Text/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,14 @@ const View = ({ content, ...props }) => {
};
});
selectedSubResources.forEach((subResource) => {
const discodataPackage = resources.filter(
(resource) => resource.package === subResource.package,
)[0];
if (props.search[discodataPackage.queryParameter]) {
const discodataPackage =
resources.filter(
(resource) => resource.package === subResource.package,
)[0] || {};
if (props.search[discodataPackage?.queryParameter]) {
newDiscodataValues.push(
props.discodata_resources[discodataPackage.package]?.[
props.search[discodataPackage.queryParameter]
props.discodata_resources[discodataPackage?.package]?.[
props.search[discodataPackage?.queryParameter]
]?.[subResource.query],
);
}
Expand Down
61 changes: 12 additions & 49 deletions src/components/manage/Blocks/DiscodataOpenlayersMapBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,9 @@ const OpenlayersMapView = (props) => {

function displayPopup(map, pixel, coordinate, popup, detailed = false) {
if (setFeatureInfo(map, pixel, coordinate, detailed)) {
map.getTarget().style.cursor = 'pointer';
if (!detailed) {
map.getTarget().style.cursor = 'pointer';
}
popup.element.classList.add('show');
popup.setPosition(coordinate);
} else {
Expand Down Expand Up @@ -833,47 +835,6 @@ const OpenlayersMapView = (props) => {
zIndex: 0,
}),
}),
// style: (feature, resolution) => {
// const featureProperties = feature.getProperties();
// if (
// featureProperties.siteName === siteTermRef.current ||
// (SVG_COLLECTION[featureProperties.eea_activities]?.() &&
// stateRef.current.map.element?.getView?.()?.getZoom?.() > 11)
// ) {
// return new Style({
// image: new Icon({
// src:
// featureProperties.siteName === siteTermRef.current
// ? `data:image/svg+xml;utf8,${encodeURIComponent(
// pinSVG('#50C878'),
// )}`
// : `data:image/svg+xml;utf8,${encodeURIComponent(
// SVG_COLLECTION[featureProperties.eea_activities](),
// )}`,
// opacity: 1,
// scale: 1,
// }),
// zIndex:
// featureProperties.siteName === siteTermRef.current ? 1 : 0,
// });
// } else {
// return new Style({
// image: new CircleStyle({
// radius: 3,
// fill:
// featureProperties.siteName === siteTermRef.current
// ? new Fill({ color: '#50C878' })
// : new Fill({ color: '#000' }),
// stroke:
// featureProperties.siteName === siteTermRef.current
// ? new Stroke({ color: '#6A6A6A', width: 1 })
// : new Stroke({ color: '#6A6A6A', width: 1 }),
// zIndex:
// featureProperties.siteName === siteTermRef.current ? 1 : 0,
// }),
// });
// }
// },
visible: true,
title: 'ly_IED_SiteMap_WM',
});
Expand Down Expand Up @@ -931,13 +892,15 @@ const OpenlayersMapView = (props) => {
}
});
if (hasPopups) {
map.on('pointermove', function (evt) {
if (evt.dragging) {
return;
}
const pixel = map.getEventPixel(evt.originalEvent);
displayPopup(map, pixel, evt.coordinate, popup);
});
if (document && document.documentElement?.clientWidth > 500) {
map.on('pointermove', function (evt) {
if (evt.dragging) {
return;
}
const pixel = map.getEventPixel(evt.originalEvent);
displayPopup(map, pixel, evt.coordinate, popup);
});
}
map.on('click', function (evt) {
let newZoom = map.getView().getZoom();
if (newZoom > zoomSwitch) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/manage/Blocks/SidebarBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ const View = ({ content, ...props }) => {
props.dispatch,
),
);
} else if (preset.key && !collection.length) {
} else if (preset.key) {
navigation = flattenArray(props.navigation.items, {}, 0, 0);
} else {
navigation = flattenArray(props.navigation.items);
Expand Down
6 changes: 6 additions & 0 deletions theme/site/globals/site.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -1613,4 +1613,10 @@ b {
pointer-events: none;
color: #333;
text-decoration: none !important;
}

.query-param-text {
a {
text-decoration: underline !important;
}
}

0 comments on commit e46850d

Please sign in to comment.