TileSetObject.fromJson constructor
TileSetObject.fromJson(
- Map<String, dynamic> json
)
Implementation
TileSetObject.fromJson(Map<String, dynamic> json) {
ellipse = json['ellipse'] ?? false;
height = double.parse(json['height'].toString());
width = double.parse(json['width'].toString());
id = json['id'];
gid = json['gid'];
name = json['name'];
point = json['point'];
if (json['polygon'] != null) {
polygon = <Polygon>[];
json['polygon'].forEach((v) {
polygon?.add(new Polygon.fromJson(v));
});
}
if (json['polyline'] != null) {
polyline = <Polygon>[];
json['polyline'].forEach((v) {
polyline?.add(new Polygon.fromJson(v));
});
}
rotation = json['rotation'];
type = json['type'];
visible = json['visible'];
x = double.parse(json['x'].toString());
y = double.parse(json['y'].toString());
}