MapImage.withFilePathAndWidthAndHeight constructor

MapImage.withFilePathAndWidthAndHeight(
  1. String filePath,
  2. int width,
  3. int height
)

Creates a new map image from the provided path to the SVG Tiny or PNG image.

Will throw an error if either the height or width equals zero or the path is empty.

Trying to load a file that is not compliant with SVG Tiny or PNG results in an undefined behavior. In particular, loading SVG that exceeds Tiny SVG specification may result in an image that exhibits unexpected artifacts.

The caller must ensure that the file remains accessible for the entire duration of its usage by the SDK. If that cannot be ensured, then it is recommended to either copy the file to a location that remains accessible for the entire duration of its usage by the SDK or load and pass the file content to one of the MapImage constructors that creates instances out of image data (MapImage.withPixelDataAndImageFormat, MapImage.withImageDataImageFormatWidthAndHeight).}

Please note that on iOS, file paths that originate, for example from a file picker (like FilePicker) can be deleted by the system while the application is still running.

  • filePath The path to image file.

  • width The width of image in pixels.

  • height The height of image in pixels.

Throws InstantiationException. Indicates what went wrong when the instantiation was attempted.

Implementation

factory MapImage.withFilePathAndWidthAndHeight(String filePath, int width, int height) => $prototype.withFilePathAndWidthAndHeight(filePath, width, height);