Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

derive width and height from feature property #14

Open

Description

@andrewharvey

The accessible elements currently have a fixed width and height given in the plugin options. It would be nice to set from an expression evaluated per feature.

For example if you had a circle layer with variable circle-radius you could ensure the accessible element had the same width/height as the circle, so the focus style would match what's on the screen.

Activity

  1. added
    iOS SDK parity
    on Apr 29, 2018
  2. orangemug commented on May 16, 2018

    @orangemug

    It looks like this has been fixed already

    const featureBbox = bbox(feature);
    const bl = this.map.project([featureBbox[0], featureBbox[1]]);
    const tr = this.map.project([featureBbox[2], featureBbox[3]]);
    width = Math.abs(tr.x - bl.x);
    height = Math.abs(tr.y - bl.y);
    position = {
    x: ((tr.x + bl.x) / 2),
    y: ((tr.y + bl.y) / 2),
    };
    }
    feature.marker.style.width = `${width}px`;
    feature.marker.style.height = `${height}px`;

  3. andrewharvey commented on May 17, 2018

    @andrewharvey
    CollaboratorAuthor

    It looks like this has been fixed already

    That's for the source geometry only, it doesn't take into account the paint/layout properties on the layer which create a rendered feature which has a different box to the source geometry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    iOS SDK parity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions