Skip to content

Existing features don't get rerendered on draw.set #1122

@wyozi

Description

@wyozi

mapbox-gl-js version: 2.10.0
mapbox-gl-draw version: 1.3.0

Steps to Trigger Behavior

  1. Have custom style for feature based on user properties, e.g.
  {
    id: "draw-path-arrows",
    type: "symbol",
    filter: ["all", ["==", "$type", "LineString"], ["has", "user_arrows"], ["!=", "user_arrows", "none"]],
    layout: {
      'symbol-placement': 'line',
      'symbol-spacing': 20,
      'icon-allow-overlap': true,
      'icon-rotate': ['case', ['==', ['get', 'user_arrows'], 'fwd'], 0, 180],
      // 'icon-ignore-placement': true,
      'icon-image': 'arrow',
      'icon-size': 1,
      'visibility': 'visible'
    },
  },
  1. Change feature property (here arrows) and set all features with draw.set

Expected Behavior

Given feature updates and re-renders so custom style properties are applied correctly.

Actual Behavior

Feature doesn't re-render so property change has no effect until something else triggers a re-render.

I assume something should be added here

internalFeature.properties = feature.properties;
to trigger re-render if properties change

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