Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Implement Image Expression #37

Closed
tobrun opened this issue Nov 6, 2019 · 1 comment
Closed

Implement Image Expression #37

tobrun opened this issue Nov 6, 2019 · 1 comment
Labels
feature 🍏 New feature or request

Comments

@tobrun
Copy link
Member

tobrun commented Nov 6, 2019

Binding integration of mapbox/mapbox-gl-native#15877

@tobrun tobrun added the feature 🍏 New feature or request label Nov 6, 2019
@tobrun
Copy link
Member Author

tobrun commented Dec 3, 2019

This already landed:

  /**
   * Returns image expression for use in '*-pattern' and 'icon-image' layer properties. Compared to
   * string literals that can be used to represent an image, image expression allows to determine an
   * image's availability at runtime, thus, can be used in conditional <a href="https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions-coalesce">coalesce operator</a>.
   *
   * <p>
   * Example usage:
   * </p>
   * <pre>
   * {@code
   * SymbolLayer symbolLayer = new SymbolLayer("layer-id", "source-id");
   * symbolLayer.setProperties(
   *     iconImage(image(get("key-to-feature")))
   * );
   * }
   * </pre>
   *
   * <p>
   * Example usage with coalesce operator:
   * </p>
   * <pre>
   * {@code
   * SymbolLayer symbolLayer = new SymbolLayer("layer-id", "source-id");
   * symbolLayer.setProperties(
   *     iconImage(
   *         coalesce(
   *             image(literal("maki-11")),
   *             image(literal("bicycle-15")),
   *             image(literal("default-icon"))
   *         )
   *     )
   * );
   * }
   * </pre>
   *
   * @param input expression input
   * @return expression
   * @see <a href="https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions-types-image">Image expression</a>
   */
  public static Expression image(@NonNull Expression input) {
    return new Expression("image", input);
  }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature 🍏 New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant