diff --git a/CHANGELOG.md b/CHANGELOG.md index a6bec23c1..552951259 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Close Disambiguation Popup on New Search [#825](https://github.com/open-apparel-registry/open-apparel-registry/pull/825) - Change "Accept" to "Confirm" in About/Processing [#815](https://github.com/open-apparel-registry/open-apparel-registry/pull/815) - Regularize vector tile map zoom behavior [#799](https://github.com/open-apparel-registry/open-apparel-registry/pull/799) +- Fix a bug which caused the vector tile map to crash on login/logout [#837](https://github.com/open-apparel-registry/open-apparel-registry/pull/837) ### Security diff --git a/src/app/src/components/VectorTileFacilitiesMap.jsx b/src/app/src/components/VectorTileFacilitiesMap.jsx index 760ff1b6d..c0b9e0c34 100644 --- a/src/app/src/components/VectorTileFacilitiesMap.jsx +++ b/src/app/src/components/VectorTileFacilitiesMap.jsx @@ -149,6 +149,7 @@ function VectorTileFacilitiesMap({ handleCellClick={handleCellClick} minZoom={1} maxZoom={maxVectorTileFacilitiesGridZoom} + zoomLevel={currentMapZoomLevel} /> ); diff --git a/src/app/src/components/VectorTileFacilityGridLayer.jsx b/src/app/src/components/VectorTileFacilityGridLayer.jsx index 1ff7ab68e..e00436e3e 100644 --- a/src/app/src/components/VectorTileFacilityGridLayer.jsx +++ b/src/app/src/components/VectorTileFacilityGridLayer.jsx @@ -59,6 +59,7 @@ const VectorTileFacilityGridLayer = ({ handleCellClick, minZoom, maxZoom, + zoomLevel, gridColorRamp, }) => { const vectorTileURL = useUpdateTileURL( @@ -89,12 +90,6 @@ const VectorTileFacilityGridLayer = ({ maxZoom={maxZoom} vectorTileLayerStyles={{ facilitygrid(properties) { - const layer = get( - vectorTileLayerRef, - 'current.leafletElement', - ); - // eslint-disable-next-line no-underscore-dangle - const zoomLevel = layer._map.getZoom(); const factor = 2 * Math.max(0, zoomLevel - 4); const count = get(properties, 'count', 0); if (count === 0) { @@ -137,6 +132,7 @@ VectorTileFacilityGridLayer.propTypes = { fetching: bool.isRequired, resetButtonClickCount: number.isRequired, gridColorRamp: arrayOf(array).isRequired, + zoomLevel: number.isRequired, }; function mapStateToProps({