@@ -318,35 +318,37 @@ function MapPopoverFactory(LayerHoverInfo, CoordinateInfo) {
318318
319319 return (
320320 < ThemeProvider theme = { lightTheme } >
321- < FloatingFocusManager context = { context } modal = { frozen } >
322- < StyledMapPopover
323- className = { classNames ( [
324- 'map-popover-container' ,
325- expanded && 'expanded' ,
326- expanded && ! isMobile && 'full-width' ,
327- expanded && isMobile && 'full-width-mobile' ,
328- ] ) }
329- ref = { refs . setFloating }
330- style = { floatingStyles }
331- { ...getFloatingProps ( ) }
332- >
333- < PopoverContent
334- className = { classNames ( [ 'map-popover' , expanded && 'expanded' ] ) }
335- expandable = { expandable }
336- maxTooltipFields = { maxTooltipFields }
321+ { layerHoverProp . fieldsToShow . length > 0 && (
322+ < FloatingFocusManager context = { context } modal = { frozen } >
323+ < StyledMapPopover
324+ className = { classNames ( [
325+ 'map-popover-container' ,
326+ expanded && 'expanded' ,
327+ expanded && ! isMobile && 'full-width' ,
328+ expanded && isMobile && 'full-width-mobile' ,
329+ ] ) }
330+ ref = { refs . setFloating }
331+ style = { floatingStyles }
332+ { ...getFloatingProps ( ) }
337333 >
338- { Array . isArray ( coordinate ) && < CoordinateInfo coordinate = { coordinate } zoom = { zoom } /> }
339- { layerHoverProp && (
340- < LayerHoverInfo
341- { ...layerHoverProp }
342- expanded = { expanded }
343- setExpanded = { setExpanded }
344- setExpandable = { setExpandable }
345- />
346- ) }
347- </ PopoverContent >
348- </ StyledMapPopover >
349- </ FloatingFocusManager >
334+ < PopoverContent
335+ className = { classNames ( [ 'map-popover' , expanded && 'expanded' ] ) }
336+ expandable = { expandable }
337+ maxTooltipFields = { maxTooltipFields }
338+ >
339+ { Array . isArray ( coordinate ) && < CoordinateInfo coordinate = { coordinate } zoom = { zoom } /> }
340+ { layerHoverProp && (
341+ < LayerHoverInfo
342+ { ...layerHoverProp }
343+ expanded = { expanded }
344+ setExpanded = { setExpanded }
345+ setExpandable = { setExpandable }
346+ />
347+ ) }
348+ </ PopoverContent >
349+ </ StyledMapPopover >
350+ </ FloatingFocusManager >
351+ ) }
350352 </ ThemeProvider >
351353 ) ;
352354 } ;
0 commit comments