Really tried to not post this as I've seen similar questions but I'm not able to display anything over the react leaflet library after reading things online.
The following code snippets show the markup for the map and the overlay I'm trying to produce.
Many thanks, any help appreciated.
Looking at other questions online people refer to making the Map container position: absolute and setting the z-index to 400+ which doesn't seem to make a difference for me with the markup below.
Map markup
<Map
zoomControl={false}
doubleClickZoom= {false}
closePopupOnClick= {false}
dragging= {false}
zoomSnap= {false}
zoomDelta= {false}
trackResize= {false}
scrollWheelZoom= {false}
touchZoom={false}
className="map"
worldCopyJump={true}
center={position}
zoom={this.state.zoom}>
<TileLayer
attribution="&copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors and Chat location by Iconika from the Noun Project"
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
{this.state.pins.map(pin => (
<Marker
onClick={() => this.showPanel(pin)}
key={pin._id}
position={[pin.latitude, pin.longitude]}
icon={pinIcon}>
</Marker>
))}
</Map>
Overlay markup
<div ref={ref => this.el = ref}>
<button onClick={() => this.setState({ isPaneOpen: true })}>Click me to open right pane!</button>
<SlidingPane
className='some-custom-class'
overlayClassName='some-custom-overlay-class'
isOpen={ this.state.isPaneOpen }
title='Hey, it is optional pane title. I can be React component too.'
subtitle='Optional subtitle.'
onRequestClose={ () => {
// triggered on "<" on left top click or on outside click
this.setState({ isPaneOpen: false });
} }>
<div className="container-fluid padding">
</div>
</SlidingPane>
Update
I have now moved the overlay into a function, shown below
function MyOverLay(props) {
return <SlidingPane
className='some-custom-class'
overlayClassName='some-custom-overlay-class'
isOpen={ props.isPaneOpen }
title='Book here
</SlidingPane>
}
The change in the markup is shown below
New markup
<div>
<MyOverLay isPaneOpen={this.state.isPaneOpen} />
<div className="container-fluid padding">
<div className="row padding">
<div className="col-lg-8">
<Map zoomControl={false}
doubleClickZoom= {false}
closePopupOnClick= {false}
dragging= {false}
zoomSnap= {false}
zoomDelta= {false}
trackResize= {false}
scrollWheelZoom= {false}
touchZoom={false}
className="map"
worldCopyJump={true}
center={position}
zoom="13">
<TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" />
<Marker
position={[10, -10]}
icon={messageIcon}>
</Marker>
</Map>
</div>