Next JS + Leaflet Map Tutorial

Поділитися
Вставка
  • Опубліковано 5 вер 2024
  • This tutorial will cover utilizing Leaflet JS and react-leaflet within a Next JS application.

КОМЕНТАРІ • 45

  • @diegofilastro5999
    @diegofilastro5999 Рік тому +3

    You just "save my life", I was "spinning" with this "window" error, thank you man!

    • @halfword
      @halfword  Рік тому +1

      🫰

    • @saitamasensie2865
      @saitamasensie2865 6 місяців тому

      Hello, is your problem solved? If i use dyanamic then I will get "Hydration failed because the initial UI does not match what was rendered on the server." Error. What should I do remove this?

  • @SINGH-jp6ju
    @SINGH-jp6ju 10 місяців тому +2

    i am getting error..
    ⨯ node_modules\@react-leaflet\core\lib\context.js (15:44) @ eval
    ⨯ TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
    at __webpack_require__ (C:\Users\Administrator\Desktop
    extproject\map\.next\server\webpack-runtime.js:33:43)
    at __webpack_require__ (C:\Users\Administrator\Desktop
    extproject\map\.next\server\webpack-runtime.js:33:43)
    at eval (./components/Map/Map.js:9:71)
    at (rsc)/./components/Map/Map.js (C:\Users\Administrator\Desktop
    extproject\map\.next\server\_rsc_components_Map_Map_js.js:20:1)
    at Function.__webpack_require__ (C:\Users\Administrator\Desktop
    extproject\map\.next\server\webpack-runtime.js:33:43)
    null
    can you please help me?

    • @romanyefimets454
      @romanyefimets454 10 місяців тому

      I was having this issue when my file name was lower case 'map', try changing it to upper case 'Map'
      I also do not use the index.js to avoid ssr, I just put 'use client'; at the top of Map.js

    • @ronaldoscouto
      @ronaldoscouto 6 місяців тому

      I put "use client;" on first line.

  • @mainasaraolulanke1058
    @mainasaraolulanke1058 Рік тому

    W tutorial fr, I've been battling with that window error for a whole day now, thank you so much

  • @thanuumusic
    @thanuumusic 5 місяців тому

    Thank you so much this helped me much greater than even you can imagine

  • @RahulSharma-qj6nf
    @RahulSharma-qj6nf 7 місяців тому

    Thank You you for this perfect solution for my silly problems.

  • @hitterobr
    @hitterobr Рік тому +2

    I'm getting errors trying to use it with Next 13.0.1

  • @akshatkumar7526
    @akshatkumar7526 Рік тому +2

    Bless you man... helped me a lot

  • @isaitred
    @isaitred Рік тому +1

    Map container is already initialized. error

  • @realidadeinvestidor
    @realidadeinvestidor 9 місяців тому

    congrats! thanks you helped me!

  • @LAITO1222
    @LAITO1222 Рік тому

    thanks, that window error was killling me

  • @gromhellscream5581
    @gromhellscream5581 Рік тому

    Awesome, helped a lot. Thanks!

  • @keertihegde2929
    @keertihegde2929 Рік тому

    It helped me a lot .. Thanks to halfword

  • @hypertextassassins4545
    @hypertextassassins4545 Рік тому

    I love you man :(___ You saved My Freaking life!

  • @andresmpa
    @andresmpa 6 місяців тому

    Bro it's so hard to read what you're typing, at leat make the font bigger...

  • @anesumugomba524
    @anesumugomba524 9 місяців тому

    Thank you!!!!

  • @gamingwithking262
    @gamingwithking262 Рік тому

    Can you provide me the code bcuz i am getting an element undefined error after trying to import Map from index file...

    • @halfword
      @halfword  Рік тому

      Yeah, I’ll put it on my GitHub later today :)

    • @gamingwithking262
      @gamingwithking262 Рік тому

      @@halfword can you provide me your github profile?

    • @halfword
      @halfword  Рік тому +1

      @@gamingwithking262 github.com/cmonyeba/nextjs-leaflet.git

    • @snailedlt
      @snailedlt Рік тому

      I'm getting the same. Did you manage to fix it?

  • @lua.alvaro
    @lua.alvaro Рік тому

    Thank you

  • @SohrabBaqtiari
    @SohrabBaqtiari 6 місяців тому

    Change your zoom and scope of record view in next video please!

  • @wchorski
    @wchorski Рік тому

    plz link source in description

  • @bababa4439
    @bababa4439 9 місяців тому

    Are you have source code?

    • @halfword
      @halfword  6 місяців тому

      sadly not anymore

  • @alsherifkhalaf7385
    @alsherifkhalaf7385 Рік тому

    Thanks for the tutorial ✌️
    It works very well , but i tried to implement this way for NextJs 13 using app folder , but it doesn't work.

    • @halfword
      @halfword  Рік тому

      No problem! In one of the other comments I posted the GitHub link for a reference.

    • @alsherifkhalaf7385
      @alsherifkhalaf7385 Рік тому

      @@halfword I took a look at the repo , I tried to implement it with the new NextJs 13 using the new "app" directory , where the all components are SSR unless you put "use client" on the first line of component .
      I tried this and the map didn't load completely.

    • @htunaung376
      @htunaung376 Рік тому

      it got this error in Nextjs 13. " Error: ctor is not a function"

    • @htunaung376
      @htunaung376 Рік тому

      Problem is solved now. I put 'use client' at the beginning of Map.js. Don't need dynamic function for ssr false.

    • @alsherifkhalaf7385
      @alsherifkhalaf7385 Рік тому

      @@htunaung376 but the map loaded completely?

  • @ron-almog
    @ron-almog 7 місяців тому

    the tiny and blurred font, together with your quite voice, making this video unusable. too bad, because the content is interesting. why not zoom in on what your'e doing?