How to use @mapbox/appropriate-images-get-url - 1 common examples

To help you get started, we’ve selected a few @mapbox/appropriate-images-get-url examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mapbox / appropriate-images-react / src / scope-appropriate-image.js View on Github external
render() {
      let url = getAppropriateImageUrl({
        imageId: this.props.imageId,
        availableWidth: this.props.width,
        imageConfig,
        hiResRatio
      });
      url = transformUrl(url);

      const elementProps = Object.keys(this.props).reduce((result, key) => {
        // All prop types we don't want to pass to the element should fail this condition.
        if (
          !/^(imageId|width|background|backgroundPosition|backgroundSize)$/.test(
            key
          )
        ) {
          result[key] = this.props[key];
        }

@mapbox/appropriate-images-get-url

Given an appropriate-images configuration, get the URL of the optimized image appropriate for a situation

MIT
Latest version published 6 months ago

Package Health Score

66 / 100
Full package analysis

Popular @mapbox/appropriate-images-get-url functions