diff --git a/client/src/components/MapLegend.tsx b/client/src/components/MapLegend.tsx deleted file mode 100644 index af22b225..00000000 --- a/client/src/components/MapLegend.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; - -const MapLegend = () => { - return ( - <> -
Current Score Property: {constants.SCORE_PROPERTY}
); }; diff --git a/client/src/components/mapboxMap.module.scss b/client/src/components/mapboxMap.module.scss index f1681ae9..e423ba90 100644 --- a/client/src/components/mapboxMap.module.scss +++ b/client/src/components/mapboxMap.module.scss @@ -3,31 +3,12 @@ $sidebar-color: #ffffff; .mapContainer { height: 676px; - margin-bottom: 29px; - max-width: revert; - margin-top: 50px; -} - -.sidebar { - background-color: $sidebar-background; - color: $sidebar-color; - padding: 6px 12px; - font-family: monospace; - z-index: 1; - position: absolute; - top: 300px; - left: 0; - margin: 12px; - border-radius: 4px; } .j40Popup { max-height: 300px; - max-width: 300px; - overflow: scroll; + min-width: 36%; + max-width: 36%; + overflow-y: scroll; pointer-events: all !important; } - -.j40Popup .mapboxgl-popup-content { - pointer-events: all; -} diff --git a/client/src/components/mapboxMap.module.scss.d.ts b/client/src/components/mapboxMap.module.scss.d.ts index ad779b56..15389f65 100644 --- a/client/src/components/mapboxMap.module.scss.d.ts +++ b/client/src/components/mapboxMap.module.scss.d.ts @@ -1,6 +1,5 @@ declare namespace MapboxMapModuleScssNamespace { export interface IMapboxMapModuleScss { - sidebar: string; mapContainer: string; j40Popup: string; } diff --git a/client/src/components/mapboxMap.tsx b/client/src/components/mapboxMap.tsx index 9a6f77da..eb17cb65 100644 --- a/client/src/components/mapboxMap.tsx +++ b/client/src/components/mapboxMap.tsx @@ -9,10 +9,10 @@ import {LngLatBoundsLike, import mapStyle from '../data/mapStyle'; import ZoomWarning from './zoomWarning'; import PopupContent from './popupContent'; -import * as styles from './mapboxMap.module.scss'; import * as constants from '../data/constants'; import ReactDOM from 'react-dom'; import 'mapbox-gl/dist/mapbox-gl.css'; +import * as styles from './mapboxMap.module.scss'; type ClickEvent = mapboxgl.MapMouseEvent & mapboxgl.EventData; @@ -34,8 +34,14 @@ const MapboxMap = () => { maxZoom: constants.GLOBAL_MAX_ZOOM, maxBounds: constants.GLOBAL_MAX_BOUNDS as LngLatBoundsLike, }); + // disable map rotation using right click + drag + initialMap.dragRotate.disable(); + + // disable map rotation using touch rotation gesture + initialMap.touchZoomRotate.disableRotation(); + initialMap.on('click', handleClick); - initialMap.addControl(new NavigationControl()); + initialMap.addControl(new NavigationControl({showCompass: false}), 'top-left'); map.current = initialMap; }); @@ -43,7 +49,7 @@ const MapboxMap = () => { const map = e.target; const clickedCoord = e.point; const features = map.queryRenderedFeatures(clickedCoord, { - layers: ['score-low'], + layers: ['score'], }); if (features.length && features[0].properties) { @@ -52,11 +58,11 @@ const MapboxMap = () => { const options : PopupOptions = { offset: [0, 0], className: styles.j40Popup, + focusAfterOpen: false, }; new Popup(options) .setLngLat(e.lngLat) .setDOMContent(placeholder) - .setMaxWidth('300px') .addTo(map); } }; @@ -66,10 +72,10 @@ const MapboxMap = () => { map.current.on('move', () => { setZoom(map.current.getZoom()); }); - map.current.on('mouseenter', 'score-low', () => { + map.current.on('mouseenter', 'score', () => { map.current.getCanvas().style.cursor = 'pointer'; }); - map.current.on('mouseleave', 'score-low', () => { + map.current.on('mouseleave', 'score', () => { map.current.getCanvas().style.cursor = ''; }); }); diff --git a/client/src/components/openlayersMap.tsx b/client/src/components/openlayersMap.tsx index cfb44cba..19dd21de 100644 --- a/client/src/components/openlayersMap.tsx +++ b/client/src/components/openlayersMap.tsx @@ -10,7 +10,7 @@ import {Coordinate} from 'ol/coordinate'; import olms from 'ol-mapbox-style'; import mapStyle from '../data/mapStyle'; import ZoomWarning from './zoomWarning'; -import MapPopup from './mapPopup'; +import OpenlayersPopup from './openlayersPopup'; import {transformExtent} from 'ol/src/proj'; import * as styles from './openlayersMap.module.scss'; import * as constants from '../data/constants'; @@ -121,7 +121,7 @@ const MapWrapper = ({features}: IMapWrapperProps) => { <>Census Block Group: | -{blockGroup} | -
Just Progress Categorization: | -{getCategorization(score)} | -
Cumulative Index Score: | -{readablePercent(score)} | -
Indicator | -Percentile(0-100) | +INDICATOR | +VALUE |
---|