Skip to content

Type error when providing draw options #161

Open
@mjpoo

Description

@mjpoo

If I specify that a polygon (or other shape such as a circle) should be false in the drawOptions like so:

  drawOptions = {
    draw:{
      polygon: false,
    },
    edit: {
      featureGroup: this.drawnItems,
    }
  };

then the following type error is thrown at [leafletDrawOptions]="drawOptions" in the console:

Type '{ draw: { polygon: boolean; }; edit: { featureGroup: L.FeatureGroup<any>; }; }' is not assignable to type 'DrawConstructorOptions'.
  The types of 'draw.polygon' are incompatible between these types.
    Type 'boolean' is not assignable to type 'false | PolygonOptions | undefined'.ngtsc(2322)

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