Skip to content

Layer layout with "icon-text-fit-padding" not working in ios #95

@MarkOdey

Description

@MarkOdey

Hello I am currently evaluating this library for a project and noticed some support differences between ios and android.

For this case, I am able to apply "icon-text-fit": "width" to resize icon to the text size for both environment but when I provide "icon-text-fit-padding" I get an error which breaks layer rendering in ios.

` this.mapbox
.addLayer({
id: "store-locations",
type: "symbol",
source: "stores",
filter: ["has", "label_en"],
minzoom: 0,
maxzoom: 20,

      layout: {
        "icon-opacity": ["case", ["has", "label_en"], 1, 0],
        "text-field": [
          "case",
          ["has", "label_en"],
          ["get", "label_en"],
          "",
        ],
        "icon-image": ["case", ["has", "label_en"], "box2", ""],
        "icon-text-fit": "width",
        "icon-text-fit-padding": [0, 0, 0, 0],

        "icon-size": 1,
        "text-font": ["Open Sans Regular", "Arial Unicode MS Regular"],
        "text-size": 12,
      },
    })
    .catch((e) => {
      console.log(e);
    });`

This is the error in IOS

Error: -[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0xac6605cc1e5c96e6

I suspect that should be a supported attribute in ios as if I provide a wrong format I get an error that the format needs to be an array with 4 items.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions