ArcGIS JSAPI ESM with create-react-app

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 15

  • @khamdamov
    @khamdamov Год назад

    Hello. Thank you for your effort. I've created Arcgis map in react. But The problem is when I change the custom marker coordinates, The map gets re-created inside useEffect. Lat-Long comes as props from Parent component.

  • @EdEpants
    @EdEpants 3 года назад +1

    Hi Rene, documentation is pushing users towards ES modules for React. However, when I build the projects, like in the example you provide, the build is very large. My project goes from being 280kb to 10mb and it takes a long time to build on my laptop. Is that how it should be?

    • @odoenet
      @odoenet  3 года назад

      if you mean files on disk, yes, you will get about 10mb or so due to all the dynamic loading of modules we do for runtime performance. Not everything used at runtime, an app might push 1mb in JS, but you'll never use all 10MB unless you are building a super mapping authoring app.

    • @EdEpants
      @EdEpants 3 года назад

      @@odoenet Thanks for the quick feedback. I am new to using ESRI maps in React and am exploring my options. Will there be long term support for esri-loader? I think it would better fit my need but worry that support will fall off.

  • @xiajiayu3443
    @xiajiayu3443 3 года назад +1

    Greetings, I am new to both Arcgis and React. I followed your tutorial step by step but somehow failed to see the map in my website. I mean the website is running but the map is blank and my mouse can actually pull something around and zoom in and out. It's just blank.
    I am not sure what did I miss. Should I do anything else beside 'npm install @arcgis/core'?
    I mean other things are basically copy paste, it's not easy to messing up.
    And these are the warning
    s showed in the console:
    ./node_modules/@arcgis/core/core/workers/workers.js
    Critical dependency: the request of a dependency is an expression
    ./node_modules/@arcgis/core/core/workers/WorkerFallback.js
    Critical dependency: the request of a dependency is an expression
    src\App.js
    Line 21:13: 'view' is assigned a value but never used no-unused-vars
    Thank your for nice video which has already inspired me a lot.

    • @odoenet
      @odoenet  3 года назад +1

      Try to compare you project against this sample and see if anything might be missing. github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app The warnings are expected and are not an issue. The view warning is fine, just a linting rule in CRA.

    • @xiajiayu3443
      @xiajiayu3443 3 года назад

      @@odoenet Hey, thanks for your reply. I followed the steps again. Still didn't work.
      In the chrome console, it says "Failed to load basemap" etc.
      I clean the caches and try other browsers, still the same problem.
      Then I tried the demo in github.com/Esri/react-arcgis
      It works. Weird. Do you have a clue?
      Thank you anyway. :)

    • @tilsteinmetz546
      @tilsteinmetz546 3 года назад

      @@xiajiayu3443 Hi there - I've just gone through the video and after getting stuck with the same error as you (I believe), worked out that the "ncp ...assets" command that's shown in the jsapi-resources Github page wasn't actually copying any of the assets from the public folder to the src folder. After copying the entire folder contents manually, the app works. That's probably not the correct way to do it but will get you to have something running

    • @xiajiayu3443
      @xiajiayu3443 3 года назад

      @@tilsteinmetz546 wow thanks for the tips!

  • @vijayraj6998
    @vijayraj6998 2 года назад

    Hi Rene.. Request you to add the complete series for ARCGIS JSAPI with REACT for beginners.. Record and put that in UDEMY if possible

  • @MrEnsiferum77
    @MrEnsiferum77 3 года назад

    How u can add custom markers?

    • @odoenet
      @odoenet  3 года назад

      Look at this picture marker symbol sample developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html