Skip to content

Graticule labels malformed - using with React-leaflet #4

@rm-hull

Description

@rm-hull

I've got this react code to wrap the grid lines

import { useEffect } from "react";
import { useMap } from "react-leaflet";
import AutoGraticule from "leaflet-auto-graticule";

export function GridlinesLayer() {
  const map = useMap();

  useEffect(() => {
    const graticule = new AutoGraticule({
      redraw: "moveend",
    }).addTo(map);

    return () => {
      map.removeLayer(graticule)
    };
  }, [map]);

  return null;
}

it results in labels that are not formatted correctly:

Image

Any ideas? I'd be happy to take a look if you have any pointers?

Versions

package version
leaflet ^1.9.4
leaflet-auto-graticule ^2.0.0
react ^19.2.4
react-leaflet ^5.0.0

Latest Chrome browser on MacOS Tahoe 26.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions