Closed selmancanklnc closed 3 months ago
I am displaying a map in the structure I use in BottomSheet. While the map I designed in Webview works properly in "Scrollview" in normal pages, it does not move with one finger in "BottomSheetScrollView" and cannot be zoomed with two fingers.
Describe what you expected to happen:
... return ( <BottomSheet enableDynamicSizing={false} ref={sheetRef} index={-1} snapPoints={snapPoints} onClose={closeBottomSheetFnc} enablePanDownToClose={true} style={styles.bottomSheet} backdropComponent={renderBackdrop} > {props.children} </BottomSheet> );
DetailMapBottomSheet.tsx - ({props.children})
... return ( <BottomSheetScrollView> <LeafletMap defaultMarkerIcon="https://cdn0.iconfinder.com/data/icons/isometric-city-basic-transport/48/truck-front-01-512.png" defaultZoom={7} initialCoordinates={[lat , long]} markerCoordinates={[lat, long]} popupContentTime={``} popupContentAdress={``} /> </BottomSheetScrollView> );
... const html = ` <!DOCTYPE html> <html> <head> <title>Leaflet Map</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" /> <style> html, body { margin: 0; padding: 0; height: 100%; width: 100%; } #map { height: 100vh; width: 100vw; } .popup-content-container { max-height: 100px; overflow-y: auto; } .popup-content { max-height: 50px; overflow-y: auto; padding: 0; margin: 0; } </style> </head> <body> <div id="map"></div> <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script> <script> var map = L.map('map').setView([${initialCoordinates[0]}, ${ initialCoordinates[1] }], ${defaultZoom}); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19 }).addTo(map); var customIcon = L.icon({ iconUrl: '${defaultIconUrl}', iconSize: [41, 41], iconAnchor: [20, 20], popupAnchor: [0, -20], tooltipAnchor: [16, -28], shadowSize: [41, 41] }); var centerMarker = L.marker(map.getCenter(), { icon: customIcon }).addTo(map); var customPopup = L.popup({ minWidth: 40, minHeight: 40, autoClose: false }).setContent(\` <div class="popup-content-container"> <div class="popup-content"> <p style="text-align: center; font-weight: bold; color: grey; margin: 0;"> ${popupContentTime ?? "-"} </p> <p style="text-align: center; font-weight: bold; color: grey; margin: 0;"> ${popupContentAdress ?? "-"} </p> </div> </div> \`); </script> </body> </html> `; return ( <View style={styles.container}> <WebView originWhitelist={["*"]} source={{ html }} style={styles.webview} /> </View> );
@selmancanklnc Did you fix it? Can you explain how please?
Bug
I am displaying a map in the structure I use in BottomSheet. While the map I designed in Webview works properly in "Scrollview" in normal pages, it does not move with one finger in "BottomSheetScrollView" and cannot be zoomed with two fingers.
Environment info
Steps To Reproduce
Describe what you expected to happen:
Reproducible sample code
DetailMapBottomSheet.tsx - ({props.children})