MR Int
MR Int

Reputation: 43

React-leaflet LeafletTrackingMarker does not work when it's under MarkerCLusterGroup

how to move smooth markers from old coordinate to new coordinate in MarkerCLusterGroup i have a code in reactjs that works perfectly for LeafletTrackingMarker lets assume that i have 10 position , when there is an one position get updated there is an event to update teh list of cooridnate then the LeafletTrackingMarker will drag the old coordinate to the new once, that's works perfect , but when i use the smooth move of coordinate stopped working .... also if the marker is in the cluster group nothing will happen to the new coordinate

 <MapContainer
                    ref={mapRef} // Assign the ref to the MapContainer
                    center={position}
                    zoom={13}
                    minZoom={3}
                    attributionControl={true}
                    zoomControl={false}
                >
             
                    <LayersControl position="topright">
                        <LayersControl.BaseLayer name="Light" checked>
                            <TileLayer
                                url={process.env.REACT_APP_MAP_LIGHT}
                                attribution={process.env.REACT_APP_ATTRIBUTION}
                            />
                        </LayersControl.BaseLayer>
                    </LayersControl>
                    <MarkerClusterGroup>
                        {coordinates?.map((coordinate) => (
                            <LeafletTrackingMarker
                                key={coordinate.id}
                                position={[coordinate.latitude, coordinate.longitude]}
                                icon={/*icon call */}
                                duration={500}
                                keepAtCenter={false}
                                options={{ coordinate: coordinate }}
                            >
                            </LeafletTrackingMarker>
                        ))}
                    </MarkerClusterGroup>
                </MapContainer>

so please help me how to work with LeafletTrackingMarker and MarkerClusterGroup i need both to be working ... that means even if the markers is in the cluster group the animation of the coordinate or the move of the coordinate form old to the updated one must work

thank you

Upvotes: 1

Views: 68

Answers (0)

Related Questions