Add hash to send feedback email (#1551)

- detected bug with zoom/lat/lng values and created ticket 1550
- get realtime has from mapRef
- pass hash to AreaDetail as prop
- update tests and snapshots
This commit is contained in:
Vim 2022-04-12 14:49:57 -04:00 committed by GitHub
commit 1ce124069d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 19 deletions

View file

@ -102,7 +102,10 @@ export const featureURLForTilesetName = (tilesetName: string): string => {
const J40Map = ({location}: IJ40Interface) => {
/**
* Initializes the zoom, and the map's center point (lat, lng) via the URL hash #{z}/{lat}/{long}
* where:
* where
* @TODO: These values do not update when zooming in/out. Could explain a number of cypress bugs
* reference to ticket #1550
*
* z = zoom
* lat = map center's latitude
* long = map center's longitude
@ -132,6 +135,7 @@ const J40Map = ({location}: IJ40Interface) => {
const selectedFeatureId = (selectedFeature && selectedFeature.id) || '';
const filter = useMemo(() => ['in', constants.GEOID_PROPERTY, selectedFeatureId], [selectedFeature]);
const zoomLatLngHash = mapRef.current?.getMap()._hash._getCurrentHash();
/**
* This function will return the bounding box of the current map. Comment in when needed.
* {
@ -444,7 +448,7 @@ const J40Map = ({location}: IJ40Interface) => {
onClose={setDetailViewData}
captureScroll={true}
>
<AreaDetail properties={detailViewData.properties} />
<AreaDetail properties={detailViewData.properties} hash={zoomLatLngHash}/>
</Popup>
)}
@ -477,6 +481,7 @@ const J40Map = ({location}: IJ40Interface) => {
className={styles.mapInfoPanel}
featureProperties={detailViewData?.properties}
selectedFeatureId={selectedFeature?.id}
hash={zoomLatLngHash}
/>
</Grid>
</>