Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Fix vector tile map crashes on login/logout #837

Merged
merged 1 commit into from
Sep 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/app/src/components/VectorTileFacilitiesMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ function VectorTileFacilitiesMap({
handleCellClick={handleCellClick}
minZoom={1}
maxZoom={maxVectorTileFacilitiesGridZoom}
zoomLevel={currentMapZoomLevel}
/>
</ReactLeafletMap>
);
Expand Down
8 changes: 2 additions & 6 deletions src/app/src/components/VectorTileFacilityGridLayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const VectorTileFacilityGridLayer = ({
handleCellClick,
minZoom,
maxZoom,
zoomLevel,
gridColorRamp,
}) => {
const vectorTileURL = useUpdateTileURL(
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -137,6 +132,7 @@ VectorTileFacilityGridLayer.propTypes = {
fetching: bool.isRequired,
resetButtonClickCount: number.isRequired,
gridColorRamp: arrayOf(array).isRequired,
zoomLevel: number.isRequired,
};

function mapStateToProps({
Expand Down