Skip to content

[Feature Request] allow different mode name for terra-draw mode #627

@JinIgarashi

Description

@JinIgarashi

Is your feature request related to a problem? Please describe.

Currently, mode name is hard coded for each terra-draw mode.

The below is an example of point mode

export class TerraDrawPointMode extends TerraDrawBaseDrawMode<PointModeStyling> {
mode = "point" as const;

If users want to add two point modes for different functionalities, currently we cannot add second one because mode name is already added.

Describe your proposed idea for the solution to this problem

maybe mode name can be set through constructor like below.

const point = new TerraDrawPointMode({
})
const point2 = new TerraDrawPointMode({
  mode: `point2`
})

Describe alternatives you've considered

Currently no way to use two modes using same mode name.

Additional context

For example, I am implementing valhalla isochrone api by using terradraw point mode.

If I can add two point modes, one can be used for time isochrone, another one can be used for distance isochrone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions