diff --git a/src/components/elements/Map-mapbox/GeoJSON.d.ts b/src/components/elements/Map-mapbox/GeoJSON.d.ts index 3955e329d..b44ebefaa 100644 --- a/src/components/elements/Map-mapbox/GeoJSON.d.ts +++ b/src/components/elements/Map-mapbox/GeoJSON.d.ts @@ -43,11 +43,6 @@ export interface MultiPolygon extends GeoJsonObject { type: "MultiPolygon"; coordinates: Position[][][]; } -// uncomment this block if you need the GeometryCollection type -// export interface GeometryCollection extends GeoJsonObject { -// type: "GeometryCollection"; -// geometries: G[]; -// } export type GeoJsonProperties = { [name: string]: unknown } | null; diff --git a/src/components/elements/Map-mapbox/Map.tsx b/src/components/elements/Map-mapbox/Map.tsx index 648fe1e0e..37112c7ad 100644 --- a/src/components/elements/Map-mapbox/Map.tsx +++ b/src/components/elements/Map-mapbox/Map.tsx @@ -1,10 +1,7 @@ import "mapbox-gl/dist/mapbox-gl.css"; import _ from "lodash"; -//@ts-ignore -//@ts-ignore import mapboxgl from "mapbox-gl"; -//@ts-ignore import React, { useEffect } from "react"; import { DetailedHTMLProps, HTMLAttributes, useState } from "react"; import { When } from "react-if"; @@ -113,8 +110,8 @@ export const MapContainer = ({ const context = useSitePolygonData(); const { isUserDrawingEnabled } = isUserDrawing ? { isUserDrawingEnabled: isUserDrawing } - : context || { isUserDrawingEnabled: false }; - const { toggleUserDrawing, toggleAttribute, reloadSiteData } = context || {}; + : context ?? { isUserDrawingEnabled: false }; + const { toggleUserDrawing, toggleAttribute, reloadSiteData } = context ?? {}; if (!mapFunctions) { return null; } diff --git a/src/components/elements/Map-mapbox/MapControls/CheckPolygonControl.tsx b/src/components/elements/Map-mapbox/MapControls/CheckPolygonControl.tsx index d0112429f..6006e968f 100644 --- a/src/components/elements/Map-mapbox/MapControls/CheckPolygonControl.tsx +++ b/src/components/elements/Map-mapbox/MapControls/CheckPolygonControl.tsx @@ -129,7 +129,7 @@ const CheckPolygonControl = (props: CheckSitePolygonProps) => {
- {`${polygon.label || "Unnamed Polygon"} ${polygon.checked ? "" : "(not checked yet)"}`} + {`${polygon.label ?? "Unnamed Polygon"} ${polygon.checked ? "" : "(not checked yet)"}`}
))} diff --git a/src/components/elements/Map-mapbox/utils.ts b/src/components/elements/Map-mapbox/utils.ts index edd1ac6ce..d58b0f9c7 100644 --- a/src/components/elements/Map-mapbox/utils.ts +++ b/src/components/elements/Map-mapbox/utils.ts @@ -12,7 +12,7 @@ import type { LayerType, LayerWithStyle, TooltipType } from "./Map.d"; const GEOSERVER = "https://geoserver-prod.wri-restoration-marketplace-api.com"; export const getFeatureProperties = (properties: any, key: string): T | undefined => { - return properties[key] || properties[`user_${key}`]; + return properties[key] ?? properties[`user_${key}`]; }; export const convertToGeoJSON = (featureCollection: FeatureCollection) => {