mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-07-29 16:01:18 -07:00
Parameterize zoom experiments (#339)
* Adding ability to set flags in url * parameterizing tile layers
This commit is contained in:
parent
6c8d71c5b9
commit
3cd6e06115
6 changed files with 188 additions and 163 deletions
|
@ -7,10 +7,12 @@ import maplibregl, {LngLatBoundsLike,
|
|||
Popup,
|
||||
LngLatLike,
|
||||
MapboxGeoJSONFeature} from 'maplibre-gl';
|
||||
import mapStyle from '../data/mapStyle';
|
||||
import {makeMapStyle} from '../data/mapStyle';
|
||||
import PopupContent from './popupContent';
|
||||
import * as constants from '../data/constants';
|
||||
import ReactDOM from 'react-dom';
|
||||
import {useFlags} from '../contexts/FlagContext';
|
||||
|
||||
import 'maplibre-gl/dist/maplibre-gl.css';
|
||||
import * as styles from './J40Map.module.scss';
|
||||
|
||||
|
@ -27,11 +29,12 @@ const J40Map = () => {
|
|||
const mapRef = useRef<Map>() as React.MutableRefObject<Map>;
|
||||
const selectedFeature = useRef<MapboxGeoJSONFeature>();
|
||||
const [zoom, setZoom] = useState(constants.GLOBAL_MIN_ZOOM);
|
||||
const flags = useFlags();
|
||||
|
||||
useEffect(() => {
|
||||
const initialMap = new Map({
|
||||
container: mapContainer.current!,
|
||||
style: mapStyle,
|
||||
style: makeMapStyle(flags),
|
||||
center: constants.DEFAULT_CENTER as LngLatLike,
|
||||
zoom: zoom,
|
||||
minZoom: constants.GLOBAL_MIN_ZOOM,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue