Skip to content

Marker doesn't stay pinned when zoomed on NextJS 13.5.2 #12

@Lodimup

Description

@Lodimup

Great lib the only problem I have so far is When zoomed the marker moves from its correct position. Thanks!

export const MarkerCard = (props: MarkerCardProps) => {
...
return (
    <Marker
      position={props.location}
      size={[224, 112]}
      riseOnHover
      placement="bottom"
    >
...
      <MapContainer
        className="h-screen w-full bg-gray-100"
        // @ts-ignore
        center={coord}
        zoom={16}
        scrollWheelZoom={false}>
        <TileLayer
          attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
          url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
        />
        <HandleLocation />
        <MarkerLayer>
          {DUMMY.map((props, index) => (<MarkerCard key={props.id} {...props}/>))}
        </MarkerLayer>
      </MapContainer>

it seems that this problem is NextJS specific. PaulLeCam/react-leaflet#808 (comment) does not resolve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions