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

Commit

Permalink
Merge pull request #837 from open-apparel-registry/ki/fix-map-crashes
Browse files Browse the repository at this point in the history
Fix vector tile map crashes on login/logout

Connects #822
  • Loading branch information
Kelly Innes committed Sep 30, 2019
2 parents ef6a339 + 6415734 commit ed58a73
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,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

0 comments on commit ed58a73

Please sign in to comment.