StreetViewPanoramaLocation.fromMap constructor

StreetViewPanoramaLocation.fromMap(
  1. dynamic map
)

Implementation

factory StreetViewPanoramaLocation.fromMap(dynamic map) {
  if (map == null) return StreetViewPanoramaLocation();

  List<StreetViewPanoramaLink> linksTmp = [];
  (map['links'] as List?)?.forEach((e) {
    linksTmp.add(StreetViewPanoramaLink(panoId: e[0], bearing: e[1]));
  });
  final tmp = new StreetViewPanoramaLocation(
    links: linksTmp,
    position:
        LatLng(map['position'][0] as double, map['position'][1] as double),
    panoId: map['panoId'] as String?,
  );
  return tmp;
}