fromMap static method

PointOfInterest fromMap(
  1. dynamic poiMap
)

Implementation

static PointOfInterest fromMap(dynamic poiMap) {
  final tags = List<String>.from(poiMap["tags"]);
  final externalData = poiMap["external_data"];
  return PointOfInterest(
      id: poiMap["id"] as int,
      name: poiMap["name"] as String,
      description: poiMap["description"] as String,
      address: poiMap["address"] as String,
      imageURL: poiMap["image_url"] as String,
      latitude: poiMap["latitude"] as double,
      longitude: poiMap["longitude"] as double,
      customerID: externalData != null
          ? externalData["customer_id"] as String?
          : poiMap["customer_id"] as String?,
      levelID: externalData != null
          ? externalData["wemap_level_id"] as num?
          : poiMap["wemap_level_id"] as num?,
      tags: tags,
      mediaType: poiMap["media_type"] as String?,
      mediaURL: poiMap["media_url"] as String?);
}