isSupportedScript

open fun isSupportedScript(expression: Expression): Expression

Returns true if the input string is expected to render legibly. Returns false if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the mapbox-gl-rtl-text plugin is not in use in MapLibre GL JS).

Example usage:


maplibreMap.getStyle().addLayer(new SymbolLayer("layer-id", "source-id")
  .withProperties(
    textField(
      switchCase(
        isSupportedScript(get("name_property")), get("name_property"),
        literal("not-compatible")
      )
    )
  ));

Return

expression

Parameters

expression

the expression to evaluate

See also

<a href="https://maplibre.org/maplibre-style-spec/expressions/#is-supported-script">Style

specification


Returns true if the input string is expected to render legibly. Returns false if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the mapbox-gl-rtl-text plugin is not in use in MapLibre GL JS).

Example usage:


maplibreMap.getStyle().addLayer(new SymbolLayer("layer-id", "source-id")
.withProperties(
  textField(
    switchCase(
      isSupportedScript("ಗೌರವಾರ್ಥವಾಗಿ"), literal("ಗೌರವಾರ್ಥವಾಗಿ"),
      literal("not-compatible"))
    )
  )
);

Return

expression

Parameters

string

the string to evaluate

See also

<a href="https://maplibre.org/maplibre-style-spec/expressions/#is-supported-script">Style

specification