Skip to content

Commit

Permalink
chore: Only display facilities list on zooms below 6
Browse files Browse the repository at this point in the history
  • Loading branch information
kevee committed Jan 4, 2021
1 parent 115bd2c commit fd924c6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/pages/data/hhs-facilities/map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const HHSFacilitiesMap = ({ center, zoom, state = false }) => {
event.target.getZoom(),
].join(',')
}
if (event.target.getZoom() < 4) {
if (event.target.getZoom() < 6) {
setFacilities(false)
return
}
Expand Down Expand Up @@ -103,7 +103,8 @@ const HHSFacilitiesMap = ({ center, zoom, state = false }) => {
style: `mapbox://styles/covidtrackingproject/ckihibso80hsg19o8q5gbq9z7`,
center: hash.length > 2 ? [hash[0], hash[1]] : center,
zoom: hash.length > 2 ? hash[2] : zoom,
minZoom: 2,
minZoom: 3.5,
maxZoom: 18,
})

map.addControl(new mapboxgl.NavigationControl(), 'top-left')
Expand Down Expand Up @@ -303,7 +304,7 @@ const HHSFacilitiesMap = ({ center, zoom, state = false }) => {
</div>
) : (
<p>
{currentZoom < 4 ? (
{currentZoom < 6 ? (
<>Zoom in to get facility details.</>
) : (
<>No facilities in the current map.</>
Expand Down

0 comments on commit fd924c6

Please sign in to comment.