toJson method
Implementation
Map<String, dynamic> toJson() {
return {
if (background != null)
'background': kIsWeb ? background : jsonEncode(background),
if (baseTileOpacity != null)
'baseTileOpacity': kIsWeb
? baseTileOpacity
: jsonEncode(baseTileOpacity),
if (bounds != null) 'bounds': bounds!.toJson(),
if (center != null) 'center': center!.toJson(),
if (disableDoubleClickZoom != null)
'disableDoubleClickZoom': kIsWeb
? disableDoubleClickZoom
: jsonEncode(disableDoubleClickZoom),
if (disableDoubleTapZoom != null)
'disableDoubleTapZoom': kIsWeb
? disableDoubleTapZoom
: jsonEncode(disableDoubleTapZoom),
if (disableKineticPan != null)
'disableKineticPan': kIsWeb
? disableKineticPan
: jsonEncode(disableKineticPan),
if (disableTwoFingerTapZoom != null)
'disableTwoFingerTapZoom': kIsWeb
? disableTwoFingerTapZoom
: jsonEncode(disableTwoFingerTapZoom),
if (draggable != null)
'draggable': kIsWeb ? draggable : jsonEncode(draggable),
if (keyboardShortcuts != null)
'keyboardShortcuts': kIsWeb
? keyboardShortcuts
: jsonEncode(keyboardShortcuts),
if (logoControl != null)
'logoControl': kIsWeb ? logoControl : jsonEncode(logoControl),
if (logoControlOptions != null)
'logoControlOptions': logoControlOptions!.toJson(),
if (mapDataControl != null)
'mapDataControl': kIsWeb ? mapDataControl : jsonEncode(mapDataControl),
if (mapDataControlOptions != null)
'mapDataControlOptions': mapDataControlOptions!.toJson(),
if (mapTypeControl != null)
'mapTypeControl': kIsWeb ? mapTypeControl : jsonEncode(mapTypeControl),
if (mapTypeControlOptions != null)
'mapTypeControlOptions': mapTypeControlOptions!.toJson(),
if (mapTypeId != null)
'mapTypeId': kIsWeb ? mapTypeId!.value : jsonEncode(mapTypeId!.value),
if (maxBounds != null) 'maxBounds': maxBounds!.toJson(),
if (maxZoom != null) 'maxZoom': kIsWeb ? maxZoom : jsonEncode(maxZoom),
if (minZoom != null) 'minZoom': kIsWeb ? minZoom : jsonEncode(minZoom),
if (padding != null) 'padding': padding!.toJson(),
if (pinchZoom != null)
'pinchZoom': kIsWeb ? pinchZoom : jsonEncode(pinchZoom),
if (resizeOrigin != null)
'resizeOrigin': kIsWeb
? resizeOrigin!.value
: jsonEncode(resizeOrigin!.value),
if (scaleControl != null)
'scaleControl': kIsWeb ? scaleControl : jsonEncode(scaleControl),
if (scaleControlOptions != null)
'scaleControlOptions': scaleControlOptions!.toJson(),
if (scrollWheel != null)
'scrollWheel': kIsWeb ? scrollWheel : jsonEncode(scrollWheel),
if (size != null) 'size': size!.toJson(),
if (overlayZoomEffect != null)
'overlayZoomEffect': kIsWeb
? overlayZoomEffect
: jsonEncode(overlayZoomEffect),
if (tileSpare != null)
'tileSpare': kIsWeb ? tileSpare : jsonEncode(tileSpare),
if (tileTransition != null)
'tileTransition': kIsWeb ? tileTransition : jsonEncode(tileTransition),
if (tileDuration != null)
'tileDuration': kIsWeb ? tileDuration : jsonEncode(tileDuration),
if (zoom != null) 'zoom': kIsWeb ? zoom : jsonEncode(zoom),
if (zoomControl != null)
'zoomControl': kIsWeb ? zoomControl : jsonEncode(zoomControl),
if (zoomControlOptions != null)
'zoomControlOptions': zoomControlOptions!.toJson(),
if (zoomOrigin != null) 'zoomOrigin': zoomOrigin!.toJson(),
if (blankTileImage != null)
'blankTileImage': kIsWeb ? blankTileImage : jsonEncode(blankTileImage),
if (gl != null) 'gl': kIsWeb ? gl : jsonEncode(gl),
if (customStyleId != null)
'customStyleId': kIsWeb ? customStyleId : jsonEncode(customStyleId),
};
}