parse static method
Implementation
static MapboxAd? parse(AdFeature feature, PMEManager? pme) {
try {
final geometryJson = feature.geometry.toJson();
final properties = feature.properties;
final promotionURL = properties.promotionURL;
final url = promotionURL != null ? Uri.parse(promotionURL) : null;
return MapboxAd(
AdGeometry.fromJson(geometryJson),
properties.cps,
properties.name,
properties.address ?? "",
properties.id,
properties.phoneNo ?? "",
properties.icon,
_parseExternalLinks(properties.externalLinks),
addressRemark: properties.addressRemark,
categories: properties.categories,
title: properties.title,
summary: properties.summary,
businessHours: properties.businessHours,
businessHoursRemark: properties.businessHoursRemark,
bannerUrl: properties.bannerImage,
url: url,
news: properties.profile.news,
products: properties.profile.products,
media: properties.profile.media);
} catch (e) {
PMLogger.e(e);
}
return null;
}