You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, i am working on map where i have some pins, and when i click on pins it open bottomsheet. Problem is, that when i click on any marker it reset position, or when i close bottomsheet that has nothing to do with map it reset again on user location. My code is long and in many components so i cant show you everythig but i will show u how Map and Marker works
Reproducible sample code
<MapViewshowsPointsOfInterest={false}ref={mapRef}showsUserLocationfollowsUserLocation={true}containerHeight={'50%'}style={{flex: 1}}showsTrafficinitialRegion={initialRegion}>{waypointLocation ? <DestinationMarkDirection/> : null}<EventLocationGeneratorevents={events}/>{/* Map legend show all icons like gas stations, shop etc */}<MapLegendspots={spots}/></MapView>)return(spots.map((res,index)=>{constcords={latitude: res.address.latitude,longitude: res.address.longitude}return(<MarkeronPress={()=>handleMarkClick(res._id)}key={index}coordinate={cords}><SpotsMarkersdata={res}/></Marker>)}));}return(<Viewstyle={{flex: 1}}><Map_BuilderDataContext.Providervalue={{ setLegendId, newWaypoint, initialRegion }}>{/* Her eis map */}{events&&spots ? <MapIsReady/> : <ConnectingToMaps/>}{/* <BottomScheet/> */}<MyBottomSheetisOpen={isOpen}onClose={()=>setIsOpen(false)}><MapLegendDetailslegendData={legendData}/></MyBottomSheet></Map_BuilderDataContext.Provider></View>)}
Steps to reproduce
.
Expected result
I was expecting to not reset to my position all the time
Actual result
Description
React Native Maps Version
1.7.1
What platforms are you seeing the problem on?
Android, iOS (Apple Maps)
React Native Version
0.72.6
What version of Expo are you using?
SDK 48
Device(s)
iphone 14 128gb iphone x and some redmi
Additional information
No response
The text was updated successfully, but these errors were encountered:
HI @DETLIXX, thanks for reporting this. Can you try to reproduce it with minimum amount of code? If you have it inside context and passing and you are passing props to map component I can't reproduce it on my environment. From the first look I would say that there might be too many re-renders which are causing this bug. But I wouldn't say it's a library bug. The best way to debug this is creating new screen with map, bottom sheet and mocked data for region and markers and see if it works fine. If it does you can add more functionalities from your map component and at some point you will find out what's wrong.
Summary
Hello, i am working on map where i have some pins, and when i click on pins it open bottomsheet. Problem is, that when i click on any marker it reset position, or when i close bottomsheet that has nothing to do with map it reset again on user location. My code is long and in many components so i cant show you everythig but i will show u how Map and Marker works
Reproducible sample code
Steps to reproduce
.
Expected result
I was expecting to not reset to my position all the time
Actual result
Description
React Native Maps Version
1.7.1
What platforms are you seeing the problem on?
Android, iOS (Apple Maps)
React Native Version
0.72.6
What version of Expo are you using?
SDK 48
Device(s)
iphone 14 128gb iphone x and some redmi
Additional information
No response
The text was updated successfully, but these errors were encountered: