TileLayer.fromJson constructor

TileLayer.fromJson(
  1. Map<String, dynamic> json
)

Implementation

TileLayer.fromJson(Map<String, dynamic> json) {
  height = double.tryParse(json['height'].toString()) ?? 0.0;
  width = double.tryParse(json['width'].toString()) ?? 0.0;
  encoding = json['encoding'];
  compression = json['compression'];

  if (encoding == 'base64') {
    final base64Raw = base64Decode(json['data']);
    data = _to32bit(_decode(base64Raw, compression ?? ''));
  } else {
    data = json['data'].cast<int>();
  }

  setParamsFromJson(json);
}