Skip to content

FeatureLayer: initial tiles are requested concurrently with metadata #1373

@markhepburn

Description

@markhepburn

Describe the bug

FeatureLayers now checks for geojson support, by issuing a metadata query and checking supportedQueryFormats. See #773 and #418 for history.

However, this is done concurrently with the initial set of tiles (FeatureGrid._update()), so the first tiles received are still in arcgis format and must be converted to geojson, which can easily choke the browser on large layers.

See #1372 for a partial fix, which calls _update at the end of the metadata callback, rather than asynchronously. It's only partial because _update is triggered in a few places, so probably needs some way of checking if metadata has loaded yet.

(This all assumes of course that isModern has not been manually set, which forces geojson).

Reproduction

  • Monitor browser's network requests for requests to your esri server
  • Open https://jsbin.com/weduvomeku/1/edit
  • Check the f= parameter in the esri tile requests -- may be slightly deterministic, but expect to see f=json
  • Zoom in, to load more tiles
  • Check the f= parameter again, which this time should be f=geojson

Logs

No response

System Info

Leaflet version: v1.9.0
esri-leaflet version v3.0.11

  System:
    OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
    Memory: 8.90 GB / 15.36 GB
    Container: Yes
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 20.3.1 - ~/.asdf/installs/nodejs/20.3.1/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 9.6.7 - ~/.asdf/plugins/nodejs/shims/npm
  Browsers:
    Chrome: 117.0.5938.92

Additional Information

No response

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