Skip to content

Commit

Permalink
Investigate error with ArcGIS remote layer (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidQuartz authored Feb 25, 2022
1 parent bfc14d7 commit 06e3328
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Spinner from '@js/components/Spinner';
import Message from '@mapstore/framework/components/I18N/Message';
import tooltip from '@mapstore/framework/components/misc/enhancers/tooltip';
import moment from 'moment';
import { getResourceTypesInfo, getMetadataDetailUrl, ResourceTypes } from '@js/utils/ResourceUtils';
import { getResourceTypesInfo, getMetadataDetailUrl, ResourceTypes, GXP_PTYPES } from '@js/utils/ResourceUtils';
import debounce from 'lodash/debounce';
import CopyToClipboardCmp from 'react-copy-to-clipboard';
import { TextEditable, ThumbnailEditable } from '@js/components/ContentsEditable/';
Expand Down Expand Up @@ -489,7 +489,7 @@ function DetailsPanel({
thumbnailUpdating={resourceThumbnailUpdating}
/>
{
(resource.resource_type === ResourceTypes.MAP || resource.resource_type === ResourceTypes.DATASET) &&
((resource.resource_type === ResourceTypes.MAP || resource.resource_type === ResourceTypes.DATASET) && (resource.ptype !== GXP_PTYPES.REST_IMG || resource.ptype !== GXP_PTYPES.REST_MAP)) &&
( <><MapThumbnailButtonToolTip
variant="default"
onClick={() => onClose(!enableMapViewer)}
Expand All @@ -502,7 +502,7 @@ function DetailsPanel({
</>)
}
{isThumbnailChanged && <Button style={{
left: (resource.resource_type === ResourceTypes.MAP || resource.resource_type === ResourceTypes.DATASET) ? '85px' : '50px'
left: ((resource.resource_type === ResourceTypes.MAP || resource.resource_type === ResourceTypes.DATASET) && (resource.ptype !== GXP_PTYPES.REST_IMG || resource.ptype !== GXP_PTYPES.REST_MAP)) ? '85px' : '50px'
}} variant="primary" className="map-thumbnail apply-button" onClick={handleResourceThumbnailUpdate}><Message msgId={"gnhome.apply"} /></Button>}
</>
: <MapThumbnailView
Expand Down
4 changes: 2 additions & 2 deletions geonode_mapstore_client/client/js/plugins/FitBounds.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function FitBoundsPlugin({ mapProjection, ...props }) {
const [eMinx, eMiny, eMaxx, eMaxy] = MAX_EXTENT_WEB_MERCATOR;
return [
minx < eMinx ? eMinx : minx,
miny < eMiny ? eMiny : miny,
(miny < eMiny || miny > eMaxy) ? eMiny : miny,
maxx > eMaxx ? eMaxx : maxx,
maxy > eMaxy ? eMaxy : maxy
(maxy > eMaxy || maxy < eMiny) ? eMaxy : maxy
];
}
return geometry;
Expand Down
4 changes: 2 additions & 2 deletions geonode_mapstore_client/client/js/utils/ResourceUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function getExtentFromResource({ ll_bbox_polygon: llBboxPolygon }) {
return bbox;
}

const GXP_PTYPES = {
export const GXP_PTYPES = {
'AUTO': 'gxp_wmscsource',
'OWS': 'gxp_wmscsource',
'WMS': 'gxp_wmscsource',
Expand Down Expand Up @@ -89,7 +89,7 @@ export const resourceToLayerConfig = (resource) => {
switch (ptype) {
case GXP_PTYPES.REST_MAP:
case GXP_PTYPES.REST_IMG: {
const { url: arcgisUrl } = links.find(({ mime }) => mime === 'text/html') || {};
const { url: arcgisUrl } = links.find(({ mime, link_type: linkType }) => (mime === 'text/html' && linkType === 'image')) || {};
return {
perms,
id: uuid(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
font-size: 0.9em;
display: flex;
flex: 1 1 auto;
flex-wrap: wrap;
.fa-edit, .fa-check-circle{
font-size: 0.9rem;
margin: 0.2em 0 0 0;
Expand Down

0 comments on commit 06e3328

Please sign in to comment.