Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 743 Bytes

leaflet.md

File metadata and controls

29 lines (17 loc) · 743 Bytes

Using Leaflet (v1.9.4) in Next.js (v14.1) with React-Lealfet (v4.2.1)

Solution found on Stackoverflow :

Leaflet

and here on Medium:

Leaflet

For typescript user:

  • Create a new directory in nodes_modules/@types

  • Name it "leaflet-defaulticon-compatibility".

  • Create a new file named "index.d.ts".

Add this line :

declare module 'leaflet-defaulticon-compatibility';

Now you can import without errors in your file.tsx :

import "leaflet-defaulticon-compatibility";