11import { useState } from "react" ;
22import L from "leaflet" ;
3+ import type { Geometry } from "geojson" ;
34import { useMap } from "./hooks/useMap" ;
45import { useProject } from "../../context/ProjectContext" ;
56import PinkLineMapPage from "./PinkLineMapPage" ;
@@ -19,7 +20,10 @@ const MapPage = () => {
1920
2021 if ( projectMeta ) {
2122 try {
22- const geojson = projectMeta ;
23+ const geojson : Geometry =
24+ typeof projectMeta === "string"
25+ ? ( JSON . parse ( projectMeta ) as Geometry )
26+ : ( projectMeta as unknown as Geometry ) ;
2327 if ( geojson . type === "Polygon" && geojson . coordinates . length > 0 ) {
2428 const coords = geojson . coordinates [ 0 ] ;
2529 const latSum = coords . reduce (
@@ -60,7 +64,7 @@ const MapPage = () => {
6064 const isMemorialSites = project ?. id === "33333333-3333-3333-3333-333333333333" ;
6165 const isTestimony = project ?. id === TESTIMONY_PROJECT_ID ;
6266 const isSpecialProject = project ?. name === "Pink Line" || isMemorialSites ;
63- const { mapRef, drawControlRef, featureCount } = useMap ( {
67+ const { mapRef, drawControlRef } = useMap ( {
6468 center : mapInitCenter ,
6569 enabled : ! isLoading && ! isSpecialProject ,
6670 onShapeCreated : handleShapeCreated ,
@@ -77,7 +81,7 @@ const MapPage = () => {
7781 return (
7882 < >
7983 < div key = { project ?. id || "no-project" } id = "map" style = { { height : "100vh" , width : "100%" } } > </ div >
80- < BaseMapControls mapRef = { mapRef } drawControlRef = { drawControlRef } featureCount = { featureCount } isHebrew = { isTestimony } />
84+ < BaseMapControls mapRef = { mapRef } drawControlRef = { drawControlRef } isHebrew = { isTestimony } />
8185 { pendingLayer && (
8286 project ?. id === TESTIMONY_PROJECT_ID ? (
8387 < TestimonyForm
0 commit comments