Skip to content

Feature: Add "source" variable to VectorLayer/HeatmapLayer #340

@felixfiskare

Description

@felixfiskare

Feature

Add a VectorSource directly to a VectorLayer / HeatmapLayer

Why

I would like to use one VectorSource for multiple HeatmapLayer Instances. Unfortunately I can't set a VectorSource as a "source" directly. Looking at the code I can see, that a VectorSource is being created during the Layer Initialization. Could you be so kind and add the source Variable to the VectorLayer as a direct Input?

I'm thinking about something like this:

const sharedVectorSource = new VectorSource({
    ...
  });

 return <>
    <RMap >
      {/* First layer using the shared source */}
      <RLayerHeatmap source={sharedVectorSource} weight={weightFunction1} />

      {/* Second layer using the same source but with a different weight function */}
      <RLayerHeatmap source={sharedVectorSource} weight={weightFunction2} />
    </RMap>
  );
};
<>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions