-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2366 aoi UI implementation phase1 (#2367)
* Aoi ui phase 1 * Complete Version of AOI package * Complete Version of AOI package with zoom fixed * ready for testing * correction asked
- Loading branch information
1 parent
e3c28bd
commit e69b770
Showing
5 changed files
with
71 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,8 @@ | |
}, | ||
"extent": { | ||
"type": "array", | ||
"minItems": 4, | ||
"maxItems": 4, | ||
"items": [ | ||
{ | ||
"type": "number", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,61 @@ | ||
// import { TypeBasemapProps } from 'geoview-core/src/geo/layer/basemap/basemap-types'; | ||
// import { TypeJsonObject } from 'geoview-core/src/core/types/global-types'; | ||
// import { useMapProjection } from 'geoview-core/src/core/stores/store-interface-and-intial-values/map-state'; | ||
// import { useAppDisplayLanguage } from 'geoview-core/src/core/stores/store-interface-and-intial-values/app-state'; | ||
// import { TypeValidMapProjectionCodes, TypeDisplayLanguage } from 'geoview-core/src/api/config/types/map-schema-types'; | ||
// import { logger } from 'geoview-core/src/core/utils/logger'; | ||
// import { getLocalizedMessage } from 'geoview-core/src/core/utils/utilities'; | ||
// import { getSxClasses } from './area-of-interest-style'; | ||
|
||
/* | ||
import { Extent } from 'geoview-core/src/api/config/types/map-schema-types'; | ||
import { getSxClasses } from './area-of-interest-style'; | ||
|
||
interface AoiPanelProps { | ||
mapId: string; | ||
config: TypeJsonObject; | ||
config: TypeAoiProps; | ||
} | ||
*/ | ||
|
||
export function AoiPanel(/* props: AoiPanelProps */): JSX.Element { | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
// const { mapId, config } = props; | ||
|
||
// const { cgpv } = window; | ||
// const myMap = cgpv.api.maps[mapId]; | ||
|
||
// const { api, ui, react } = cgpv; | ||
// const { Select, Card, Box } = ui.elements; | ||
|
||
// const { useState } = react; | ||
|
||
// const theme = ui.useTheme(); | ||
// const sxClasses = getSxClasses(theme); | ||
|
||
// internal state and store values | ||
// const language = useAppDisplayLanguage(); | ||
|
||
// #region PRIVATE UTILITY FUNCTIONS | ||
// #endregion | ||
interface AoiItem { | ||
aoiTitle: string; | ||
imageUrl: string; | ||
extent: Extent; | ||
} | ||
|
||
return <div />; | ||
type AoiListItems = AoiItem[]; | ||
|
||
type TypeAoiProps = { | ||
isOpen: boolean; | ||
aoiList: AoiListItems; | ||
version: string; | ||
}; | ||
|
||
export function AoiPanel(props: AoiPanelProps): JSX.Element { | ||
const { mapId, config } = props; | ||
const aoiList = config.aoiList as AoiListItems; | ||
|
||
const { cgpv } = window; | ||
const { api, ui } = cgpv; | ||
|
||
const myMap = api.maps[mapId]; | ||
const { Card, Box } = ui.elements; | ||
|
||
const theme = ui.useTheme(); | ||
const sxClasses = getSxClasses(theme); | ||
|
||
return ( | ||
<Box sx={sxClasses.aoiCard}> | ||
{aoiList.map((aoiItem: AoiItem, index) => { | ||
return ( | ||
<Card | ||
tabIndex={0} | ||
className="aoiCardThumbnail" | ||
onClick={() => myMap.zoomToLngLatExtentOrCoordinate(aoiItem.extent, { maxZoom: 14 })} | ||
// eslint-disable-next-line react/no-array-index-key | ||
key={index} | ||
title={aoiItem.aoiTitle} | ||
contentCard={ | ||
// eslint-disable-next-line react/jsx-no-useless-fragment | ||
<> | ||
{typeof aoiItem.imageUrl === 'string' && ( | ||
// eslint-disable-next-line react/no-array-index-key | ||
<Box component="img" key={index} src={aoiItem.imageUrl} alt="" className="aoiCardThumbnail" /> | ||
)} | ||
</> | ||
} | ||
/> | ||
); | ||
})} | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
packages/geoview-core/public/configs/navigator/26-package-area-of-interest-aoi-panel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters