toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  final Map<String, dynamic> optionsMap = <String, dynamic>{};

  addToMap(optionsMap, Param.compassEnabled, compassEnabled);
  addToMap(optionsMap, Param.mapToolbarEnabled, mapToolbarEnabled);
  addToMap(
      optionsMap,
      Param.cameraTargetBounds,
      cameraTargetBounds != null
          ? cameraTargetBoundsToJson(cameraTargetBounds!)
          : null);
  addToMap(optionsMap, Param.mapType, mapType!.index);
  addToMap(
      optionsMap,
      Param.minMaxZoomPreference,
      minMaxZoomPreference != null
          ? minMaxZoomPreferenceToJson(minMaxZoomPreference!)
          : null);
  addToMap(optionsMap, Param.rotateGesturesEnabled, rotateGesturesEnabled);
  addToMap(optionsMap, Param.scrollGesturesEnabled, scrollGesturesEnabled);
  addToMap(optionsMap, Param.tiltGesturesEnabled, tiltGesturesEnabled);
  addToMap(optionsMap, Param.zoomControlsEnabled, zoomControlsEnabled);
  addToMap(optionsMap, Param.zoomGesturesEnabled, zoomGesturesEnabled);
  addToMap(optionsMap, Param.trackCameraPosition, trackCameraPosition);
  addToMap(optionsMap, Param.myLocationEnabled, myLocationEnabled);
  addToMap(
      optionsMap, Param.myLocationButtonEnabled, myLocationButtonEnabled);
  addToMap(optionsMap, Param.padding, <double>[
    padding!.top,
    padding!.left,
    padding!.bottom,
    padding!.right,
  ]);
  addToMap(optionsMap, Param.trafficEnabled, trafficEnabled);
  addToMap(
      optionsMap, Param.markersClusteringEnabled, markersClusteringEnabled);
  addToMap(optionsMap, Param.buildingsEnabled, buildingsEnabled);
  addToMap(optionsMap, Param.allGesturesEnabled, allGesturesEnabled);
  addToMap(optionsMap, Param.isScrollGesturesEnabledDuringRotateOrZoom,
      isScrollGesturesEnabledDuringRotateOrZoom);
  addToMap(
      optionsMap, Param.gestureScaleByMapCenter, gestureScaleByMapCenter);
  addToMap(optionsMap, Param.pointToCenter,
      pointToCenter == null ? null : screenCoordinateToJson(pointToCenter!));
  addToMap(optionsMap, Param.clusterMarkerColor, clusterMarkerColor?.value);
  addToMap(optionsMap, Param.clusterMarkerTextColor,
      clusterMarkerTextColor?.value);
  addToMap(
      optionsMap, Param.clusterMarkerIcon, clusterIconDescriptor?.toJson());
  addToMap(optionsMap, Param.logoPosition, logoPosition);
  addToMap(optionsMap, Param.logoPadding, <double>[
    logoPadding!.top,
    logoPadding!.left,
    logoPadding!.bottom,
    logoPadding!.right,
  ]);
  addToMap(optionsMap, Param.styleId, styleId);
  addToMap(optionsMap, Param.previewId, previewId);

  return optionsMap;
}