createFromContent static method

Future<Mapfile> createFromContent({
  1. required Uint8List content,
  2. String? preferredLanguage,
})

Creates a Mapfile instance from a byte array in memory.

This is useful for loading map files that are not stored on the local file system, such as those downloaded from a network. content is the byte content of the .map file. preferredLanguage can be used to select a specific language for labels.

Implementation

static Future<Mapfile> createFromContent({required Uint8List content, String? preferredLanguage}) async {
  assert(content.isNotEmpty);
  Mapfile mapFile = Mapfile._(preferredLanguage);
  await mapFile._initContent(content);
  return mapFile;
}