updatesMap method

Map<String, dynamic> updatesMap(
  1. StreetViewPanoramaOptions newOptions
)

Implementation

Map<String, dynamic> updatesMap(StreetViewPanoramaOptions newOptions) {
  final Map<String, dynamic> prevOptionsMap = toMap();

  return newOptions.toMap()
    ..removeWhere((String key, dynamic value) {
      if (key == "position") {
        List<double>? pPos = prevOptionsMap[key];
        List<double> nPos = value;
        if (pPos != null) {
          return pPos[0] == nPos[0] && pPos[1] == nPos[1];
        } else
          return (pPos == null);
      } else
        return prevOptionsMap[key] == value;
    });
}