Skip to content

Export GeoJsonWorkerSource and related options in package exports #6936

@gowin20

Description

@gowin20

User Story

I'm developing MapLibre ArcGIS, the official Esri plugin for Maplibre that allows for loading of ArcGIS data layers.

Our FeatureLayer class loads data as a GeoJSONSource, but it requires a custom data loading algorithm to support our use case. Because of this, we're not using the built-in GeoJSON worker to its full capabilities, and all of the data processing is single-threaded. It's slow.

For our solution, we'd like to write our own custom source type (esriFeatureLayer), that extends GeoJSONSource and uses a custom worker to load data. The existing GeoJSONWorkerOptions of the GeoJSON worker are great, but unfortunately they are not sufficient for our use case. We need to extend the worker class and overwrite the loadData function with a fully custom implementation.

We are currently blocked from development because none of the relevant classes are exported from this package. Please export these classes publicly so that we can continue enhancing our plugin!

We also need a way to register message handlers for our custom worker script. It'd be great if there was a method on the Worker class to register custom messages programmatically:

this.actor.registerMessageHandler(MessageType.updateGlobalState, async (mapId: string, params: Record<string, any>) => {

Alternatives considered

I also looked into the importScriptInWorkers method; it might be possible to implement our custom worker using this method instead. However I'm fully lost on how to do this. It seems like best practice to simply extend the GeoJSONWorkerSource, since that's the essence of what we want to do anyways.

Impact

  • This will greatly improve the performance of the Maplibre ArcGIS plugin, which help MapLibre become more popular with ArcGIS customers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    need more infoFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions