From 679cf21f39b38e434de5f8a4d034e253cf2b2cc4 Mon Sep 17 00:00:00 2001 From: Alexandre Ardhuin Date: Sun, 3 May 2015 22:30:32 +0200 Subject: [PATCH] update generator --- build.dart | 4 +- lib/src/google_maps.dart | 2 +- lib/src/google_maps.g.dart | 3541 +++++++++------------- lib/src/google_maps_adsense.g.dart | 283 +- lib/src/google_maps_drawing.g.dart | 263 +- lib/src/google_maps_geometry.g.dart | 64 +- lib/src/google_maps_panoramio.g.dart | 53 +- lib/src/google_maps_places.g.dart | 811 ++--- lib/src/google_maps_visualization.g.dart | 171 +- lib/src/google_maps_weather.g.dart | 212 +- 10 files changed, 2260 insertions(+), 3144 deletions(-) diff --git a/build.dart b/build.dart index ba1448c7..40f66380 100644 --- a/build.dart +++ b/build.dart @@ -4,6 +4,6 @@ import 'package:js/generators/js_interface_generator.dart'; import 'package:source_gen/source_gen.dart'; void main(List args) { - build(args, const [const JsInterfaceGenerator()], - librarySearchPaths: ['lib']).then(print); + build(args, [new JsInterfaceGenerator()], + librarySearchPaths: ['lib', 'example']).then(print); } diff --git a/lib/src/google_maps.dart b/lib/src/google_maps.dart index 1e5f3193..c853e01e 100644 --- a/lib/src/google_maps.dart +++ b/lib/src/google_maps.dart @@ -201,7 +201,7 @@ abstract class _Controls extends JsInterface return new MVCArray.created(value); } void operator []=(ControlPosition controlPosition, MVCArray nodes) { - asJsObject(this)[_toJsControlPosition(controlPosition)] = toJs(nodes); + asJsObject(this)[_toJsControlPosition(controlPosition)] = asJsObject(nodes); } Iterable get keys { var result = []; diff --git a/lib/src/google_maps.g.dart b/lib/src/google_maps.g.dart index 393fae72..30909068 100644 --- a/lib/src/google_maps.g.dart +++ b/lib/src/google_maps.g.dart @@ -1,5 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// 2015-04-23T13:41:10.939Z +// 2015-05-03T20:26:18.508Z part of google_maps; @@ -19,7 +19,7 @@ class Controls extends JsInterface return new MVCArray.created(value); } void operator []=(ControlPosition controlPosition, MVCArray nodes) { - asJsObject(this)[_toJsControlPosition(controlPosition)] = toJs(nodes); + asJsObject(this)[_toJsControlPosition(controlPosition)] = asJsObject(nodes); } Iterable get keys { var result = []; @@ -62,22 +62,17 @@ class Controls extends JsInterface class GMap extends MVCObject implements _GMap { GMap.created(JsObject o) : super.created(o); GMap(Node mapDiv, [MapOptions opts]) : this.created(new JsObject( - getPath('google.maps.Map'), [ - mapDiv, - ((e) => e == null ? null : asJsObject(e))(opts) - ])); + getPath('google.maps.Map'), [mapDiv, __codec1.encode(opts)])); void fitBounds(LatLngBounds bounds) { - asJsObject(this).callMethod( - 'fitBounds', [((e) => e == null ? null : asJsObject(e))(bounds)]); + asJsObject(this).callMethod('fitBounds', [__codec5.encode(bounds)]); } LatLngBounds get bounds => _getBounds(); - LatLngBounds _getBounds() => ((e) => e == null - ? null - : new LatLngBounds.created(e))(asJsObject(this).callMethod('getBounds')); + LatLngBounds _getBounds() => + __codec5.decode(asJsObject(this).callMethod('getBounds')); LatLng get center => _getCenter(); - LatLng _getCenter() => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this).callMethod('getCenter')); + LatLng _getCenter() => + __codec6.decode(asJsObject(this).callMethod('getCenter')); Node get div => _getDiv(); Node _getDiv() => asJsObject(this).callMethod('getDiv'); num get heading => _getHeading(); @@ -93,12 +88,10 @@ class GMap extends MVCObject implements _GMap { _getMapTypeId() => asJsObject(this).callMethod('getMapTypeId'); Projection get projection => _getProjection(); Projection _getProjection() => - ((e) => e == null ? null : new Projection.created(e))( - asJsObject(this).callMethod('getProjection')); + __codec7.decode(asJsObject(this).callMethod('getProjection')); StreetViewPanorama get streetView => _getStreetView(); StreetViewPanorama _getStreetView() => - ((e) => e == null ? null : new StreetViewPanorama.created(e))( - asJsObject(this).callMethod('getStreetView')); + __codec8.decode(asJsObject(this).callMethod('getStreetView')); num get tilt => _getTilt(); num _getTilt() => asJsObject(this).callMethod('getTilt'); num get zoom => _getZoom(); @@ -107,17 +100,14 @@ class GMap extends MVCObject implements _GMap { asJsObject(this).callMethod('panBy', [x, y]); } void panTo(LatLng latLng) { - asJsObject(this).callMethod( - 'panTo', [((e) => e == null ? null : asJsObject(e))(latLng)]); + asJsObject(this).callMethod('panTo', [__codec6.encode(latLng)]); } void panToBounds(LatLngBounds latLngBounds) { - asJsObject(this).callMethod('panToBounds', - [((e) => e == null ? null : asJsObject(e))(latLngBounds)]); + asJsObject(this).callMethod('panToBounds', [__codec5.encode(latLngBounds)]); } void set center(LatLng latlng) => _setCenter(latlng); void _setCenter(LatLng latlng) { - asJsObject(this).callMethod( - 'setCenter', [((e) => e == null ? null : asJsObject(e))(latlng)]); + asJsObject(this).callMethod('setCenter', [__codec6.encode(latlng)]); } void set heading(num heading) => _setHeading(heading); void _setHeading(num heading) { @@ -133,17 +123,15 @@ class GMap extends MVCObject implements _GMap { })) ..add(new IdentityCodec())).encode(mapTypeId)); void _setMapTypeId(dynamic /*MapTypeId|String*/ mapTypeId) { - asJsObject(this).callMethod('setMapTypeId', [toJs(mapTypeId)]); + asJsObject(this).callMethod('setMapTypeId', [mapTypeId]); } void set options(MapOptions options) => _setOptions(options); void _setOptions(MapOptions options) { - asJsObject(this).callMethod( - 'setOptions', [((e) => e == null ? null : asJsObject(e))(options)]); + asJsObject(this).callMethod('setOptions', [__codec1.encode(options)]); } void set streetView(StreetViewPanorama panorama) => _setStreetView(panorama); void _setStreetView(StreetViewPanorama panorama) { - asJsObject(this).callMethod( - 'setStreetView', [((e) => e == null ? null : asJsObject(e))(panorama)]); + asJsObject(this).callMethod('setStreetView', [__codec8.encode(panorama)]); } void set tilt(num tilt) => _setTilt(tilt); void _setTilt(num tilt) { @@ -155,25 +143,19 @@ class GMap extends MVCObject implements _GMap { } void set controls(Controls _controls) { - asJsObject(this)['controls'] = - ((e) => e == null ? null : asJsObject(e))(_controls); + asJsObject(this)['controls'] = __codec2.encode(_controls); } - Controls get controls => ((e) => e == null ? null : new Controls.created(e))( - asJsObject(this)['controls']); + Controls get controls => __codec2.decode(asJsObject(this)['controls']); void set data(Data _data) { - asJsObject(this)['data'] = ((e) => e == null ? null : asJsObject(e))(_data); + asJsObject(this)['data'] = __codec3.encode(_data); } - Data get data => - ((e) => e == null ? null : new Data.created(e))(asJsObject(this)['data']); + Data get data => __codec3.decode(asJsObject(this)['data']); void set mapTypes(MapTypeRegistry _mapTypes) { - asJsObject(this)['mapTypes'] = - ((e) => e == null ? null : asJsObject(e))(_mapTypes); + asJsObject(this)['mapTypes'] = __codec4.encode(_mapTypes); } - MapTypeRegistry get mapTypes => ((e) => e == null - ? null - : new MapTypeRegistry.created(e))(asJsObject(this)['mapTypes']); + MapTypeRegistry get mapTypes => __codec4.decode(asJsObject(this)['mapTypes']); void set _overlayMapTypes(dynamic __overlayMapTypes) { - asJsObject(this)['overlayMapTypes'] = toJs(__overlayMapTypes); + asJsObject(this)['overlayMapTypes'] = __overlayMapTypes; } dynamic get _overlayMapTypes => asJsObject(this)['overlayMapTypes']; MVCArray get overlayMapTypes => @@ -217,6 +199,34 @@ class GMap extends MVCObject implements _GMap { Stream get onTiltChanged => getStream(this, #onTiltChanged, "tilt_changed"); Stream get onZoomChanged => getStream(this, #onZoomChanged, "zoom_changed"); } +/// codec for MapOptions +final __codec1 = + new JsInterfaceCodec((o) => new MapOptions.created(o)); + +/// codec for Controls +final __codec2 = new JsInterfaceCodec((o) => new Controls.created(o)); + +/// codec for Data +final __codec3 = new JsInterfaceCodec((o) => new Data.created(o)); + +/// codec for MapTypeRegistry +final __codec4 = new JsInterfaceCodec( + (o) => new MapTypeRegistry.created(o)); + +/// codec for LatLngBounds +final __codec5 = + new JsInterfaceCodec((o) => new LatLngBounds.created(o)); + +/// codec for LatLng +final __codec6 = new JsInterfaceCodec((o) => new LatLng.created(o)); + +/// codec for Projection +final __codec7 = + new JsInterfaceCodec((o) => new Projection.created(o)); + +/// codec for StreetViewPanorama +final __codec8 = new JsInterfaceCodec( + (o) => new StreetViewPanorama.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -233,11 +243,9 @@ class MapOptions extends JsInterface implements _MapOptions { } String get backgroundColor => asJsObject(this)['backgroundColor']; void set center(LatLng _center) { - asJsObject(this)['center'] = - ((e) => e == null ? null : asJsObject(e))(_center); + asJsObject(this)['center'] = __codec6.encode(_center); } - LatLng get center => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this)['center']); + LatLng get center => __codec6.decode(asJsObject(this)['center']); void set disableDefaultUI(bool _disableDefaultUI) { asJsObject(this)['disableDefaultUI'] = _disableDefaultUI; } @@ -276,29 +284,14 @@ class MapOptions extends JsInterface implements _MapOptions { bool get mapTypeControl => asJsObject(this)['mapTypeControl']; void set mapTypeControlOptions(MapTypeControlOptions _mapTypeControlOptions) { asJsObject(this)['mapTypeControlOptions'] = - ((e) => e == null ? null : asJsObject(e))(_mapTypeControlOptions); + __codec9.encode(_mapTypeControlOptions); } MapTypeControlOptions get mapTypeControlOptions => - ((e) => e == null ? null : new MapTypeControlOptions.created(e))( - asJsObject(this)['mapTypeControlOptions']); + __codec9.decode(asJsObject(this)['mapTypeControlOptions']); void set mapTypeId(MapTypeId _mapTypeId) { - asJsObject(this)['mapTypeId'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.MapTypeId'); - if (e == MapTypeId.HYBRID) return path['HYBRID']; - if (e == MapTypeId.ROADMAP) return path['ROADMAP']; - if (e == MapTypeId.SATELLITE) return path['SATELLITE']; - if (e == MapTypeId.TERRAIN) return path['TERRAIN']; - })(_mapTypeId); - } - MapTypeId get mapTypeId => ((e) { - if (e == null) return null; - final path = getPath('google.maps.MapTypeId'); - if (e == path['HYBRID']) return MapTypeId.HYBRID; - if (e == path['ROADMAP']) return MapTypeId.ROADMAP; - if (e == path['SATELLITE']) return MapTypeId.SATELLITE; - if (e == path['TERRAIN']) return MapTypeId.TERRAIN; - })(asJsObject(this)['mapTypeId']); + asJsObject(this)['mapTypeId'] = __codec10.encode(_mapTypeId); + } + MapTypeId get mapTypeId => __codec10.decode(asJsObject(this)['mapTypeId']); void set maxZoom(num _maxZoom) { asJsObject(this)['maxZoom'] = _maxZoom; } @@ -318,55 +311,49 @@ class MapOptions extends JsInterface implements _MapOptions { void set overviewMapControlOptions( OverviewMapControlOptions _overviewMapControlOptions) { asJsObject(this)['overviewMapControlOptions'] = - ((e) => e == null ? null : asJsObject(e))(_overviewMapControlOptions); + __codec11.encode(_overviewMapControlOptions); } OverviewMapControlOptions get overviewMapControlOptions => - ((e) => e == null ? null : new OverviewMapControlOptions.created(e))( - asJsObject(this)['overviewMapControlOptions']); + __codec11.decode(asJsObject(this)['overviewMapControlOptions']); void set panControl(bool _panControl) { asJsObject(this)['panControl'] = _panControl; } bool get panControl => asJsObject(this)['panControl']; void set panControlOptions(PanControlOptions _panControlOptions) { asJsObject(this)['panControlOptions'] = - ((e) => e == null ? null : asJsObject(e))(_panControlOptions); + __codec12.encode(_panControlOptions); } PanControlOptions get panControlOptions => - ((e) => e == null ? null : new PanControlOptions.created(e))( - asJsObject(this)['panControlOptions']); + __codec12.decode(asJsObject(this)['panControlOptions']); void set rotateControl(bool _rotateControl) { asJsObject(this)['rotateControl'] = _rotateControl; } bool get rotateControl => asJsObject(this)['rotateControl']; void set rotateControlOptions(RotateControlOptions _rotateControlOptions) { asJsObject(this)['rotateControlOptions'] = - ((e) => e == null ? null : asJsObject(e))(_rotateControlOptions); + __codec13.encode(_rotateControlOptions); } RotateControlOptions get rotateControlOptions => - ((e) => e == null ? null : new RotateControlOptions.created(e))( - asJsObject(this)['rotateControlOptions']); + __codec13.decode(asJsObject(this)['rotateControlOptions']); void set scaleControl(bool _scaleControl) { asJsObject(this)['scaleControl'] = _scaleControl; } bool get scaleControl => asJsObject(this)['scaleControl']; void set scaleControlOptions(ScaleControlOptions _scaleControlOptions) { asJsObject(this)['scaleControlOptions'] = - ((e) => e == null ? null : asJsObject(e))(_scaleControlOptions); + __codec14.encode(_scaleControlOptions); } ScaleControlOptions get scaleControlOptions => - ((e) => e == null ? null : new ScaleControlOptions.created(e))( - asJsObject(this)['scaleControlOptions']); + __codec14.decode(asJsObject(this)['scaleControlOptions']); void set scrollwheel(bool _scrollwheel) { asJsObject(this)['scrollwheel'] = _scrollwheel; } bool get scrollwheel => asJsObject(this)['scrollwheel']; void set streetView(StreetViewPanorama _streetView) { - asJsObject(this)['streetView'] = - ((e) => e == null ? null : asJsObject(e))(_streetView); + asJsObject(this)['streetView'] = __codec8.encode(_streetView); } - StreetViewPanorama get streetView => ((e) => e == null - ? null - : new StreetViewPanorama.created(e))(asJsObject(this)['streetView']); + StreetViewPanorama get streetView => + __codec8.decode(asJsObject(this)['streetView']); void set streetViewControl(bool _streetViewControl) { asJsObject(this)['streetViewControl'] = _streetViewControl; } @@ -374,25 +361,14 @@ class MapOptions extends JsInterface implements _MapOptions { void set streetViewControlOptions( StreetViewControlOptions _streetViewControlOptions) { asJsObject(this)['streetViewControlOptions'] = - ((e) => e == null ? null : asJsObject(e))(_streetViewControlOptions); + __codec15.encode(_streetViewControlOptions); } StreetViewControlOptions get streetViewControlOptions => - ((e) => e == null ? null : new StreetViewControlOptions.created(e))( - asJsObject(this)['streetViewControlOptions']); + __codec15.decode(asJsObject(this)['streetViewControlOptions']); void set styles(List _styles) { - asJsObject(this)['styles'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map(new JsInterfaceCodec((o) => - ((e) => e == null ? null : new MapTypeStyle.created(e))(o)).encode)); - })(_styles); - } - List get styles => ((e) { - if (e == null) return null; - return new JsList.created(e, - new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new MapTypeStyle.created(e))(o))); - })(asJsObject(this)['styles']); + asJsObject(this)['styles'] = __codec17.encode(_styles); + } + List get styles => __codec17.decode(asJsObject(this)['styles']); void set tilt(num _tilt) { asJsObject(this)['tilt'] = _tilt; } @@ -407,12 +383,53 @@ class MapOptions extends JsInterface implements _MapOptions { bool get zoomControl => asJsObject(this)['zoomControl']; void set zoomControlOptions(ZoomControlOptions _zoomControlOptions) { asJsObject(this)['zoomControlOptions'] = - ((e) => e == null ? null : asJsObject(e))(_zoomControlOptions); + __codec18.encode(_zoomControlOptions); } ZoomControlOptions get zoomControlOptions => - ((e) => e == null ? null : new ZoomControlOptions.created(e))( - asJsObject(this)['zoomControlOptions']); + __codec18.decode(asJsObject(this)['zoomControlOptions']); } +/// codec for MapTypeControlOptions +final __codec9 = new JsInterfaceCodec( + (o) => new MapTypeControlOptions.created(o)); + +/// codec for MapTypeId +final __codec10 = new BiMapCodec({ + MapTypeId.HYBRID: getPath('google.maps.MapTypeId')['HYBRID'], + MapTypeId.ROADMAP: getPath('google.maps.MapTypeId')['ROADMAP'], + MapTypeId.SATELLITE: getPath('google.maps.MapTypeId')['SATELLITE'], + MapTypeId.TERRAIN: getPath('google.maps.MapTypeId')['TERRAIN'] +}); + +/// codec for OverviewMapControlOptions +final __codec11 = new JsInterfaceCodec( + (o) => new OverviewMapControlOptions.created(o)); + +/// codec for PanControlOptions +final __codec12 = new JsInterfaceCodec( + (o) => new PanControlOptions.created(o)); + +/// codec for RotateControlOptions +final __codec13 = new JsInterfaceCodec( + (o) => new RotateControlOptions.created(o)); + +/// codec for ScaleControlOptions +final __codec14 = new JsInterfaceCodec( + (o) => new ScaleControlOptions.created(o)); + +/// codec for StreetViewControlOptions +final __codec15 = new JsInterfaceCodec( + (o) => new StreetViewControlOptions.created(o)); + +/// codec for MapTypeStyle +final __codec16 = + new JsInterfaceCodec((o) => new MapTypeStyle.created(o)); + +/// codec for List +final __codec17 = new JsListCodec(__codec16); + +/// codec for ZoomControlOptions +final __codec18 = new JsInterfaceCodec( + (o) => new ZoomControlOptions.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -451,57 +468,49 @@ class MapTypeControlOptions extends JsInterface } void set position(ControlPosition _position) { - asJsObject(this)['position'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.ControlPosition'); - if (e == ControlPosition.BOTTOM_CENTER) return path['BOTTOM_CENTER']; - if (e == ControlPosition.BOTTOM_LEFT) return path['BOTTOM_LEFT']; - if (e == ControlPosition.BOTTOM_RIGHT) return path['BOTTOM_RIGHT']; - if (e == ControlPosition.LEFT_BOTTOM) return path['LEFT_BOTTOM']; - if (e == ControlPosition.LEFT_CENTER) return path['LEFT_CENTER']; - if (e == ControlPosition.LEFT_TOP) return path['LEFT_TOP']; - if (e == ControlPosition.RIGHT_BOTTOM) return path['RIGHT_BOTTOM']; - if (e == ControlPosition.RIGHT_CENTER) return path['RIGHT_CENTER']; - if (e == ControlPosition.RIGHT_TOP) return path['RIGHT_TOP']; - if (e == ControlPosition.TOP_CENTER) return path['TOP_CENTER']; - if (e == ControlPosition.TOP_LEFT) return path['TOP_LEFT']; - if (e == ControlPosition.TOP_RIGHT) return path['TOP_RIGHT']; - })(_position); - } - ControlPosition get position => ((e) { - if (e == null) return null; - final path = getPath('google.maps.ControlPosition'); - if (e == path['BOTTOM_CENTER']) return ControlPosition.BOTTOM_CENTER; - if (e == path['BOTTOM_LEFT']) return ControlPosition.BOTTOM_LEFT; - if (e == path['BOTTOM_RIGHT']) return ControlPosition.BOTTOM_RIGHT; - if (e == path['LEFT_BOTTOM']) return ControlPosition.LEFT_BOTTOM; - if (e == path['LEFT_CENTER']) return ControlPosition.LEFT_CENTER; - if (e == path['LEFT_TOP']) return ControlPosition.LEFT_TOP; - if (e == path['RIGHT_BOTTOM']) return ControlPosition.RIGHT_BOTTOM; - if (e == path['RIGHT_CENTER']) return ControlPosition.RIGHT_CENTER; - if (e == path['RIGHT_TOP']) return ControlPosition.RIGHT_TOP; - if (e == path['TOP_CENTER']) return ControlPosition.TOP_CENTER; - if (e == path['TOP_LEFT']) return ControlPosition.TOP_LEFT; - if (e == path['TOP_RIGHT']) return ControlPosition.TOP_RIGHT; - })(asJsObject(this)['position']); + asJsObject(this)['position'] = __codec19.encode(_position); + } + ControlPosition get position => + __codec19.decode(asJsObject(this)['position']); void set style(MapTypeControlStyle _style) { - asJsObject(this)['style'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.MapTypeControlStyle'); - if (e == MapTypeControlStyle.DEFAULT) return path['DEFAULT']; - if (e == MapTypeControlStyle.DROPDOWN_MENU) return path['DROPDOWN_MENU']; - if (e == MapTypeControlStyle.HORIZONTAL_BAR) return path[ - 'HORIZONTAL_BAR']; - })(_style); - } - MapTypeControlStyle get style => ((e) { - if (e == null) return null; - final path = getPath('google.maps.MapTypeControlStyle'); - if (e == path['DEFAULT']) return MapTypeControlStyle.DEFAULT; - if (e == path['DROPDOWN_MENU']) return MapTypeControlStyle.DROPDOWN_MENU; - if (e == path['HORIZONTAL_BAR']) return MapTypeControlStyle.HORIZONTAL_BAR; - })(asJsObject(this)['style']); -} + asJsObject(this)['style'] = __codec20.encode(_style); + } + MapTypeControlStyle get style => __codec20.decode(asJsObject(this)['style']); +} +/// codec for ControlPosition +final __codec19 = new BiMapCodec({ + ControlPosition.BOTTOM_CENTER: + getPath('google.maps.ControlPosition')['BOTTOM_CENTER'], + ControlPosition.BOTTOM_LEFT: + getPath('google.maps.ControlPosition')['BOTTOM_LEFT'], + ControlPosition.BOTTOM_RIGHT: + getPath('google.maps.ControlPosition')['BOTTOM_RIGHT'], + ControlPosition.LEFT_BOTTOM: + getPath('google.maps.ControlPosition')['LEFT_BOTTOM'], + ControlPosition.LEFT_CENTER: + getPath('google.maps.ControlPosition')['LEFT_CENTER'], + ControlPosition.LEFT_TOP: getPath('google.maps.ControlPosition')['LEFT_TOP'], + ControlPosition.RIGHT_BOTTOM: + getPath('google.maps.ControlPosition')['RIGHT_BOTTOM'], + ControlPosition.RIGHT_CENTER: + getPath('google.maps.ControlPosition')['RIGHT_CENTER'], + ControlPosition.RIGHT_TOP: + getPath('google.maps.ControlPosition')['RIGHT_TOP'], + ControlPosition.TOP_CENTER: + getPath('google.maps.ControlPosition')['TOP_CENTER'], + ControlPosition.TOP_LEFT: getPath('google.maps.ControlPosition')['TOP_LEFT'], + ControlPosition.TOP_RIGHT: getPath('google.maps.ControlPosition')['TOP_RIGHT'] +}); + +/// codec for MapTypeControlStyle +final __codec20 = new BiMapCodec({ + MapTypeControlStyle.DEFAULT: + getPath('google.maps.MapTypeControlStyle')['DEFAULT'], + MapTypeControlStyle.DROPDOWN_MENU: + getPath('google.maps.MapTypeControlStyle')['DROPDOWN_MENU'], + MapTypeControlStyle.HORIZONTAL_BAR: + getPath('google.maps.MapTypeControlStyle')['HORIZONTAL_BAR'] +}); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -531,39 +540,10 @@ class PanControlOptions extends JsInterface implements _PanControlOptions { PanControlOptions() : this.created(new JsObject(context['Object'])); void set position(ControlPosition _position) { - asJsObject(this)['position'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.ControlPosition'); - if (e == ControlPosition.BOTTOM_CENTER) return path['BOTTOM_CENTER']; - if (e == ControlPosition.BOTTOM_LEFT) return path['BOTTOM_LEFT']; - if (e == ControlPosition.BOTTOM_RIGHT) return path['BOTTOM_RIGHT']; - if (e == ControlPosition.LEFT_BOTTOM) return path['LEFT_BOTTOM']; - if (e == ControlPosition.LEFT_CENTER) return path['LEFT_CENTER']; - if (e == ControlPosition.LEFT_TOP) return path['LEFT_TOP']; - if (e == ControlPosition.RIGHT_BOTTOM) return path['RIGHT_BOTTOM']; - if (e == ControlPosition.RIGHT_CENTER) return path['RIGHT_CENTER']; - if (e == ControlPosition.RIGHT_TOP) return path['RIGHT_TOP']; - if (e == ControlPosition.TOP_CENTER) return path['TOP_CENTER']; - if (e == ControlPosition.TOP_LEFT) return path['TOP_LEFT']; - if (e == ControlPosition.TOP_RIGHT) return path['TOP_RIGHT']; - })(_position); - } - ControlPosition get position => ((e) { - if (e == null) return null; - final path = getPath('google.maps.ControlPosition'); - if (e == path['BOTTOM_CENTER']) return ControlPosition.BOTTOM_CENTER; - if (e == path['BOTTOM_LEFT']) return ControlPosition.BOTTOM_LEFT; - if (e == path['BOTTOM_RIGHT']) return ControlPosition.BOTTOM_RIGHT; - if (e == path['LEFT_BOTTOM']) return ControlPosition.LEFT_BOTTOM; - if (e == path['LEFT_CENTER']) return ControlPosition.LEFT_CENTER; - if (e == path['LEFT_TOP']) return ControlPosition.LEFT_TOP; - if (e == path['RIGHT_BOTTOM']) return ControlPosition.RIGHT_BOTTOM; - if (e == path['RIGHT_CENTER']) return ControlPosition.RIGHT_CENTER; - if (e == path['RIGHT_TOP']) return ControlPosition.RIGHT_TOP; - if (e == path['TOP_CENTER']) return ControlPosition.TOP_CENTER; - if (e == path['TOP_LEFT']) return ControlPosition.TOP_LEFT; - if (e == path['TOP_RIGHT']) return ControlPosition.TOP_RIGHT; - })(asJsObject(this)['position']); + asJsObject(this)['position'] = __codec19.encode(_position); + } + ControlPosition get position => + __codec19.decode(asJsObject(this)['position']); } // ************************************************************************** @@ -578,39 +558,10 @@ class RotateControlOptions extends JsInterface RotateControlOptions() : this.created(new JsObject(context['Object'])); void set position(ControlPosition _position) { - asJsObject(this)['position'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.ControlPosition'); - if (e == ControlPosition.BOTTOM_CENTER) return path['BOTTOM_CENTER']; - if (e == ControlPosition.BOTTOM_LEFT) return path['BOTTOM_LEFT']; - if (e == ControlPosition.BOTTOM_RIGHT) return path['BOTTOM_RIGHT']; - if (e == ControlPosition.LEFT_BOTTOM) return path['LEFT_BOTTOM']; - if (e == ControlPosition.LEFT_CENTER) return path['LEFT_CENTER']; - if (e == ControlPosition.LEFT_TOP) return path['LEFT_TOP']; - if (e == ControlPosition.RIGHT_BOTTOM) return path['RIGHT_BOTTOM']; - if (e == ControlPosition.RIGHT_CENTER) return path['RIGHT_CENTER']; - if (e == ControlPosition.RIGHT_TOP) return path['RIGHT_TOP']; - if (e == ControlPosition.TOP_CENTER) return path['TOP_CENTER']; - if (e == ControlPosition.TOP_LEFT) return path['TOP_LEFT']; - if (e == ControlPosition.TOP_RIGHT) return path['TOP_RIGHT']; - })(_position); - } - ControlPosition get position => ((e) { - if (e == null) return null; - final path = getPath('google.maps.ControlPosition'); - if (e == path['BOTTOM_CENTER']) return ControlPosition.BOTTOM_CENTER; - if (e == path['BOTTOM_LEFT']) return ControlPosition.BOTTOM_LEFT; - if (e == path['BOTTOM_RIGHT']) return ControlPosition.BOTTOM_RIGHT; - if (e == path['LEFT_BOTTOM']) return ControlPosition.LEFT_BOTTOM; - if (e == path['LEFT_CENTER']) return ControlPosition.LEFT_CENTER; - if (e == path['LEFT_TOP']) return ControlPosition.LEFT_TOP; - if (e == path['RIGHT_BOTTOM']) return ControlPosition.RIGHT_BOTTOM; - if (e == path['RIGHT_CENTER']) return ControlPosition.RIGHT_CENTER; - if (e == path['RIGHT_TOP']) return ControlPosition.RIGHT_TOP; - if (e == path['TOP_CENTER']) return ControlPosition.TOP_CENTER; - if (e == path['TOP_LEFT']) return ControlPosition.TOP_LEFT; - if (e == path['TOP_RIGHT']) return ControlPosition.TOP_RIGHT; - })(asJsObject(this)['position']); + asJsObject(this)['position'] = __codec19.encode(_position); + } + ControlPosition get position => + __codec19.decode(asJsObject(this)['position']); } // ************************************************************************** @@ -624,18 +575,14 @@ class ScaleControlOptions extends JsInterface implements _ScaleControlOptions { ScaleControlOptions() : this.created(new JsObject(context['Object'])); void set style(ScaleControlStyle _style) { - asJsObject(this)['style'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.ScaleControlStyle'); - if (e == ScaleControlStyle.DEFAULT) return path['DEFAULT']; - })(_style); + asJsObject(this)['style'] = __codec21.encode(_style); } - ScaleControlStyle get style => ((e) { - if (e == null) return null; - final path = getPath('google.maps.ScaleControlStyle'); - if (e == path['DEFAULT']) return ScaleControlStyle.DEFAULT; - })(asJsObject(this)['style']); + ScaleControlStyle get style => __codec21.decode(asJsObject(this)['style']); } +/// codec for ScaleControlStyle +final __codec21 = new BiMapCodec({ + ScaleControlStyle.DEFAULT: getPath('google.maps.ScaleControlStyle')['DEFAULT'] +}); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -649,39 +596,10 @@ class StreetViewControlOptions extends JsInterface StreetViewControlOptions() : this.created(new JsObject(context['Object'])); void set position(ControlPosition _position) { - asJsObject(this)['position'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.ControlPosition'); - if (e == ControlPosition.BOTTOM_CENTER) return path['BOTTOM_CENTER']; - if (e == ControlPosition.BOTTOM_LEFT) return path['BOTTOM_LEFT']; - if (e == ControlPosition.BOTTOM_RIGHT) return path['BOTTOM_RIGHT']; - if (e == ControlPosition.LEFT_BOTTOM) return path['LEFT_BOTTOM']; - if (e == ControlPosition.LEFT_CENTER) return path['LEFT_CENTER']; - if (e == ControlPosition.LEFT_TOP) return path['LEFT_TOP']; - if (e == ControlPosition.RIGHT_BOTTOM) return path['RIGHT_BOTTOM']; - if (e == ControlPosition.RIGHT_CENTER) return path['RIGHT_CENTER']; - if (e == ControlPosition.RIGHT_TOP) return path['RIGHT_TOP']; - if (e == ControlPosition.TOP_CENTER) return path['TOP_CENTER']; - if (e == ControlPosition.TOP_LEFT) return path['TOP_LEFT']; - if (e == ControlPosition.TOP_RIGHT) return path['TOP_RIGHT']; - })(_position); - } - ControlPosition get position => ((e) { - if (e == null) return null; - final path = getPath('google.maps.ControlPosition'); - if (e == path['BOTTOM_CENTER']) return ControlPosition.BOTTOM_CENTER; - if (e == path['BOTTOM_LEFT']) return ControlPosition.BOTTOM_LEFT; - if (e == path['BOTTOM_RIGHT']) return ControlPosition.BOTTOM_RIGHT; - if (e == path['LEFT_BOTTOM']) return ControlPosition.LEFT_BOTTOM; - if (e == path['LEFT_CENTER']) return ControlPosition.LEFT_CENTER; - if (e == path['LEFT_TOP']) return ControlPosition.LEFT_TOP; - if (e == path['RIGHT_BOTTOM']) return ControlPosition.RIGHT_BOTTOM; - if (e == path['RIGHT_CENTER']) return ControlPosition.RIGHT_CENTER; - if (e == path['RIGHT_TOP']) return ControlPosition.RIGHT_TOP; - if (e == path['TOP_CENTER']) return ControlPosition.TOP_CENTER; - if (e == path['TOP_LEFT']) return ControlPosition.TOP_LEFT; - if (e == path['TOP_RIGHT']) return ControlPosition.TOP_RIGHT; - })(asJsObject(this)['position']); + asJsObject(this)['position'] = __codec19.encode(_position); + } + ControlPosition get position => + __codec19.decode(asJsObject(this)['position']); } // ************************************************************************** @@ -695,56 +613,21 @@ class ZoomControlOptions extends JsInterface implements _ZoomControlOptions { ZoomControlOptions() : this.created(new JsObject(context['Object'])); void set position(ControlPosition _position) { - asJsObject(this)['position'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.ControlPosition'); - if (e == ControlPosition.BOTTOM_CENTER) return path['BOTTOM_CENTER']; - if (e == ControlPosition.BOTTOM_LEFT) return path['BOTTOM_LEFT']; - if (e == ControlPosition.BOTTOM_RIGHT) return path['BOTTOM_RIGHT']; - if (e == ControlPosition.LEFT_BOTTOM) return path['LEFT_BOTTOM']; - if (e == ControlPosition.LEFT_CENTER) return path['LEFT_CENTER']; - if (e == ControlPosition.LEFT_TOP) return path['LEFT_TOP']; - if (e == ControlPosition.RIGHT_BOTTOM) return path['RIGHT_BOTTOM']; - if (e == ControlPosition.RIGHT_CENTER) return path['RIGHT_CENTER']; - if (e == ControlPosition.RIGHT_TOP) return path['RIGHT_TOP']; - if (e == ControlPosition.TOP_CENTER) return path['TOP_CENTER']; - if (e == ControlPosition.TOP_LEFT) return path['TOP_LEFT']; - if (e == ControlPosition.TOP_RIGHT) return path['TOP_RIGHT']; - })(_position); - } - ControlPosition get position => ((e) { - if (e == null) return null; - final path = getPath('google.maps.ControlPosition'); - if (e == path['BOTTOM_CENTER']) return ControlPosition.BOTTOM_CENTER; - if (e == path['BOTTOM_LEFT']) return ControlPosition.BOTTOM_LEFT; - if (e == path['BOTTOM_RIGHT']) return ControlPosition.BOTTOM_RIGHT; - if (e == path['LEFT_BOTTOM']) return ControlPosition.LEFT_BOTTOM; - if (e == path['LEFT_CENTER']) return ControlPosition.LEFT_CENTER; - if (e == path['LEFT_TOP']) return ControlPosition.LEFT_TOP; - if (e == path['RIGHT_BOTTOM']) return ControlPosition.RIGHT_BOTTOM; - if (e == path['RIGHT_CENTER']) return ControlPosition.RIGHT_CENTER; - if (e == path['RIGHT_TOP']) return ControlPosition.RIGHT_TOP; - if (e == path['TOP_CENTER']) return ControlPosition.TOP_CENTER; - if (e == path['TOP_LEFT']) return ControlPosition.TOP_LEFT; - if (e == path['TOP_RIGHT']) return ControlPosition.TOP_RIGHT; - })(asJsObject(this)['position']); + asJsObject(this)['position'] = __codec19.encode(_position); + } + ControlPosition get position => + __codec19.decode(asJsObject(this)['position']); void set style(ZoomControlStyle _style) { - asJsObject(this)['style'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.ZoomControlStyle'); - if (e == ZoomControlStyle.DEFAULT) return path['DEFAULT']; - if (e == ZoomControlStyle.LARGE) return path['LARGE']; - if (e == ZoomControlStyle.SMALL) return path['SMALL']; - })(_style); - } - ZoomControlStyle get style => ((e) { - if (e == null) return null; - final path = getPath('google.maps.ZoomControlStyle'); - if (e == path['DEFAULT']) return ZoomControlStyle.DEFAULT; - if (e == path['LARGE']) return ZoomControlStyle.LARGE; - if (e == path['SMALL']) return ZoomControlStyle.SMALL; - })(asJsObject(this)['style']); + asJsObject(this)['style'] = __codec22.encode(_style); + } + ZoomControlStyle get style => __codec22.decode(asJsObject(this)['style']); } +/// codec for ZoomControlStyle +final __codec22 = new BiMapCodec({ + ZoomControlStyle.DEFAULT: getPath('google.maps.ZoomControlStyle')['DEFAULT'], + ZoomControlStyle.LARGE: getPath('google.maps.ZoomControlStyle')['LARGE'], + ZoomControlStyle.SMALL: getPath('google.maps.ZoomControlStyle')['SMALL'] +}); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -755,8 +638,7 @@ class ZoomControlOptions extends JsInterface implements _ZoomControlOptions { class Data extends JsInterface implements _Data { Data.created(JsObject o) : super.created(o); Data([DataDataOptions options]) : this.created(new JsObject( - getPath('google.maps.Data'), - [((e) => e == null ? null : asJsObject(e))(options)])); + getPath('google.maps.Data'), [__codec23.encode(options)])); DataFeature add(dynamic /*DataFeature|DataFeatureOptions*/ feature) => _add( (new ChainedCodec() @@ -765,37 +647,19 @@ class Data extends JsInterface implements _Data { ..add(new JsInterfaceCodec( (o) => new DataFeatureOptions.created(o)))).encode(feature)); _add(dynamic /*DataFeature|DataFeatureOptions*/ feature) => - asJsObject(this).callMethod('add', [toJs(feature)]); + asJsObject(this).callMethod('add', [feature]); List addGeoJson(Object geoJson, [DataGeoJsonOptions options]) => - ((e) { - if (e == null) return null; - return new JsList.created(e, new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new DataFeature.created(e))(o))); - })(asJsObject(this).callMethod('addGeoJson', [ - toJs(geoJson), - ((e) => e == null ? null : asJsObject(e))(options) - ])); - bool contains(DataFeature feature) => asJsObject(this).callMethod( - 'contains', [((e) => e == null ? null : asJsObject(e))(feature)]); + __codec26.decode(asJsObject(this).callMethod( + 'addGeoJson', [geoJson, __codec24.encode(options)])); + bool contains(DataFeature feature) => + asJsObject(this).callMethod('contains', [__codec25.encode(feature)]); void forEach(callback(DataFeature p1)) { - asJsObject(this).callMethod('forEach', [ - ((f) { - if (f == null) return null; - return (p_p1) { - p_p1 = new JsInterfaceCodec((o) => - ((e) => e == null ? null : new DataFeature.created(e))(o)) - .decode(p_p1); - return f(p_p1); - }; - })(callback) - ]); + asJsObject(this).callMethod('forEach', [__codec27.encode(callback)]); } DataFeature getFeatureById(dynamic /*num|String*/ id) => - ((e) => e == null ? null : new DataFeature.created(e))( - asJsObject(this).callMethod('getFeatureById', [toJs(id)])); + __codec25.decode(asJsObject(this).callMethod('getFeatureById', [id])); GMap get map => _getMap(); - GMap _getMap() => ((e) => e == null ? null : new GMap.created(e))( - asJsObject(this).callMethod('getMap')); + GMap _getMap() => __codec28.decode(asJsObject(this).callMethod('getMap')); dynamic /*DataStylingFunction|DataStyleOptions*/ get style => (new ChainedCodec() ..add(new FunctionCodec((o) => ((f) { @@ -828,36 +692,23 @@ class Data extends JsInterface implements _Data { [DataGeoJsonOptions options, callback(List p1)]) { asJsObject(this).callMethod('loadGeoJson', [ url, - ((e) => e == null ? null : asJsObject(e))(options), - ((f) { - if (f == null) return null; - return (p_p1) { - p_p1 = new JsListCodec(new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new DataFeature.created(e))( - o))).decode(p_p1); - return f(p_p1); - }; - })(callback) + __codec24.encode(options), + __codec29.encode(callback) ]); } void overrideStyle(DataFeature feature, DataStyleOptions style) { - asJsObject(this).callMethod('overrideStyle', [ - ((e) => e == null ? null : asJsObject(e))(feature), - ((e) => e == null ? null : asJsObject(e))(style) - ]); + asJsObject(this).callMethod( + 'overrideStyle', [__codec25.encode(feature), __codec30.encode(style)]); } void remove(DataFeature feature) { - asJsObject(this).callMethod( - 'remove', [((e) => e == null ? null : asJsObject(e))(feature)]); + asJsObject(this).callMethod('remove', [__codec25.encode(feature)]); } void revertStyle([DataFeature feature]) { - asJsObject(this).callMethod( - 'revertStyle', [((e) => e == null ? null : asJsObject(e))(feature)]); + asJsObject(this).callMethod('revertStyle', [__codec25.encode(feature)]); } void set map(GMap map) => _setMap(map); void _setMap(GMap map) { - asJsObject(this).callMethod( - 'setMap', [((e) => e == null ? null : asJsObject(e))(map)]); + asJsObject(this).callMethod('setMap', [__codec28.encode(map)]); } void set style(dynamic /*DataStylingFunction|DataStyleOptions*/ style) => _setStyle((new ChainedCodec() @@ -887,10 +738,10 @@ class Data extends JsInterface implements _Data { ..add(new JsInterfaceCodec( (o) => new DataStyleOptions.created(o)))).encode(style)); void _setStyle(dynamic /*DataStylingFunction|DataStyleOptions*/ style) { - asJsObject(this).callMethod('setStyle', [toJs(style)]); + asJsObject(this).callMethod('setStyle', [style]); } void toGeoJson(callback(Object p1)) { - asJsObject(this).callMethod('toGeoJson', [callback]); + asJsObject(this).callMethod('toGeoJson', [__codec31.encode(callback)]); } Stream get onAddfeature => getStream(this, #onAddfeature, @@ -922,6 +773,53 @@ class Data extends JsInterface implements _Data { #onSetproperty, "setproperty", (JsObject o) => new DataSetPropertyEvent.created(o)); } +/// codec for DataDataOptions +final __codec23 = new JsInterfaceCodec( + (o) => new DataDataOptions.created(o)); + +/// codec for DataGeoJsonOptions +final __codec24 = new JsInterfaceCodec( + (o) => new DataGeoJsonOptions.created(o)); + +/// codec for DataFeature +final __codec25 = + new JsInterfaceCodec((o) => new DataFeature.created(o)); + +/// codec for List +final __codec26 = new JsListCodec(__codec25); + +/// codec for (DataFeature) → dynamic +final __codec27 = new FunctionCodec /*<(DataFeature) → dynamic>*/ ( + (f) => (p_p1) { + p_p1 = __codec25.decode(p_p1); + return f(p_p1); +}, (JsFunction f) => (p_p1) { + p_p1 = __codec25.encode(p_p1); + return f.apply([p_p1]); +}); + +/// codec for GMap +final __codec28 = new JsInterfaceCodec((o) => new GMap.created(o)); + +/// codec for (List) → dynamic +final __codec29 = new FunctionCodec /*<(List) → dynamic>*/ ( + (f) => (p_p1) { + p_p1 = __codec26.decode(p_p1); + return f(p_p1); +}, (JsFunction f) => (p_p1) { + p_p1 = __codec26.encode(p_p1); + return f.apply([p_p1]); +}); + +/// codec for DataStyleOptions +final __codec30 = new JsInterfaceCodec( + (o) => new DataStyleOptions.created(o)); + +/// codec for (Object) → dynamic +final __codec31 = new FunctionCodec /*<(Object) → dynamic>*/ ((f) => f, + (JsFunction f) => (p_p1) { + return f.apply([p_p1]); +}); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -934,10 +832,9 @@ class DataDataOptions extends JsInterface implements _DataDataOptions { DataDataOptions() : this.created(new JsObject(context['Object'])); void set map(GMap _map) { - asJsObject(this)['map'] = ((e) => e == null ? null : asJsObject(e))(_map); + asJsObject(this)['map'] = __codec28.encode(_map); } - GMap get map => - ((e) => e == null ? null : new GMap.created(e))(asJsObject(this)['map']); + GMap get map => __codec28.decode(asJsObject(this)['map']); dynamic /*DataStylingFunction|DataStyleOptions*/ get style => (new ChainedCodec() ..add(new FunctionCodec((o) => ((f) { @@ -993,7 +890,7 @@ class DataDataOptions extends JsInterface implements _DataDataOptions { ..add(new JsInterfaceCodec( (o) => new DataStyleOptions.created(o)))).encode(_style); void set _style(dynamic __style) { - asJsObject(this)['style'] = toJs(__style); + asJsObject(this)['style'] = __style; } dynamic get _style => asJsObject(this)['style']; } @@ -1041,7 +938,7 @@ class DataStyleOptions extends JsInterface implements _DataStyleOptions { } num get fillOpacity => asJsObject(this)['fillOpacity']; void set _icon(dynamic __icon) { - asJsObject(this)['icon'] = toJs(__icon); + asJsObject(this)['icon'] = __icon; } dynamic get _icon => asJsObject(this)['icon']; dynamic /*String|Icon|GSymbol*/ get icon => (new ChainedCodec() @@ -1057,11 +954,9 @@ class DataStyleOptions extends JsInterface implements _DataStyleOptions { .encode(icon); } void set shape(MarkerShape _shape) { - asJsObject(this)['shape'] = - ((e) => e == null ? null : asJsObject(e))(_shape); + asJsObject(this)['shape'] = __codec32.encode(_shape); } - MarkerShape get shape => ((e) => - e == null ? null : new MarkerShape.created(e))(asJsObject(this)['shape']); + MarkerShape get shape => __codec32.decode(asJsObject(this)['shape']); void set strokeColor(String _strokeColor) { asJsObject(this)['strokeColor'] = _strokeColor; } @@ -1087,6 +982,9 @@ class DataStyleOptions extends JsInterface implements _DataStyleOptions { } num get zIndex => asJsObject(this)['zIndex']; } +/// codec for MarkerShape +final __codec32 = + new JsInterfaceCodec((o) => new MarkerShape.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -1097,16 +995,15 @@ class DataStyleOptions extends JsInterface implements _DataStyleOptions { class DataFeature extends JsInterface implements _DataFeature { DataFeature.created(JsObject o) : super.created(o); DataFeature([DataFeatureOptions options]) : this.created(new JsObject( - getPath('google.maps.Data.Feature'), - [((e) => e == null ? null : asJsObject(e))(options)])); + getPath('google.maps.Data.Feature'), [__codec33.encode(options)])); void forEachProperty(callback(dynamic p1, String p2)) { - asJsObject(this).callMethod('forEachProperty', [callback]); + asJsObject(this).callMethod( + 'forEachProperty', [__codec34.encode(callback)]); } DataGeometry get geometry => _getGeometry(); DataGeometry _getGeometry() => - ((e) => e == null ? null : new DataGeometry.created(e))( - asJsObject(this).callMethod('getGeometry')); + __codec35.decode(asJsObject(this).callMethod('getGeometry')); dynamic /*num|String*/ get id => _getId(); dynamic /*num|String*/ _getId() => asJsObject(this).callMethod('getId'); dynamic getProperty(String name) => @@ -1122,13 +1019,13 @@ class DataFeature extends JsInterface implements _DataFeature { (o) => o != null && o.instanceof(getPath("google.maps.LatLng"))))) .encode(newGeometry)); void _setGeometry(dynamic /*DataGeometry|LatLng*/ newGeometry) { - asJsObject(this).callMethod('setGeometry', [toJs(newGeometry)]); + asJsObject(this).callMethod('setGeometry', [newGeometry]); } void setProperty(String name, dynamic newValue) { - asJsObject(this).callMethod('setProperty', [name, toJs(newValue)]); + asJsObject(this).callMethod('setProperty', [name, newValue]); } void toGeoJson(callback(Object p1)) { - asJsObject(this).callMethod('toGeoJson', [callback]); + asJsObject(this).callMethod('toGeoJson', [__codec31.encode(callback)]); } Stream get onRemoveproperty => getStream(this, @@ -1141,6 +1038,19 @@ class DataFeature extends JsInterface implements _DataFeature { #onSetproperty, "setproperty", (JsObject o) => new DataSetPropertyEvent.created(o)); } +/// codec for DataFeatureOptions +final __codec33 = new JsInterfaceCodec( + (o) => new DataFeatureOptions.created(o)); + +/// codec for (dynamic, String) → dynamic +final __codec34 = new FunctionCodec /*<(dynamic, String) → dynamic>*/ ((f) => f, + (JsFunction f) => (p_p1, p_p2) { + return f.apply([p_p1, p_p2]); +}); + +/// codec for DataGeometry +final __codec35 = + new JsInterfaceCodec((o) => new DataGeometry.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -1153,7 +1063,7 @@ class DataFeatureOptions extends JsInterface implements _DataFeatureOptions { DataFeatureOptions() : this.created(new JsObject(context['Object'])); void set _geometry(dynamic __geometry) { - asJsObject(this)['geometry'] = toJs(__geometry); + asJsObject(this)['geometry'] = __geometry; } dynamic get _geometry => asJsObject(this)['geometry']; dynamic /*DataGeometry|LatLng*/ get geometry => (new ChainedCodec() @@ -1172,11 +1082,11 @@ class DataFeatureOptions extends JsInterface implements _DataFeatureOptions { .encode(geometry); } void set id(dynamic _id) { - asJsObject(this)['id'] = toJs(_id); + asJsObject(this)['id'] = _id; } dynamic get id => asJsObject(this)['id']; void set properties(Object _properties) { - asJsObject(this)['properties'] = toJs(_properties); + asJsObject(this)['properties'] = _properties; } Object get properties => asJsObject(this)['properties']; } @@ -1203,11 +1113,9 @@ class DataGeometry extends JsInterface implements _DataGeometry { class DataPoint extends DataGeometry implements _DataPoint { DataPoint.created(JsObject o) : super.created(o); DataPoint(LatLng latLng) : this.created(new JsObject( - getPath('google.maps.Data.Point'), - [((e) => e == null ? null : asJsObject(e))(latLng)])); + getPath('google.maps.Data.Point'), [__codec6.encode(latLng)])); - LatLng get() => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this).callMethod('get')); + LatLng get() => __codec6.decode(asJsObject(this).callMethod('get')); String get type => _getType(); String _getType() => asJsObject(this).callMethod('getType'); } @@ -1221,28 +1129,21 @@ class DataPoint extends DataGeometry implements _DataPoint { class DataMultiPoint extends DataGeometry implements _DataMultiPoint { DataMultiPoint.created(JsObject o) : super.created(o); DataMultiPoint(List elements) : this.created(new JsObject( - getPath('google.maps.Data.MultiPoint'), [ - ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map(new JsInterfaceCodec((o) => - ((e) => e == null ? null : new LatLng.created(e))(o)).encode)); - })(elements) - ])); + getPath('google.maps.Data.MultiPoint'), + [__codec36.encode(elements)])); List get array => _getArray(); - List _getArray() => ((e) { - if (e == null) return null; - return new JsList.created(e, new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new LatLng.created(e))(o))); - })(asJsObject(this).callMethod('getArray')); - LatLng getAt(num n) => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this).callMethod('getAt', [n])); + List _getArray() => + __codec36.decode(asJsObject(this).callMethod('getArray')); + LatLng getAt(num n) => + __codec6.decode(asJsObject(this).callMethod('getAt', [n])); num get length => _getLength(); num _getLength() => asJsObject(this).callMethod('getLength'); String get type => _getType(); String _getType() => asJsObject(this).callMethod('getType'); } +/// codec for List +final __codec36 = new JsListCodec(__codec6); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -1253,23 +1154,14 @@ class DataMultiPoint extends DataGeometry implements _DataMultiPoint { class DataLineString extends DataGeometry implements _DataLineString { DataLineString.created(JsObject o) : super.created(o); DataLineString(List elements) : this.created(new JsObject( - getPath('google.maps.Data.LineString'), [ - ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map(new JsInterfaceCodec((o) => - ((e) => e == null ? null : new LatLng.created(e))(o)).encode)); - })(elements) - ])); + getPath('google.maps.Data.LineString'), + [__codec36.encode(elements)])); List get array => _getArray(); - List _getArray() => ((e) { - if (e == null) return null; - return new JsList.created(e, new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new LatLng.created(e))(o))); - })(asJsObject(this).callMethod('getArray')); - LatLng getAt(num n) => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this).callMethod('getAt', [n])); + List _getArray() => + __codec36.decode(asJsObject(this).callMethod('getArray')); + LatLng getAt(num n) => + __codec6.decode(asJsObject(this).callMethod('getAt', [n])); num get length => _getLength(); num _getLength() => asJsObject(this).callMethod('getLength'); String get type => _getType(); @@ -1285,29 +1177,28 @@ class DataLineString extends DataGeometry implements _DataLineString { class DataMultiLineString extends DataGeometry implements _DataMultiLineString { DataMultiLineString.created(JsObject o) : super.created(o); DataMultiLineString(List*/ > elements) - : this.created(new JsObject(getPath('google.maps.Data.MultiLineString'), [ - ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e); - })(elements) - ])); + : this.created(new JsObject(getPath('google.maps.Data.MultiLineString'), + [__codec37.encode(elements)])); List get array => _getArray(); - List _getArray() => ((e) { - if (e == null) return null; - return new JsList.created(e, - new JsInterfaceCodec((o) => - ((e) => e == null ? null : new DataLineString.created(e))(o))); - })(asJsObject(this).callMethod('getArray')); + List _getArray() => + __codec39.decode(asJsObject(this).callMethod('getArray')); DataLineString getAt(num n) => - ((e) => e == null ? null : new DataLineString.created(e))( - asJsObject(this).callMethod('getAt', [n])); + __codec38.decode(asJsObject(this).callMethod('getAt', [n])); num get length => _getLength(); num _getLength() => asJsObject(this).callMethod('getLength'); String get type => _getType(); String _getType() => asJsObject(this).callMethod('getType'); } +/// codec for List +final __codec37 = new JsListCodec(null); + +/// codec for DataLineString +final __codec38 = + new JsInterfaceCodec((o) => new DataLineString.created(o)); + +/// codec for List +final __codec39 = new JsListCodec(__codec38); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -1318,23 +1209,14 @@ class DataMultiLineString extends DataGeometry implements _DataMultiLineString { class DataLinearRing extends DataGeometry implements _DataLinearRing { DataLinearRing.created(JsObject o) : super.created(o); DataLinearRing(List elements) : this.created(new JsObject( - getPath('google.maps.Data.LinearRing'), [ - ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map(new JsInterfaceCodec((o) => - ((e) => e == null ? null : new LatLng.created(e))(o)).encode)); - })(elements) - ])); + getPath('google.maps.Data.LinearRing'), + [__codec36.encode(elements)])); List get array => _getArray(); - List _getArray() => ((e) { - if (e == null) return null; - return new JsList.created(e, new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new LatLng.created(e))(o))); - })(asJsObject(this).callMethod('getArray')); - LatLng getAt(num n) => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this).callMethod('getAt', [n])); + List _getArray() => + __codec36.decode(asJsObject(this).callMethod('getArray')); + LatLng getAt(num n) => + __codec6.decode(asJsObject(this).callMethod('getAt', [n])); num get length => _getLength(); num _getLength() => asJsObject(this).callMethod('getLength'); String get type => _getType(); @@ -1350,29 +1232,25 @@ class DataLinearRing extends DataGeometry implements _DataLinearRing { class DataPolygon extends DataGeometry implements _DataPolygon { DataPolygon.created(JsObject o) : super.created(o); DataPolygon(List*/ > elements) - : this.created(new JsObject(getPath('google.maps.Data.Polygon'), [ - ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e); - })(elements) - ])); + : this.created(new JsObject( + getPath('google.maps.Data.Polygon'), [__codec37.encode(elements)])); List get array => _getArray(); - List _getArray() => ((e) { - if (e == null) return null; - return new JsList.created(e, - new JsInterfaceCodec((o) => - ((e) => e == null ? null : new DataLinearRing.created(e))(o))); - })(asJsObject(this).callMethod('getArray')); + List _getArray() => + __codec41.decode(asJsObject(this).callMethod('getArray')); DataLinearRing getAt(num n) => - ((e) => e == null ? null : new DataLinearRing.created(e))( - asJsObject(this).callMethod('getAt', [n])); + __codec40.decode(asJsObject(this).callMethod('getAt', [n])); num get length => _getLength(); num _getLength() => asJsObject(this).callMethod('getLength'); String get type => _getType(); String _getType() => asJsObject(this).callMethod('getType'); } +/// codec for DataLinearRing +final __codec40 = + new JsInterfaceCodec((o) => new DataLinearRing.created(o)); + +/// codec for List +final __codec41 = new JsListCodec(__codec40); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -1384,28 +1262,25 @@ class DataMultiPolygon extends DataGeometry implements _DataMultiPolygon { DataMultiPolygon.created(JsObject o) : super.created(o); DataMultiPolygon( List*/>*/ > elements) - : this.created(new JsObject(getPath('google.maps.Data.MultiPolygon'), [ - ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e); - })(elements) - ])); + : this.created(new JsObject(getPath('google.maps.Data.MultiPolygon'), + [__codec37.encode(elements)])); List get array => _getArray(); - List _getArray() => ((e) { - if (e == null) return null; - return new JsList.created(e, new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new DataPolygon.created(e))(o))); - })(asJsObject(this).callMethod('getArray')); - DataPolygon getAt(num n) => ((e) => e == null - ? null - : new DataPolygon.created(e))(asJsObject(this).callMethod('getAt', [n])); + List _getArray() => + __codec43.decode(asJsObject(this).callMethod('getArray')); + DataPolygon getAt(num n) => + __codec42.decode(asJsObject(this).callMethod('getAt', [n])); num get length => _getLength(); num _getLength() => asJsObject(this).callMethod('getLength'); String get type => _getType(); String _getType() => asJsObject(this).callMethod('getType'); } +/// codec for DataPolygon +final __codec42 = + new JsInterfaceCodec((o) => new DataPolygon.created(o)); + +/// codec for List +final __codec43 = new JsListCodec(__codec42); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -1418,29 +1293,21 @@ class DataGeometryCollection extends DataGeometry DataGeometryCollection.created(JsObject o) : super.created(o); DataGeometryCollection(List elements) : this.created(new JsObject( - getPath('google.maps.Data.GeometryCollection'), [ - ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e); - })(elements) - ])); + getPath('google.maps.Data.GeometryCollection'), + [__codec37.encode(elements)])); List get array => _getArray(); - List _getArray() => ((e) { - if (e == null) return null; - return new JsList.created(e, - new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new DataGeometry.created(e))(o))); - })(asJsObject(this).callMethod('getArray')); - DataGeometry getAt(num n) => ((e) => e == null - ? null - : new DataGeometry.created(e))(asJsObject(this).callMethod('getAt', [n])); + List _getArray() => + __codec44.decode(asJsObject(this).callMethod('getArray')); + DataGeometry getAt(num n) => + __codec35.decode(asJsObject(this).callMethod('getAt', [n])); num get length => _getLength(); num _getLength() => asJsObject(this).callMethod('getLength'); String get type => _getType(); String _getType() => asJsObject(this).callMethod('getType'); } +/// codec for List +final __codec44 = new JsListCodec(__codec35); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -1453,12 +1320,9 @@ class DataMouseEvent extends MouseEvent implements _DataMouseEvent { DataMouseEvent() : this.created(new JsObject(context['Object'])); void set feature(DataFeature _feature) { - asJsObject(this)['feature'] = - ((e) => e == null ? null : asJsObject(e))(_feature); + asJsObject(this)['feature'] = __codec25.encode(_feature); } - DataFeature get feature => ((e) => e == null - ? null - : new DataFeature.created(e))(asJsObject(this)['feature']); + DataFeature get feature => __codec25.decode(asJsObject(this)['feature']); } // ************************************************************************** @@ -1472,12 +1336,9 @@ class DataAddFeatureEvent extends JsInterface implements _DataAddFeatureEvent { DataAddFeatureEvent() : this.created(new JsObject(context['Object'])); void set feature(DataFeature _feature) { - asJsObject(this)['feature'] = - ((e) => e == null ? null : asJsObject(e))(_feature); + asJsObject(this)['feature'] = __codec25.encode(_feature); } - DataFeature get feature => ((e) => e == null - ? null - : new DataFeature.created(e))(asJsObject(this)['feature']); + DataFeature get feature => __codec25.decode(asJsObject(this)['feature']); } // ************************************************************************** @@ -1492,12 +1353,9 @@ class DataRemoveFeatureEvent extends JsInterface DataRemoveFeatureEvent() : this.created(new JsObject(context['Object'])); void set feature(DataFeature _feature) { - asJsObject(this)['feature'] = - ((e) => e == null ? null : asJsObject(e))(_feature); + asJsObject(this)['feature'] = __codec25.encode(_feature); } - DataFeature get feature => ((e) => e == null - ? null - : new DataFeature.created(e))(asJsObject(this)['feature']); + DataFeature get feature => __codec25.decode(asJsObject(this)['feature']); } // ************************************************************************** @@ -1512,26 +1370,19 @@ class DataSetGeometryEvent extends JsInterface DataSetGeometryEvent() : this.created(new JsObject(context['Object'])); void set feature(DataFeature _feature) { - asJsObject(this)['feature'] = - ((e) => e == null ? null : asJsObject(e))(_feature); + asJsObject(this)['feature'] = __codec25.encode(_feature); } - DataFeature get feature => ((e) => e == null - ? null - : new DataFeature.created(e))(asJsObject(this)['feature']); + DataFeature get feature => __codec25.decode(asJsObject(this)['feature']); void set newGeometry(DataGeometry _newGeometry) { - asJsObject(this)['newGeometry'] = - ((e) => e == null ? null : asJsObject(e))(_newGeometry); + asJsObject(this)['newGeometry'] = __codec35.encode(_newGeometry); } - DataGeometry get newGeometry => ((e) => e == null - ? null - : new DataGeometry.created(e))(asJsObject(this)['newGeometry']); + DataGeometry get newGeometry => + __codec35.decode(asJsObject(this)['newGeometry']); void set oldGeometry(DataGeometry _oldGeometry) { - asJsObject(this)['oldGeometry'] = - ((e) => e == null ? null : asJsObject(e))(_oldGeometry); + asJsObject(this)['oldGeometry'] = __codec35.encode(_oldGeometry); } - DataGeometry get oldGeometry => ((e) => e == null - ? null - : new DataGeometry.created(e))(asJsObject(this)['oldGeometry']); + DataGeometry get oldGeometry => + __codec35.decode(asJsObject(this)['oldGeometry']); } // ************************************************************************** @@ -1546,22 +1397,19 @@ class DataSetPropertyEvent extends JsInterface DataSetPropertyEvent() : this.created(new JsObject(context['Object'])); void set feature(DataFeature _feature) { - asJsObject(this)['feature'] = - ((e) => e == null ? null : asJsObject(e))(_feature); + asJsObject(this)['feature'] = __codec25.encode(_feature); } - DataFeature get feature => ((e) => e == null - ? null - : new DataFeature.created(e))(asJsObject(this)['feature']); + DataFeature get feature => __codec25.decode(asJsObject(this)['feature']); void set name(String _name) { asJsObject(this)['name'] = _name; } String get name => asJsObject(this)['name']; void set newValue(dynamic _newValue) { - asJsObject(this)['newValue'] = toJs(_newValue); + asJsObject(this)['newValue'] = _newValue; } dynamic get newValue => asJsObject(this)['newValue']; void set oldValue(dynamic _oldValue) { - asJsObject(this)['oldValue'] = toJs(_oldValue); + asJsObject(this)['oldValue'] = _oldValue; } dynamic get oldValue => asJsObject(this)['oldValue']; } @@ -1578,18 +1426,15 @@ class DataRemovePropertyEvent extends JsInterface DataRemovePropertyEvent() : this.created(new JsObject(context['Object'])); void set feature(DataFeature _feature) { - asJsObject(this)['feature'] = - ((e) => e == null ? null : asJsObject(e))(_feature); + asJsObject(this)['feature'] = __codec25.encode(_feature); } - DataFeature get feature => ((e) => e == null - ? null - : new DataFeature.created(e))(asJsObject(this)['feature']); + DataFeature get feature => __codec25.decode(asJsObject(this)['feature']); void set name(String _name) { asJsObject(this)['name'] = _name; } String get name => asJsObject(this)['name']; void set oldValue(dynamic _oldValue) { - asJsObject(this)['oldValue'] = toJs(_oldValue); + asJsObject(this)['oldValue'] = _oldValue; } dynamic get oldValue => asJsObject(this)['oldValue']; } @@ -1603,20 +1448,14 @@ class DataRemovePropertyEvent extends JsInterface class Marker extends MVCObject implements _Marker { Marker.created(JsObject o) : super.created(o); Marker([MarkerOptions opts]) : this.created(new JsObject( - getPath('google.maps.Marker'), - [((e) => e == null ? null : asJsObject(e))(opts)])); + getPath('google.maps.Marker'), [__codec45.encode(opts)])); Animation get animation => _getAnimation(); - Animation _getAnimation() => ((e) { - if (e == null) return null; - final path = getPath('google.maps.Animation'); - if (e == path['BOUNCE']) return Animation.BOUNCE; - if (e == path['DROP']) return Animation.DROP; - })(asJsObject(this).callMethod('getAnimation')); + Animation _getAnimation() => + __codec46.decode(asJsObject(this).callMethod('getAnimation')); Attribution get attribution => _getAttribution(); Attribution _getAttribution() => - ((e) => e == null ? null : new Attribution.created(e))( - asJsObject(this).callMethod('getAttribution')); + __codec47.decode(asJsObject(this).callMethod('getAttribution')); bool get clickable => _getClickable(); bool _getClickable() => asJsObject(this).callMethod('getClickable'); String get cursor => _getCursor(); @@ -1640,15 +1479,14 @@ class Marker extends MVCObject implements _Marker { num get opacity => _getOpacity(); num _getOpacity() => asJsObject(this).callMethod('getOpacity'); Place get place => _getPlace(); - Place _getPlace() => ((e) => e == null ? null : new Place.created(e))( - asJsObject(this).callMethod('getPlace')); + Place _getPlace() => + __codec48.decode(asJsObject(this).callMethod('getPlace')); LatLng get position => _getPosition(); - LatLng _getPosition() => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this).callMethod('getPosition')); + LatLng _getPosition() => + __codec6.decode(asJsObject(this).callMethod('getPosition')); MarkerShape get shape => _getShape(); - MarkerShape _getShape() => ((e) => e == null - ? null - : new MarkerShape.created(e))(asJsObject(this).callMethod('getShape')); + MarkerShape _getShape() => + __codec32.decode(asJsObject(this).callMethod('getShape')); String get title => _getTitle(); String _getTitle() => asJsObject(this).callMethod('getTitle'); bool get visible => _getVisible(); @@ -1657,19 +1495,12 @@ class Marker extends MVCObject implements _Marker { num _getZIndex() => asJsObject(this).callMethod('getZIndex'); void set animation(Animation animation) => _setAnimation(animation); void _setAnimation(Animation animation) { - asJsObject(this).callMethod('setAnimation', [ - ((e) { - if (e == null) return null; - final path = getPath('google.maps.Animation'); - if (e == Animation.BOUNCE) return path['BOUNCE']; - if (e == Animation.DROP) return path['DROP']; - })(animation) - ]); + asJsObject(this).callMethod('setAnimation', [__codec46.encode(animation)]); } void set attribution(Attribution attribution) => _setAttribution(attribution); void _setAttribution(Attribution attribution) { - asJsObject(this).callMethod('setAttribution', - [((e) => e == null ? null : asJsObject(e))(attribution)]); + asJsObject(this).callMethod( + 'setAttribution', [__codec47.encode(attribution)]); } void set clickable(bool flag) => _setClickable(flag); void _setClickable(bool flag) { @@ -1690,7 +1521,7 @@ class Marker extends MVCObject implements _Marker { ..add(new JsInterfaceCodec((o) => new GSymbol.created(o)))) .encode(icon)); void _setIcon(dynamic /*String|Icon|GSymbol*/ icon) { - asJsObject(this).callMethod('setIcon', [toJs(icon)]); + asJsObject(this).callMethod('setIcon', [icon]); } void set map(dynamic /*GMap|StreetViewPanorama*/ map) => _setMap( (new ChainedCodec() @@ -1701,7 +1532,7 @@ class Marker extends MVCObject implements _Marker { o.instanceof(getPath("google.maps.StreetViewPanorama"))))) .encode(map)); void _setMap(dynamic /*GMap|StreetViewPanorama*/ map) { - asJsObject(this).callMethod('setMap', [toJs(map)]); + asJsObject(this).callMethod('setMap', [map]); } void set opacity(num opacity) => _setOpacity(opacity); void _setOpacity(num opacity) { @@ -1709,23 +1540,19 @@ class Marker extends MVCObject implements _Marker { } void set options(MarkerOptions options) => _setOptions(options); void _setOptions(MarkerOptions options) { - asJsObject(this).callMethod( - 'setOptions', [((e) => e == null ? null : asJsObject(e))(options)]); + asJsObject(this).callMethod('setOptions', [__codec45.encode(options)]); } void set place(Place place) => _setPlace(place); void _setPlace(Place place) { - asJsObject(this).callMethod( - 'setPlace', [((e) => e == null ? null : asJsObject(e))(place)]); + asJsObject(this).callMethod('setPlace', [__codec48.encode(place)]); } void set position(LatLng latlng) => _setPosition(latlng); void _setPosition(LatLng latlng) { - asJsObject(this).callMethod( - 'setPosition', [((e) => e == null ? null : asJsObject(e))(latlng)]); + asJsObject(this).callMethod('setPosition', [__codec6.encode(latlng)]); } void set shape(MarkerShape shape) => _setShape(shape); void _setShape(MarkerShape shape) { - asJsObject(this).callMethod( - 'setShape', [((e) => e == null ? null : asJsObject(e))(shape)]); + asJsObject(this).callMethod('setShape', [__codec32.encode(shape)]); } void set title(String title) => _setTitle(title); void _setTitle(String title) { @@ -1781,6 +1608,22 @@ class Marker extends MVCObject implements _Marker { Stream get onZindexChanged => getStream(this, #onZindexChanged, "zindex_changed"); } +/// codec for MarkerOptions +final __codec45 = + new JsInterfaceCodec((o) => new MarkerOptions.created(o)); + +/// codec for Animation +final __codec46 = new BiMapCodec({ + Animation.BOUNCE: getPath('google.maps.Animation')['BOUNCE'], + Animation.DROP: getPath('google.maps.Animation')['DROP'] +}); + +/// codec for Attribution +final __codec47 = + new JsInterfaceCodec((o) => new Attribution.created(o)); + +/// codec for Place +final __codec48 = new JsInterfaceCodec((o) => new Place.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -1793,32 +1636,18 @@ class MarkerOptions extends JsInterface implements _MarkerOptions { MarkerOptions() : this.created(new JsObject(context['Object'])); void set anchorPoint(Point _anchorPoint) { - asJsObject(this)['anchorPoint'] = - ((e) => e == null ? null : asJsObject(e))(_anchorPoint); + asJsObject(this)['anchorPoint'] = __codec49.encode(_anchorPoint); } - Point get anchorPoint => ((e) => e == null ? null : new Point.created(e))( - asJsObject(this)['anchorPoint']); + Point get anchorPoint => __codec49.decode(asJsObject(this)['anchorPoint']); void set animation(Animation _animation) { - asJsObject(this)['animation'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.Animation'); - if (e == Animation.BOUNCE) return path['BOUNCE']; - if (e == Animation.DROP) return path['DROP']; - })(_animation); - } - Animation get animation => ((e) { - if (e == null) return null; - final path = getPath('google.maps.Animation'); - if (e == path['BOUNCE']) return Animation.BOUNCE; - if (e == path['DROP']) return Animation.DROP; - })(asJsObject(this)['animation']); + asJsObject(this)['animation'] = __codec46.encode(_animation); + } + Animation get animation => __codec46.decode(asJsObject(this)['animation']); void set attribution(Attribution _attribution) { - asJsObject(this)['attribution'] = - ((e) => e == null ? null : asJsObject(e))(_attribution); + asJsObject(this)['attribution'] = __codec47.encode(_attribution); } - Attribution get attribution => ((e) => e == null - ? null - : new Attribution.created(e))(asJsObject(this)['attribution']); + Attribution get attribution => + __codec47.decode(asJsObject(this)['attribution']); void set clickable(bool _clickable) { asJsObject(this)['clickable'] = _clickable; } @@ -1836,7 +1665,7 @@ class MarkerOptions extends JsInterface implements _MarkerOptions { } bool get draggable => asJsObject(this)['draggable']; void set _icon(dynamic __icon) { - asJsObject(this)['icon'] = toJs(__icon); + asJsObject(this)['icon'] = __icon; } dynamic get _icon => asJsObject(this)['icon']; dynamic /*String|Icon|GSymbol*/ get icon => (new ChainedCodec() @@ -1852,7 +1681,7 @@ class MarkerOptions extends JsInterface implements _MarkerOptions { .encode(icon); } void set _map(dynamic __map) { - asJsObject(this)['map'] = toJs(__map); + asJsObject(this)['map'] = __map; } dynamic get _map => asJsObject(this)['map']; dynamic /*GMap|StreetViewPanorama*/ get map => (new ChainedCodec() @@ -1880,23 +1709,17 @@ class MarkerOptions extends JsInterface implements _MarkerOptions { } bool get optimized => asJsObject(this)['optimized']; void set place(Place _place) { - asJsObject(this)['place'] = - ((e) => e == null ? null : asJsObject(e))(_place); + asJsObject(this)['place'] = __codec48.encode(_place); } - Place get place => ((e) => e == null ? null : new Place.created(e))( - asJsObject(this)['place']); + Place get place => __codec48.decode(asJsObject(this)['place']); void set position(LatLng _position) { - asJsObject(this)['position'] = - ((e) => e == null ? null : asJsObject(e))(_position); + asJsObject(this)['position'] = __codec6.encode(_position); } - LatLng get position => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this)['position']); + LatLng get position => __codec6.decode(asJsObject(this)['position']); void set shape(MarkerShape _shape) { - asJsObject(this)['shape'] = - ((e) => e == null ? null : asJsObject(e))(_shape); + asJsObject(this)['shape'] = __codec32.encode(_shape); } - MarkerShape get shape => ((e) => - e == null ? null : new MarkerShape.created(e))(asJsObject(this)['shape']); + MarkerShape get shape => __codec32.decode(asJsObject(this)['shape']); void set title(String _title) { asJsObject(this)['title'] = _title; } @@ -1910,6 +1733,8 @@ class MarkerOptions extends JsInterface implements _MarkerOptions { } num get zIndex => asJsObject(this)['zIndex']; } +/// codec for Point +final __codec49 = new JsInterfaceCodec((o) => new Point.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -1922,33 +1747,28 @@ class Icon extends JsInterface implements _Icon { Icon() : this.created(new JsObject(context['Object'])); void set anchor(Point _anchor) { - asJsObject(this)['anchor'] = - ((e) => e == null ? null : asJsObject(e))(_anchor); + asJsObject(this)['anchor'] = __codec49.encode(_anchor); } - Point get anchor => ((e) => e == null ? null : new Point.created(e))( - asJsObject(this)['anchor']); + Point get anchor => __codec49.decode(asJsObject(this)['anchor']); void set origin(Point _origin) { - asJsObject(this)['origin'] = - ((e) => e == null ? null : asJsObject(e))(_origin); + asJsObject(this)['origin'] = __codec49.encode(_origin); } - Point get origin => ((e) => e == null ? null : new Point.created(e))( - asJsObject(this)['origin']); + Point get origin => __codec49.decode(asJsObject(this)['origin']); void set scaledSize(Size _scaledSize) { - asJsObject(this)['scaledSize'] = - ((e) => e == null ? null : asJsObject(e))(_scaledSize); + asJsObject(this)['scaledSize'] = __codec50.encode(_scaledSize); } - Size get scaledSize => ((e) => e == null ? null : new Size.created(e))( - asJsObject(this)['scaledSize']); + Size get scaledSize => __codec50.decode(asJsObject(this)['scaledSize']); void set size(Size _size) { - asJsObject(this)['size'] = ((e) => e == null ? null : asJsObject(e))(_size); + asJsObject(this)['size'] = __codec50.encode(_size); } - Size get size => - ((e) => e == null ? null : new Size.created(e))(asJsObject(this)['size']); + Size get size => __codec50.decode(asJsObject(this)['size']); void set url(String _url) { asJsObject(this)['url'] = _url; } String get url => asJsObject(this)['url']; } +/// codec for Size +final __codec50 = new JsInterfaceCodec((o) => new Size.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -1961,18 +1781,16 @@ class MarkerShape extends JsInterface implements _MarkerShape { MarkerShape() : this.created(new JsObject(context['Object'])); void set coords(List _coords) { - asJsObject(this)['coords'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e); - })(_coords); + asJsObject(this)['coords'] = __codec51.encode(_coords); } - List get coords => asJsObject(this)['coords'] as JsArray; + List get coords => __codec51.decode(asJsObject(this)['coords']); void set type(String _type) { asJsObject(this)['type'] = _type; } String get type => asJsObject(this)['type']; } +/// codec for List +final __codec51 = new JsListCodec(null); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -1985,11 +1803,9 @@ class GSymbol extends JsInterface implements _GSymbol { GSymbol() : this.created(new JsObject(context['Object'])); void set anchor(Point _anchor) { - asJsObject(this)['anchor'] = - ((e) => e == null ? null : asJsObject(e))(_anchor); + asJsObject(this)['anchor'] = __codec49.encode(_anchor); } - Point get anchor => ((e) => e == null ? null : new Point.created(e))( - asJsObject(this)['anchor']); + Point get anchor => __codec49.decode(asJsObject(this)['anchor']); void set fillColor(String _fillColor) { asJsObject(this)['fillColor'] = _fillColor; } @@ -1999,7 +1815,7 @@ class GSymbol extends JsInterface implements _GSymbol { } num get fillOpacity => asJsObject(this)['fillOpacity']; void set _path(dynamic __path) { - asJsObject(this)['path'] = toJs(__path); + asJsObject(this)['path'] = __path; } dynamic get _path => asJsObject(this)['path']; dynamic /*SymbolPath|String*/ get path => (new ChainedCodec() @@ -2061,8 +1877,7 @@ class GSymbol extends JsInterface implements _GSymbol { class InfoWindow extends MVCObject implements _InfoWindow { InfoWindow.created(JsObject o) : super.created(o); InfoWindow([InfoWindowOptions opts]) : this.created(new JsObject( - getPath('google.maps.InfoWindow'), - [((e) => e == null ? null : asJsObject(e))(opts)])); + getPath('google.maps.InfoWindow'), [__codec52.encode(opts)])); void close() { asJsObject(this).callMethod('close'); @@ -2071,8 +1886,8 @@ class InfoWindow extends MVCObject implements _InfoWindow { dynamic /*String|Node*/ _getContent() => asJsObject(this).callMethod('getContent'); LatLng get position => _getPosition(); - LatLng _getPosition() => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this).callMethod('getPosition')); + LatLng _getPosition() => + __codec6.decode(asJsObject(this).callMethod('getPosition')); num get zIndex => _getZIndex(); num _getZIndex() => asJsObject(this).callMethod('getZIndex'); void open([dynamic /*GMap|StreetViewPanorama*/ map, MVCObject anchor]) { @@ -2085,23 +1900,18 @@ class InfoWindow extends MVCObject implements _InfoWindow { .encode(map), anchor); } _open([dynamic /*GMap|StreetViewPanorama*/ map, MVCObject anchor]) => - asJsObject(this).callMethod('open', [ - toJs(map), - ((e) => e == null ? null : asJsObject(e))(anchor) - ]); + asJsObject(this).callMethod('open', [map, __codec53.encode(anchor)]); void set content(dynamic /*String|Node*/ content) => _setContent(content); void _setContent(dynamic /*String|Node*/ content) { - asJsObject(this).callMethod('setContent', [toJs(content)]); + asJsObject(this).callMethod('setContent', [content]); } void set options(InfoWindowOptions options) => _setOptions(options); void _setOptions(InfoWindowOptions options) { - asJsObject(this).callMethod( - 'setOptions', [((e) => e == null ? null : asJsObject(e))(options)]); + asJsObject(this).callMethod('setOptions', [__codec52.encode(options)]); } void set position(LatLng position) => _setPosition(position); void _setPosition(LatLng position) { - asJsObject(this).callMethod( - 'setPosition', [((e) => e == null ? null : asJsObject(e))(position)]); + asJsObject(this).callMethod('setPosition', [__codec6.encode(position)]); } void set zIndex(num zIndex) => _setZIndex(zIndex); void _setZIndex(num zIndex) { @@ -2117,6 +1927,13 @@ class InfoWindow extends MVCObject implements _InfoWindow { Stream get onZindexChanged => getStream(this, #onZindexChanged, "zindex_changed"); } +/// codec for InfoWindowOptions +final __codec52 = new JsInterfaceCodec( + (o) => new InfoWindowOptions.created(o)); + +/// codec for MVCObject +final __codec53 = + new JsInterfaceCodec((o) => new MVCObject.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -2129,7 +1946,7 @@ class InfoWindowOptions extends JsInterface implements _InfoWindowOptions { InfoWindowOptions() : this.created(new JsObject(context['Object'])); void set content(dynamic _content) { - asJsObject(this)['content'] = toJs(_content); + asJsObject(this)['content'] = _content; } dynamic get content => asJsObject(this)['content']; void set disableAutoPan(bool _disableAutoPan) { @@ -2141,17 +1958,13 @@ class InfoWindowOptions extends JsInterface implements _InfoWindowOptions { } num get maxWidth => asJsObject(this)['maxWidth']; void set pixelOffset(Size _pixelOffset) { - asJsObject(this)['pixelOffset'] = - ((e) => e == null ? null : asJsObject(e))(_pixelOffset); + asJsObject(this)['pixelOffset'] = __codec50.encode(_pixelOffset); } - Size get pixelOffset => ((e) => e == null ? null : new Size.created(e))( - asJsObject(this)['pixelOffset']); + Size get pixelOffset => __codec50.decode(asJsObject(this)['pixelOffset']); void set position(LatLng _position) { - asJsObject(this)['position'] = - ((e) => e == null ? null : asJsObject(e))(_position); + asJsObject(this)['position'] = __codec6.encode(_position); } - LatLng get position => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this)['position']); + LatLng get position => __codec6.decode(asJsObject(this)['position']); void set zIndex(num _zIndex) { asJsObject(this)['zIndex'] = _zIndex; } @@ -2167,16 +1980,14 @@ class InfoWindowOptions extends JsInterface implements _InfoWindowOptions { class Polyline extends MVCObject implements _Polyline { Polyline.created(JsObject o) : super.created(o); Polyline([PolylineOptions opts]) : this.created(new JsObject( - getPath('google.maps.Polyline'), - [((e) => e == null ? null : asJsObject(e))(opts)])); + getPath('google.maps.Polyline'), [__codec54.encode(opts)])); bool get draggable => _getDraggable(); bool _getDraggable() => asJsObject(this).callMethod('getDraggable'); bool get editable => _getEditable(); bool _getEditable() => asJsObject(this).callMethod('getEditable'); GMap get map => _getMap(); - GMap _getMap() => ((e) => e == null ? null : new GMap.created(e))( - asJsObject(this).callMethod('getMap')); + GMap _getMap() => __codec28.decode(asJsObject(this).callMethod('getMap')); MVCArray get path => (new JsInterfaceCodec>( (o) => new MVCArray.created(o, @@ -2198,13 +2009,11 @@ class Polyline extends MVCObject implements _Polyline { } void set map(GMap map) => _setMap(map); void _setMap(GMap map) { - asJsObject(this).callMethod( - 'setMap', [((e) => e == null ? null : asJsObject(e))(map)]); + asJsObject(this).callMethod('setMap', [__codec28.encode(map)]); } void set options(PolylineOptions options) => _setOptions(options); void _setOptions(PolylineOptions options) { - asJsObject(this).callMethod( - 'setOptions', [((e) => e == null ? null : asJsObject(e))(options)]); + asJsObject(this).callMethod('setOptions', [__codec54.encode(options)]); } void set path(dynamic /*MVCArray|List*/ path) => _setPath( (new ChainedCodec() @@ -2218,7 +2027,7 @@ class Polyline extends MVCObject implements _Polyline { (o) => o != null && o.instanceof(getPath("google.maps.LatLng")))))) .encode(path)); void _setPath(dynamic /*MVCArray|List*/ path) { - asJsObject(this).callMethod('setPath', [toJs(path)]); + asJsObject(this).callMethod('setPath', [path]); } void set visible(bool visible) => _setVisible(visible); void _setVisible(bool visible) { @@ -2248,6 +2057,9 @@ class Polyline extends MVCObject implements _Polyline { Stream get onRightclick => getStream(this, #onRightclick, "rightclick", (JsObject o) => new PolyMouseEvent.created(o)); } +/// codec for PolylineOptions +final __codec54 = new JsInterfaceCodec( + (o) => new PolylineOptions.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -2276,26 +2088,15 @@ class PolylineOptions extends JsInterface implements _PolylineOptions { } bool get geodesic => asJsObject(this)['geodesic']; void set icons(List _icons) { - asJsObject(this)['icons'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map(new JsInterfaceCodec((o) => - ((e) => e == null ? null : new IconSequence.created(e))(o)).encode)); - })(_icons); - } - List get icons => ((e) { - if (e == null) return null; - return new JsList.created(e, - new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new IconSequence.created(e))(o))); - })(asJsObject(this)['icons']); + asJsObject(this)['icons'] = __codec56.encode(_icons); + } + List get icons => __codec56.decode(asJsObject(this)['icons']); void set map(GMap _map) { - asJsObject(this)['map'] = ((e) => e == null ? null : asJsObject(e))(_map); + asJsObject(this)['map'] = __codec28.encode(_map); } - GMap get map => - ((e) => e == null ? null : new GMap.created(e))(asJsObject(this)['map']); + GMap get map => __codec28.decode(asJsObject(this)['map']); void set _path(dynamic __path) { - asJsObject(this)['path'] = toJs(__path); + asJsObject(this)['path'] = __path; } dynamic get _path => asJsObject(this)['path']; dynamic /*MVCArray|List*/ get path => (new ChainedCodec() @@ -2342,6 +2143,12 @@ class PolylineOptions extends JsInterface implements _PolylineOptions { } num get zIndex => asJsObject(this)['zIndex']; } +/// codec for IconSequence +final __codec55 = + new JsInterfaceCodec((o) => new IconSequence.created(o)); + +/// codec for List +final __codec56 = new JsListCodec(__codec55); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -2358,10 +2165,9 @@ class IconSequence extends JsInterface implements _IconSequence { } bool get fixedRotation => asJsObject(this)['fixedRotation']; void set icon(GSymbol _icon) { - asJsObject(this)['icon'] = ((e) => e == null ? null : asJsObject(e))(_icon); + asJsObject(this)['icon'] = __codec57.encode(_icon); } - GSymbol get icon => ((e) => e == null ? null : new GSymbol.created(e))( - asJsObject(this)['icon']); + GSymbol get icon => __codec57.decode(asJsObject(this)['icon']); void set offset(String _offset) { asJsObject(this)['offset'] = _offset; } @@ -2371,6 +2177,8 @@ class IconSequence extends JsInterface implements _IconSequence { } String get repeat => asJsObject(this)['repeat']; } +/// codec for GSymbol +final __codec57 = new JsInterfaceCodec((o) => new GSymbol.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -2381,16 +2189,14 @@ class IconSequence extends JsInterface implements _IconSequence { class Polygon extends MVCObject implements _Polygon { Polygon.created(JsObject o) : super.created(o); Polygon([PolygonOptions opts]) : this.created(new JsObject( - getPath('google.maps.Polygon'), - [((e) => e == null ? null : asJsObject(e))(opts)])); + getPath('google.maps.Polygon'), [__codec58.encode(opts)])); bool get draggable => _getDraggable(); bool _getDraggable() => asJsObject(this).callMethod('getDraggable'); bool get editable => _getEditable(); bool _getEditable() => asJsObject(this).callMethod('getEditable'); GMap get map => _getMap(); - GMap _getMap() => ((e) => e == null ? null : new GMap.created(e))( - asJsObject(this).callMethod('getMap')); + GMap _getMap() => __codec28.decode(asJsObject(this).callMethod('getMap')); MVCArray get path => (new JsInterfaceCodec>( (o) => new MVCArray.created(o, @@ -2427,13 +2233,11 @@ class Polygon extends MVCObject implements _Polygon { } void set map(GMap map) => _setMap(map); void _setMap(GMap map) { - asJsObject(this).callMethod( - 'setMap', [((e) => e == null ? null : asJsObject(e))(map)]); + asJsObject(this).callMethod('setMap', [__codec28.encode(map)]); } void set options(PolygonOptions options) => _setOptions(options); void _setOptions(PolygonOptions options) { - asJsObject(this).callMethod( - 'setOptions', [((e) => e == null ? null : asJsObject(e))(options)]); + asJsObject(this).callMethod('setOptions', [__codec58.encode(options)]); } void set path(dynamic /*MVCArray|List*/ path) => _setPath( (new ChainedCodec() @@ -2447,7 +2251,7 @@ class Polygon extends MVCObject implements _Polygon { (o) => o != null && o.instanceof(getPath("google.maps.LatLng")))))) .encode(path)); void _setPath(dynamic /*MVCArray|List*/ path) { - asJsObject(this).callMethod('setPath', [toJs(path)]); + asJsObject(this).callMethod('setPath', [path]); } void set paths( dynamic /*MVCArray>|MVCArray|List>|List*/ paths) => @@ -2478,7 +2282,7 @@ class Polygon extends MVCObject implements _Polygon { .encode(paths)); void _setPaths( dynamic /*MVCArray>|MVCArray|List>|List*/ paths) { - asJsObject(this).callMethod('setPaths', [toJs(paths)]); + asJsObject(this).callMethod('setPaths', [paths]); } void set visible(bool visible) => _setVisible(visible); void _setVisible(bool visible) { @@ -2508,6 +2312,9 @@ class Polygon extends MVCObject implements _Polygon { Stream get onRightclick => getStream(this, #onRightclick, "rightclick", (JsObject o) => new PolyMouseEvent.created(o)); } +/// codec for PolygonOptions +final __codec58 = + new JsInterfaceCodec((o) => new PolygonOptions.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -2544,12 +2351,11 @@ class PolygonOptions extends JsInterface implements _PolygonOptions { } bool get geodesic => asJsObject(this)['geodesic']; void set map(GMap _map) { - asJsObject(this)['map'] = ((e) => e == null ? null : asJsObject(e))(_map); + asJsObject(this)['map'] = __codec28.encode(_map); } - GMap get map => - ((e) => e == null ? null : new GMap.created(e))(asJsObject(this)['map']); + GMap get map => __codec28.decode(asJsObject(this)['map']); void set _paths(dynamic __paths) { - asJsObject(this)['paths'] = toJs(__paths); + asJsObject(this)['paths'] = __paths; } dynamic get _paths => asJsObject(this)['paths']; dynamic /*MVCArray>|MVCArray|List>|List*/ get paths => @@ -2616,21 +2422,10 @@ class PolygonOptions extends JsInterface implements _PolygonOptions { } num get strokeOpacity => asJsObject(this)['strokeOpacity']; void set strokePosition(StrokePosition _strokePosition) { - asJsObject(this)['strokePosition'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.StrokePosition'); - if (e == StrokePosition.CENTER) return path['CENTER']; - if (e == StrokePosition.INSIDE) return path['INSIDE']; - if (e == StrokePosition.OUTSIDE) return path['OUTSIDE']; - })(_strokePosition); - } - StrokePosition get strokePosition => ((e) { - if (e == null) return null; - final path = getPath('google.maps.StrokePosition'); - if (e == path['CENTER']) return StrokePosition.CENTER; - if (e == path['INSIDE']) return StrokePosition.INSIDE; - if (e == path['OUTSIDE']) return StrokePosition.OUTSIDE; - })(asJsObject(this)['strokePosition']); + asJsObject(this)['strokePosition'] = __codec59.encode(_strokePosition); + } + StrokePosition get strokePosition => + __codec59.decode(asJsObject(this)['strokePosition']); void set strokeWeight(num _strokeWeight) { asJsObject(this)['strokeWeight'] = _strokeWeight; } @@ -2644,6 +2439,12 @@ class PolygonOptions extends JsInterface implements _PolygonOptions { } num get zIndex => asJsObject(this)['zIndex']; } +/// codec for StrokePosition +final __codec59 = new BiMapCodec({ + StrokePosition.CENTER: getPath('google.maps.StrokePosition')['CENTER'], + StrokePosition.INSIDE: getPath('google.maps.StrokePosition')['INSIDE'], + StrokePosition.OUTSIDE: getPath('google.maps.StrokePosition')['OUTSIDE'] +}); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -2678,26 +2479,22 @@ class PolyMouseEvent extends MouseEvent implements _PolyMouseEvent { class Rectangle extends MVCObject implements _Rectangle { Rectangle.created(JsObject o) : super.created(o); Rectangle([RectangleOptions opts]) : this.created(new JsObject( - getPath('google.maps.Rectangle'), - [((e) => e == null ? null : asJsObject(e))(opts)])); + getPath('google.maps.Rectangle'), [__codec60.encode(opts)])); LatLngBounds get bounds => _getBounds(); - LatLngBounds _getBounds() => ((e) => e == null - ? null - : new LatLngBounds.created(e))(asJsObject(this).callMethod('getBounds')); + LatLngBounds _getBounds() => + __codec5.decode(asJsObject(this).callMethod('getBounds')); bool get draggable => _getDraggable(); bool _getDraggable() => asJsObject(this).callMethod('getDraggable'); bool get editable => _getEditable(); bool _getEditable() => asJsObject(this).callMethod('getEditable'); GMap get map => _getMap(); - GMap _getMap() => ((e) => e == null ? null : new GMap.created(e))( - asJsObject(this).callMethod('getMap')); + GMap _getMap() => __codec28.decode(asJsObject(this).callMethod('getMap')); bool get visible => _getVisible(); bool _getVisible() => asJsObject(this).callMethod('getVisible'); void set bounds(LatLngBounds bounds) => _setBounds(bounds); void _setBounds(LatLngBounds bounds) { - asJsObject(this).callMethod( - 'setBounds', [((e) => e == null ? null : asJsObject(e))(bounds)]); + asJsObject(this).callMethod('setBounds', [__codec5.encode(bounds)]); } void set draggable(bool draggable) => _setDraggable(draggable); void _setDraggable(bool draggable) { @@ -2709,13 +2506,11 @@ class Rectangle extends MVCObject implements _Rectangle { } void set map(GMap map) => _setMap(map); void _setMap(GMap map) { - asJsObject(this).callMethod( - 'setMap', [((e) => e == null ? null : asJsObject(e))(map)]); + asJsObject(this).callMethod('setMap', [__codec28.encode(map)]); } void set options(RectangleOptions options) => _setOptions(options); void _setOptions(RectangleOptions options) { - asJsObject(this).callMethod( - 'setOptions', [((e) => e == null ? null : asJsObject(e))(options)]); + asJsObject(this).callMethod('setOptions', [__codec60.encode(options)]); } void set visible(bool visible) => _setVisible(visible); void _setVisible(bool visible) { @@ -2747,6 +2542,9 @@ class Rectangle extends MVCObject implements _Rectangle { Stream get onRightclick => getStream(this, #onRightclick, "rightclick", (JsObject o) => new MouseEvent.created(o)); } +/// codec for RectangleOptions +final __codec60 = new JsInterfaceCodec( + (o) => new RectangleOptions.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -2759,12 +2557,9 @@ class RectangleOptions extends JsInterface implements _RectangleOptions { RectangleOptions() : this.created(new JsObject(context['Object'])); void set bounds(LatLngBounds _bounds) { - asJsObject(this)['bounds'] = - ((e) => e == null ? null : asJsObject(e))(_bounds); + asJsObject(this)['bounds'] = __codec5.encode(_bounds); } - LatLngBounds get bounds => ((e) => e == null - ? null - : new LatLngBounds.created(e))(asJsObject(this)['bounds']); + LatLngBounds get bounds => __codec5.decode(asJsObject(this)['bounds']); void set clickable(bool _clickable) { asJsObject(this)['clickable'] = _clickable; } @@ -2786,10 +2581,9 @@ class RectangleOptions extends JsInterface implements _RectangleOptions { } num get fillOpacity => asJsObject(this)['fillOpacity']; void set map(GMap _map) { - asJsObject(this)['map'] = ((e) => e == null ? null : asJsObject(e))(_map); + asJsObject(this)['map'] = __codec28.encode(_map); } - GMap get map => - ((e) => e == null ? null : new GMap.created(e))(asJsObject(this)['map']); + GMap get map => __codec28.decode(asJsObject(this)['map']); void set strokeColor(String _strokeColor) { asJsObject(this)['strokeColor'] = _strokeColor; } @@ -2799,21 +2593,10 @@ class RectangleOptions extends JsInterface implements _RectangleOptions { } num get strokeOpacity => asJsObject(this)['strokeOpacity']; void set strokePosition(StrokePosition _strokePosition) { - asJsObject(this)['strokePosition'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.StrokePosition'); - if (e == StrokePosition.CENTER) return path['CENTER']; - if (e == StrokePosition.INSIDE) return path['INSIDE']; - if (e == StrokePosition.OUTSIDE) return path['OUTSIDE']; - })(_strokePosition); - } - StrokePosition get strokePosition => ((e) { - if (e == null) return null; - final path = getPath('google.maps.StrokePosition'); - if (e == path['CENTER']) return StrokePosition.CENTER; - if (e == path['INSIDE']) return StrokePosition.INSIDE; - if (e == path['OUTSIDE']) return StrokePosition.OUTSIDE; - })(asJsObject(this)['strokePosition']); + asJsObject(this)['strokePosition'] = __codec59.encode(_strokePosition); + } + StrokePosition get strokePosition => + __codec59.decode(asJsObject(this)['strokePosition']); void set strokeWeight(num _strokeWeight) { asJsObject(this)['strokeWeight'] = _strokeWeight; } @@ -2837,31 +2620,27 @@ class RectangleOptions extends JsInterface implements _RectangleOptions { class Circle extends MVCObject implements _Circle { Circle.created(JsObject o) : super.created(o); Circle([CircleOptions opts]) : this.created(new JsObject( - getPath('google.maps.Circle'), - [((e) => e == null ? null : asJsObject(e))(opts)])); + getPath('google.maps.Circle'), [__codec61.encode(opts)])); LatLngBounds get bounds => _getBounds(); - LatLngBounds _getBounds() => ((e) => e == null - ? null - : new LatLngBounds.created(e))(asJsObject(this).callMethod('getBounds')); + LatLngBounds _getBounds() => + __codec5.decode(asJsObject(this).callMethod('getBounds')); LatLng get center => _getCenter(); - LatLng _getCenter() => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this).callMethod('getCenter')); + LatLng _getCenter() => + __codec6.decode(asJsObject(this).callMethod('getCenter')); bool get draggable => _getDraggable(); bool _getDraggable() => asJsObject(this).callMethod('getDraggable'); bool get editable => _getEditable(); bool _getEditable() => asJsObject(this).callMethod('getEditable'); GMap get map => _getMap(); - GMap _getMap() => ((e) => e == null ? null : new GMap.created(e))( - asJsObject(this).callMethod('getMap')); + GMap _getMap() => __codec28.decode(asJsObject(this).callMethod('getMap')); num get radius => _getRadius(); num _getRadius() => asJsObject(this).callMethod('getRadius'); bool get visible => _getVisible(); bool _getVisible() => asJsObject(this).callMethod('getVisible'); void set center(LatLng center) => _setCenter(center); void _setCenter(LatLng center) { - asJsObject(this).callMethod( - 'setCenter', [((e) => e == null ? null : asJsObject(e))(center)]); + asJsObject(this).callMethod('setCenter', [__codec6.encode(center)]); } void set draggable(bool draggable) => _setDraggable(draggable); void _setDraggable(bool draggable) { @@ -2873,13 +2652,11 @@ class Circle extends MVCObject implements _Circle { } void set map(GMap map) => _setMap(map); void _setMap(GMap map) { - asJsObject(this).callMethod( - 'setMap', [((e) => e == null ? null : asJsObject(e))(map)]); + asJsObject(this).callMethod('setMap', [__codec28.encode(map)]); } void set options(CircleOptions options) => _setOptions(options); void _setOptions(CircleOptions options) { - asJsObject(this).callMethod( - 'setOptions', [((e) => e == null ? null : asJsObject(e))(options)]); + asJsObject(this).callMethod('setOptions', [__codec61.encode(options)]); } void set radius(num radius) => _setRadius(radius); void _setRadius(num radius) { @@ -2917,6 +2694,9 @@ class Circle extends MVCObject implements _Circle { Stream get onRightclick => getStream(this, #onRightclick, "rightclick", (JsObject o) => new MouseEvent.created(o)); } +/// codec for CircleOptions +final __codec61 = + new JsInterfaceCodec((o) => new CircleOptions.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -2929,11 +2709,9 @@ class CircleOptions extends JsInterface implements _CircleOptions { CircleOptions() : this.created(new JsObject(context['Object'])); void set center(LatLng _center) { - asJsObject(this)['center'] = - ((e) => e == null ? null : asJsObject(e))(_center); + asJsObject(this)['center'] = __codec6.encode(_center); } - LatLng get center => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this)['center']); + LatLng get center => __codec6.decode(asJsObject(this)['center']); void set clickable(bool _clickable) { asJsObject(this)['clickable'] = _clickable; } @@ -2955,10 +2733,9 @@ class CircleOptions extends JsInterface implements _CircleOptions { } num get fillOpacity => asJsObject(this)['fillOpacity']; void set map(GMap _map) { - asJsObject(this)['map'] = ((e) => e == null ? null : asJsObject(e))(_map); + asJsObject(this)['map'] = __codec28.encode(_map); } - GMap get map => - ((e) => e == null ? null : new GMap.created(e))(asJsObject(this)['map']); + GMap get map => __codec28.decode(asJsObject(this)['map']); void set radius(num _radius) { asJsObject(this)['radius'] = _radius; } @@ -2972,21 +2749,10 @@ class CircleOptions extends JsInterface implements _CircleOptions { } num get strokeOpacity => asJsObject(this)['strokeOpacity']; void set strokePosition(StrokePosition _strokePosition) { - asJsObject(this)['strokePosition'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.StrokePosition'); - if (e == StrokePosition.CENTER) return path['CENTER']; - if (e == StrokePosition.INSIDE) return path['INSIDE']; - if (e == StrokePosition.OUTSIDE) return path['OUTSIDE']; - })(_strokePosition); - } - StrokePosition get strokePosition => ((e) { - if (e == null) return null; - final path = getPath('google.maps.StrokePosition'); - if (e == path['CENTER']) return StrokePosition.CENTER; - if (e == path['INSIDE']) return StrokePosition.INSIDE; - if (e == path['OUTSIDE']) return StrokePosition.OUTSIDE; - })(asJsObject(this)['strokePosition']); + asJsObject(this)['strokePosition'] = __codec59.encode(_strokePosition); + } + StrokePosition get strokePosition => + __codec59.decode(asJsObject(this)['strokePosition']); void set strokeWeight(num _strokeWeight) { asJsObject(this)['strokeWeight'] = _strokeWeight; } @@ -3012,25 +2778,22 @@ class GroundOverlay extends MVCObject implements _GroundOverlay { GroundOverlay(String url, LatLngBounds bounds, [GroundOverlayOptions opts]) : this.created(new JsObject(getPath('google.maps.GroundOverlay'), [ url, - ((e) => e == null ? null : asJsObject(e))(bounds), - ((e) => e == null ? null : asJsObject(e))(opts) + __codec5.encode(bounds), + __codec62.encode(opts) ])); LatLngBounds get bounds => _getBounds(); - LatLngBounds _getBounds() => ((e) => e == null - ? null - : new LatLngBounds.created(e))(asJsObject(this).callMethod('getBounds')); + LatLngBounds _getBounds() => + __codec5.decode(asJsObject(this).callMethod('getBounds')); GMap get map => _getMap(); - GMap _getMap() => ((e) => e == null ? null : new GMap.created(e))( - asJsObject(this).callMethod('getMap')); + GMap _getMap() => __codec28.decode(asJsObject(this).callMethod('getMap')); num get opacity => _getOpacity(); num _getOpacity() => asJsObject(this).callMethod('getOpacity'); String get url => _getUrl(); String _getUrl() => asJsObject(this).callMethod('getUrl'); void set map(GMap map) => _setMap(map); void _setMap(GMap map) { - asJsObject(this).callMethod( - 'setMap', [((e) => e == null ? null : asJsObject(e))(map)]); + asJsObject(this).callMethod('setMap', [__codec28.encode(map)]); } void set opacity(num opacity) => _setOpacity(opacity); void _setOpacity(num opacity) { @@ -3042,6 +2805,9 @@ class GroundOverlay extends MVCObject implements _GroundOverlay { Stream get onDblclick => getStream( this, #onDblclick, "dblclick", (JsObject o) => new MouseEvent.created(o)); } +/// codec for GroundOverlayOptions +final __codec62 = new JsInterfaceCodec( + (o) => new GroundOverlayOptions.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -3059,10 +2825,9 @@ class GroundOverlayOptions extends JsInterface } bool get clickable => asJsObject(this)['clickable']; void set map(GMap _map) { - asJsObject(this)['map'] = ((e) => e == null ? null : asJsObject(e))(_map); + asJsObject(this)['map'] = __codec28.encode(_map); } - GMap get map => - ((e) => e == null ? null : new GMap.created(e))(asJsObject(this)['map']); + GMap get map => __codec28.decode(asJsObject(this)['map']); void set opacity(num _opacity) { asJsObject(this)['opacity'] = _opacity; } @@ -3092,12 +2857,11 @@ class OverlayView extends JsInterface implements _OverlayView { .decode(_getMap()); _getMap() => asJsObject(this).callMethod('getMap'); MapPanes get panes => _getPanes(); - MapPanes _getPanes() => ((e) => e == null ? null : new MapPanes.created(e))( - asJsObject(this).callMethod('getPanes')); + MapPanes _getPanes() => + __codec63.decode(asJsObject(this).callMethod('getPanes')); MapCanvasProjection get projection => _getProjection(); MapCanvasProjection _getProjection() => - ((e) => e == null ? null : new MapCanvasProjection.created(e))( - asJsObject(this).callMethod('getProjection')); + __codec64.decode(asJsObject(this).callMethod('getProjection')); void onAdd() { asJsObject(this).callMethod('onAdd'); } @@ -3113,9 +2877,16 @@ class OverlayView extends JsInterface implements _OverlayView { o.instanceof(getPath("google.maps.StreetViewPanorama"))))) .encode(map)); void _setMap(dynamic /*GMap|StreetViewPanorama*/ map) { - asJsObject(this).callMethod('setMap', [toJs(map)]); + asJsObject(this).callMethod('setMap', [map]); } } +/// codec for MapPanes +final __codec63 = + new JsInterfaceCodec((o) => new MapPanes.created(o)); + +/// codec for MapCanvasProjection +final __codec64 = new JsInterfaceCodec( + (o) => new MapCanvasProjection.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -3159,26 +2930,17 @@ class MapCanvasProjection extends MVCObject implements _MapCanvasProjection { MapCanvasProjection.created(JsObject o) : super.created(o); MapCanvasProjection() : this.created(new JsObject(context['Object'])); - LatLng fromContainerPixelToLatLng(Point pixel, [bool nowrap]) => - ((e) => e == null ? null : new LatLng.created(e))(asJsObject(this) - .callMethod('fromContainerPixelToLatLng', [ - ((e) => e == null ? null : asJsObject(e))(pixel), - nowrap - ])); - LatLng fromDivPixelToLatLng(Point pixel, [bool nowrap]) => - ((e) => e == null ? null : new LatLng.created(e))(asJsObject(this) - .callMethod('fromDivPixelToLatLng', [ - ((e) => e == null ? null : asJsObject(e))(pixel), - nowrap - ])); - Point fromLatLngToContainerPixel(LatLng latLng) => - ((e) => e == null ? null : new Point.created(e))(asJsObject(this) - .callMethod('fromLatLngToContainerPixel', - [((e) => e == null ? null : asJsObject(e))(latLng)])); - Point fromLatLngToDivPixel(LatLng latLng) => - ((e) => e == null ? null : new Point.created(e))(asJsObject(this) - .callMethod('fromLatLngToDivPixel', - [((e) => e == null ? null : asJsObject(e))(latLng)])); + LatLng fromContainerPixelToLatLng(Point pixel, [bool nowrap]) => __codec6 + .decode(asJsObject(this).callMethod( + 'fromContainerPixelToLatLng', [__codec49.encode(pixel), nowrap])); + LatLng fromDivPixelToLatLng(Point pixel, [bool nowrap]) => __codec6.decode( + asJsObject(this).callMethod( + 'fromDivPixelToLatLng', [__codec49.encode(pixel), nowrap])); + Point fromLatLngToContainerPixel(LatLng latLng) => __codec49.decode( + asJsObject(this).callMethod( + 'fromLatLngToContainerPixel', [__codec6.encode(latLng)])); + Point fromLatLngToDivPixel(LatLng latLng) => __codec49.decode(asJsObject(this) + .callMethod('fromLatLngToDivPixel', [__codec6.encode(latLng)])); num get worldWidth => _getWorldWidth(); num _getWorldWidth() => asJsObject(this).callMethod('getWorldWidth'); } @@ -3195,36 +2957,49 @@ class Geocoder extends JsInterface implements _Geocoder { void geocode(GeocoderRequest request, callback(List p1, GeocoderStatus p2)) { - asJsObject(this).callMethod('geocode', [ - ((e) => e == null ? null : asJsObject(e))(request), - ((f) { - if (f == null) return null; - return (p_p1, p_p2) { - p_p1 = new JsListCodec( - new JsInterfaceCodec((o) => ((e) => - e == null ? null : new GeocoderResult.created(e))(o))) - .decode(p_p1); - p_p2 = new BiMapCodec({ - GeocoderStatus.ERROR: - getPath('google.maps.GeocoderStatus')['ERROR'], - GeocoderStatus.INVALID_REQUEST: - getPath('google.maps.GeocoderStatus')['INVALID_REQUEST'], - GeocoderStatus.OK: getPath('google.maps.GeocoderStatus')['OK'], - GeocoderStatus.OVER_QUERY_LIMIT: - getPath('google.maps.GeocoderStatus')['OVER_QUERY_LIMIT'], - GeocoderStatus.REQUEST_DENIED: - getPath('google.maps.GeocoderStatus')['REQUEST_DENIED'], - GeocoderStatus.UNKNOWN_ERROR: - getPath('google.maps.GeocoderStatus')['UNKNOWN_ERROR'], - GeocoderStatus.ZERO_RESULTS: - getPath('google.maps.GeocoderStatus')['ZERO_RESULTS'] - }).decode(p_p2); - return f(p_p1, p_p2); - }; - })(callback) - ]); - } -} + asJsObject(this).callMethod( + 'geocode', [__codec65.encode(request), __codec69.encode(callback)]); + } +} +/// codec for GeocoderRequest +final __codec65 = new JsInterfaceCodec( + (o) => new GeocoderRequest.created(o)); + +/// codec for GeocoderResult +final __codec66 = + new JsInterfaceCodec((o) => new GeocoderResult.created(o)); + +/// codec for List +final __codec67 = new JsListCodec(__codec66); + +/// codec for GeocoderStatus +final __codec68 = new BiMapCodec({ + GeocoderStatus.ERROR: getPath('google.maps.GeocoderStatus')['ERROR'], + GeocoderStatus.INVALID_REQUEST: + getPath('google.maps.GeocoderStatus')['INVALID_REQUEST'], + GeocoderStatus.OK: getPath('google.maps.GeocoderStatus')['OK'], + GeocoderStatus.OVER_QUERY_LIMIT: + getPath('google.maps.GeocoderStatus')['OVER_QUERY_LIMIT'], + GeocoderStatus.REQUEST_DENIED: + getPath('google.maps.GeocoderStatus')['REQUEST_DENIED'], + GeocoderStatus.UNKNOWN_ERROR: + getPath('google.maps.GeocoderStatus')['UNKNOWN_ERROR'], + GeocoderStatus.ZERO_RESULTS: + getPath('google.maps.GeocoderStatus')['ZERO_RESULTS'] +}); + +/// codec for (List, GeocoderStatus) → dynamic +final __codec69 = + new FunctionCodec /*<(List, GeocoderStatus) → dynamic>*/ ( + (f) => (p_p1, p_p2) { + p_p1 = __codec67.decode(p_p1); + p_p2 = __codec68.decode(p_p2); + return f(p_p1, p_p2); +}, (JsFunction f) => (p_p1, p_p2) { + p_p1 = __codec67.encode(p_p1); + p_p2 = __codec68.encode(p_p2); + return f.apply([p_p1, p_p2]); +}); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -3241,31 +3016,28 @@ class GeocoderRequest extends JsInterface implements _GeocoderRequest { } String get address => asJsObject(this)['address']; void set bounds(LatLngBounds _bounds) { - asJsObject(this)['bounds'] = - ((e) => e == null ? null : asJsObject(e))(_bounds); + asJsObject(this)['bounds'] = __codec5.encode(_bounds); } - LatLngBounds get bounds => ((e) => e == null - ? null - : new LatLngBounds.created(e))(asJsObject(this)['bounds']); + LatLngBounds get bounds => __codec5.decode(asJsObject(this)['bounds']); void set componentRestrictions( GeocoderComponentRestrictions _componentRestrictions) { asJsObject(this)['componentRestrictions'] = - ((e) => e == null ? null : asJsObject(e))(_componentRestrictions); + __codec70.encode(_componentRestrictions); } GeocoderComponentRestrictions get componentRestrictions => - ((e) => e == null ? null : new GeocoderComponentRestrictions.created(e))( - asJsObject(this)['componentRestrictions']); + __codec70.decode(asJsObject(this)['componentRestrictions']); void set location(LatLng _location) { - asJsObject(this)['location'] = - ((e) => e == null ? null : asJsObject(e))(_location); + asJsObject(this)['location'] = __codec6.encode(_location); } - LatLng get location => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this)['location']); + LatLng get location => __codec6.decode(asJsObject(this)['location']); void set region(String _region) { asJsObject(this)['region'] = _region; } String get region => asJsObject(this)['region']; } +/// codec for GeocoderComponentRestrictions +final __codec70 = new JsInterfaceCodec( + (o) => new GeocoderComponentRestrictions.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -3313,22 +3085,11 @@ class GeocoderResult extends JsInterface implements _GeocoderResult { void set _address_components( List __address_components) { - asJsObject(this)['address_components'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map( - new JsInterfaceCodec( - (o) => ((e) => e == null - ? null - : new GeocoderAddressComponent.created(e))(o)).encode)); - })(__address_components); - } - List get _address_components => ((e) { - if (e == null) return null; - return new JsList.created(e, - new JsInterfaceCodec((o) => ((e) => - e == null ? null : new GeocoderAddressComponent.created(e))(o))); - })(asJsObject(this)['address_components']); + asJsObject(this)['address_components'] = + __codec72.encode(__address_components); + } + List get _address_components => + __codec72.decode(asJsObject(this)['address_components']); List get addressComponents => _address_components; void set addressComponents(List addressComponents) { _address_components = addressComponents; @@ -3342,12 +3103,10 @@ class GeocoderResult extends JsInterface implements _GeocoderResult { _formatted_address = formattedAddress; } void set geometry(GeocoderGeometry _geometry) { - asJsObject(this)['geometry'] = - ((e) => e == null ? null : asJsObject(e))(_geometry); + asJsObject(this)['geometry'] = __codec73.encode(_geometry); } - GeocoderGeometry get geometry => ((e) => e == null - ? null - : new GeocoderGeometry.created(e))(asJsObject(this)['geometry']); + GeocoderGeometry get geometry => + __codec73.decode(asJsObject(this)['geometry']); void set _partial_match(bool __partial_match) { asJsObject(this)['partial_match'] = __partial_match; } @@ -3357,27 +3116,33 @@ class GeocoderResult extends JsInterface implements _GeocoderResult { _partial_match = partialMatch; } void set _postcode_localities(List __postcode_localities) { - asJsObject(this)['postcode_localities'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e); - })(__postcode_localities); + asJsObject(this)['postcode_localities'] = + __codec74.encode(__postcode_localities); } List get _postcode_localities => - asJsObject(this)['postcode_localities'] as JsArray; + __codec74.decode(asJsObject(this)['postcode_localities']); List get postcodeLocalities => _postcode_localities; void set postcodeLocalities(List postcodeLocalities) { _postcode_localities = postcodeLocalities; } void set types(List _types) { - asJsObject(this)['types'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e); - })(_types); + asJsObject(this)['types'] = __codec74.encode(_types); } - List get types => asJsObject(this)['types'] as JsArray; + List get types => __codec74.decode(asJsObject(this)['types']); } +/// codec for GeocoderAddressComponent +final __codec71 = new JsInterfaceCodec( + (o) => new GeocoderAddressComponent.created(o)); + +/// codec for List +final __codec72 = new JsListCodec(__codec71); + +/// codec for GeocoderGeometry +final __codec73 = new JsInterfaceCodec( + (o) => new GeocoderGeometry.created(o)); + +/// codec for List +final __codec74 = new JsListCodec(null); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -3407,13 +3172,9 @@ class GeocoderAddressComponent extends JsInterface _short_name = shortName; } void set types(List _types) { - asJsObject(this)['types'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e); - })(_types); + asJsObject(this)['types'] = __codec74.encode(_types); } - List get types => asJsObject(this)['types'] as JsArray; + List get types => __codec74.decode(asJsObject(this)['types']); } // ************************************************************************** @@ -3427,53 +3188,38 @@ class GeocoderGeometry extends JsInterface implements _GeocoderGeometry { GeocoderGeometry() : this.created(new JsObject(context['Object'])); void set bounds(LatLngBounds _bounds) { - asJsObject(this)['bounds'] = - ((e) => e == null ? null : asJsObject(e))(_bounds); + asJsObject(this)['bounds'] = __codec5.encode(_bounds); } - LatLngBounds get bounds => ((e) => e == null - ? null - : new LatLngBounds.created(e))(asJsObject(this)['bounds']); + LatLngBounds get bounds => __codec5.decode(asJsObject(this)['bounds']); void set location(LatLng _location) { - asJsObject(this)['location'] = - ((e) => e == null ? null : asJsObject(e))(_location); + asJsObject(this)['location'] = __codec6.encode(_location); } - LatLng get location => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this)['location']); + LatLng get location => __codec6.decode(asJsObject(this)['location']); void set _location_type(GeocoderLocationType __location_type) { - asJsObject(this)['location_type'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.GeocoderLocationType'); - if (e == GeocoderLocationType.APPROXIMATE) return path['APPROXIMATE']; - if (e == GeocoderLocationType.GEOMETRIC_CENTER) return path[ - 'GEOMETRIC_CENTER']; - if (e == GeocoderLocationType.RANGE_INTERPOLATED) return path[ - 'RANGE_INTERPOLATED']; - if (e == GeocoderLocationType.ROOFTOP) return path['ROOFTOP']; - })(__location_type); - } - GeocoderLocationType get _location_type => ((e) { - if (e == null) return null; - final path = getPath('google.maps.GeocoderLocationType'); - if (e == path['APPROXIMATE']) return GeocoderLocationType.APPROXIMATE; - if (e == - path['GEOMETRIC_CENTER']) return GeocoderLocationType.GEOMETRIC_CENTER; - if (e == - path[ - 'RANGE_INTERPOLATED']) return GeocoderLocationType.RANGE_INTERPOLATED; - if (e == path['ROOFTOP']) return GeocoderLocationType.ROOFTOP; - })(asJsObject(this)['location_type']); + asJsObject(this)['location_type'] = __codec75.encode(__location_type); + } + GeocoderLocationType get _location_type => + __codec75.decode(asJsObject(this)['location_type']); GeocoderLocationType get locationType => _location_type; void set locationType(GeocoderLocationType locationType) { _location_type = locationType; } void set viewport(LatLngBounds _viewport) { - asJsObject(this)['viewport'] = - ((e) => e == null ? null : asJsObject(e))(_viewport); + asJsObject(this)['viewport'] = __codec5.encode(_viewport); } - LatLngBounds get viewport => ((e) => e == null - ? null - : new LatLngBounds.created(e))(asJsObject(this)['viewport']); + LatLngBounds get viewport => __codec5.decode(asJsObject(this)['viewport']); } +/// codec for GeocoderLocationType +final __codec75 = new BiMapCodec({ + GeocoderLocationType.APPROXIMATE: + getPath('google.maps.GeocoderLocationType')['APPROXIMATE'], + GeocoderLocationType.GEOMETRIC_CENTER: + getPath('google.maps.GeocoderLocationType')['GEOMETRIC_CENTER'], + GeocoderLocationType.RANGE_INTERPOLATED: + getPath('google.maps.GeocoderLocationType')['RANGE_INTERPOLATED'], + GeocoderLocationType.ROOFTOP: + getPath('google.maps.GeocoderLocationType')['ROOFTOP'] +}); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -3483,17 +3229,15 @@ class GeocoderGeometry extends JsInterface implements _GeocoderGeometry { @JsName('google.maps.DirectionsRenderer') class DirectionsRenderer extends MVCObject implements _DirectionsRenderer { DirectionsRenderer.created(JsObject o) : super.created(o); - DirectionsRenderer([DirectionsRendererOptions opts]) : this.created( - new JsObject(getPath('google.maps.DirectionsRenderer'), - [((e) => e == null ? null : asJsObject(e))(opts)])); + DirectionsRenderer([DirectionsRendererOptions opts]) + : this.created(new JsObject( + getPath('google.maps.DirectionsRenderer'), [__codec76.encode(opts)])); DirectionsResult get directions => _getDirections(); DirectionsResult _getDirections() => - ((e) => e == null ? null : new DirectionsResult.created(e))( - asJsObject(this).callMethod('getDirections')); + __codec77.decode(asJsObject(this).callMethod('getDirections')); GMap get map => _getMap(); - GMap _getMap() => ((e) => e == null ? null : new GMap.created(e))( - asJsObject(this).callMethod('getMap')); + GMap _getMap() => __codec28.decode(asJsObject(this).callMethod('getMap')); Node get panel => _getPanel(); Node _getPanel() => asJsObject(this).callMethod('getPanel'); num get routeIndex => _getRouteIndex(); @@ -3501,18 +3245,16 @@ class DirectionsRenderer extends MVCObject implements _DirectionsRenderer { void set directions(DirectionsResult directions) => _setDirections(directions); void _setDirections(DirectionsResult directions) { - asJsObject(this).callMethod('setDirections', - [((e) => e == null ? null : asJsObject(e))(directions)]); + asJsObject(this).callMethod( + 'setDirections', [__codec77.encode(directions)]); } void set map(GMap map) => _setMap(map); void _setMap(GMap map) { - asJsObject(this).callMethod( - 'setMap', [((e) => e == null ? null : asJsObject(e))(map)]); + asJsObject(this).callMethod('setMap', [__codec28.encode(map)]); } void set options(DirectionsRendererOptions options) => _setOptions(options); void _setOptions(DirectionsRendererOptions options) { - asJsObject(this).callMethod( - 'setOptions', [((e) => e == null ? null : asJsObject(e))(options)]); + asJsObject(this).callMethod('setOptions', [__codec76.encode(options)]); } void set panel(Node panel) => _setPanel(panel); void _setPanel(Node panel) { @@ -3526,6 +3268,13 @@ class DirectionsRenderer extends MVCObject implements _DirectionsRenderer { Stream get onDirectionsChanged => getStream(this, #onDirectionsChanged, "directions_changed"); } +/// codec for DirectionsRendererOptions +final __codec76 = new JsInterfaceCodec( + (o) => new DirectionsRendererOptions.created(o)); + +/// codec for DirectionsResult +final __codec77 = new JsInterfaceCodec( + (o) => new DirectionsResult.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -3539,12 +3288,10 @@ class DirectionsRendererOptions extends JsInterface DirectionsRendererOptions() : this.created(new JsObject(context['Object'])); void set directions(DirectionsResult _directions) { - asJsObject(this)['directions'] = - ((e) => e == null ? null : asJsObject(e))(_directions); + asJsObject(this)['directions'] = __codec77.encode(_directions); } - DirectionsResult get directions => ((e) => e == null - ? null - : new DirectionsResult.created(e))(asJsObject(this)['directions']); + DirectionsResult get directions => + __codec77.decode(asJsObject(this)['directions']); void set draggable(bool _draggable) { asJsObject(this)['draggable'] = _draggable; } @@ -3554,35 +3301,27 @@ class DirectionsRendererOptions extends JsInterface } bool get hideRouteList => asJsObject(this)['hideRouteList']; void set infoWindow(InfoWindow _infoWindow) { - asJsObject(this)['infoWindow'] = - ((e) => e == null ? null : asJsObject(e))(_infoWindow); + asJsObject(this)['infoWindow'] = __codec78.encode(_infoWindow); } - InfoWindow get infoWindow => ((e) => e == null - ? null - : new InfoWindow.created(e))(asJsObject(this)['infoWindow']); + InfoWindow get infoWindow => __codec78.decode(asJsObject(this)['infoWindow']); void set map(GMap _map) { - asJsObject(this)['map'] = ((e) => e == null ? null : asJsObject(e))(_map); + asJsObject(this)['map'] = __codec28.encode(_map); } - GMap get map => - ((e) => e == null ? null : new GMap.created(e))(asJsObject(this)['map']); + GMap get map => __codec28.decode(asJsObject(this)['map']); void set markerOptions(MarkerOptions _markerOptions) { - asJsObject(this)['markerOptions'] = - ((e) => e == null ? null : asJsObject(e))(_markerOptions); + asJsObject(this)['markerOptions'] = __codec45.encode(_markerOptions); } - MarkerOptions get markerOptions => ((e) => e == null - ? null - : new MarkerOptions.created(e))(asJsObject(this)['markerOptions']); + MarkerOptions get markerOptions => + __codec45.decode(asJsObject(this)['markerOptions']); void set panel(Node _panel) { asJsObject(this)['panel'] = _panel; } Node get panel => asJsObject(this)['panel']; void set polylineOptions(PolylineOptions _polylineOptions) { - asJsObject(this)['polylineOptions'] = - ((e) => e == null ? null : asJsObject(e))(_polylineOptions); + asJsObject(this)['polylineOptions'] = __codec54.encode(_polylineOptions); } - PolylineOptions get polylineOptions => ((e) => e == null - ? null - : new PolylineOptions.created(e))(asJsObject(this)['polylineOptions']); + PolylineOptions get polylineOptions => + __codec54.decode(asJsObject(this)['polylineOptions']); void set preserveViewport(bool _preserveViewport) { asJsObject(this)['preserveViewport'] = _preserveViewport; } @@ -3608,6 +3347,9 @@ class DirectionsRendererOptions extends JsInterface } bool get suppressPolylines => asJsObject(this)['suppressPolylines']; } +/// codec for InfoWindow +final __codec78 = + new JsInterfaceCodec((o) => new InfoWindow.created(o)); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -3622,38 +3364,45 @@ class DirectionsService extends JsInterface implements _DirectionsService { void route(DirectionsRequest request, callback(DirectionsResult p1, DirectionsStatus p2)) { - asJsObject(this).callMethod('route', [ - ((e) => e == null ? null : asJsObject(e))(request), - ((f) { - if (f == null) return null; - return (p_p1, p_p2) { - p_p1 = new JsInterfaceCodec((o) => ((e) => - e == null ? null : new DirectionsResult.created(e))(o)) - .decode(p_p1); - p_p2 = new BiMapCodec({ - DirectionsStatus.INVALID_REQUEST: - getPath('google.maps.DirectionsStatus')['INVALID_REQUEST'], - DirectionsStatus.MAX_WAYPOINTS_EXCEEDED: - getPath('google.maps.DirectionsStatus')[ - 'MAX_WAYPOINTS_EXCEEDED'], - DirectionsStatus.NOT_FOUND: - getPath('google.maps.DirectionsStatus')['NOT_FOUND'], - DirectionsStatus.OK: getPath('google.maps.DirectionsStatus')['OK'], - DirectionsStatus.OVER_QUERY_LIMIT: - getPath('google.maps.DirectionsStatus')['OVER_QUERY_LIMIT'], - DirectionsStatus.REQUEST_DENIED: - getPath('google.maps.DirectionsStatus')['REQUEST_DENIED'], - DirectionsStatus.UNKNOWN_ERROR: - getPath('google.maps.DirectionsStatus')['UNKNOWN_ERROR'], - DirectionsStatus.ZERO_RESULTS: - getPath('google.maps.DirectionsStatus')['ZERO_RESULTS'] - }).decode(p_p2); - return f(p_p1, p_p2); - }; - })(callback) - ]); - } -} + asJsObject(this).callMethod( + 'route', [__codec79.encode(request), __codec81.encode(callback)]); + } +} +/// codec for DirectionsRequest +final __codec79 = new JsInterfaceCodec( + (o) => new DirectionsRequest.created(o)); + +/// codec for DirectionsStatus +final __codec80 = new BiMapCodec({ + DirectionsStatus.INVALID_REQUEST: + getPath('google.maps.DirectionsStatus')['INVALID_REQUEST'], + DirectionsStatus.MAX_WAYPOINTS_EXCEEDED: + getPath('google.maps.DirectionsStatus')['MAX_WAYPOINTS_EXCEEDED'], + DirectionsStatus.NOT_FOUND: + getPath('google.maps.DirectionsStatus')['NOT_FOUND'], + DirectionsStatus.OK: getPath('google.maps.DirectionsStatus')['OK'], + DirectionsStatus.OVER_QUERY_LIMIT: + getPath('google.maps.DirectionsStatus')['OVER_QUERY_LIMIT'], + DirectionsStatus.REQUEST_DENIED: + getPath('google.maps.DirectionsStatus')['REQUEST_DENIED'], + DirectionsStatus.UNKNOWN_ERROR: + getPath('google.maps.DirectionsStatus')['UNKNOWN_ERROR'], + DirectionsStatus.ZERO_RESULTS: + getPath('google.maps.DirectionsStatus')['ZERO_RESULTS'] +}); + +/// codec for (DirectionsResult, DirectionsStatus) → dynamic +final __codec81 = + new FunctionCodec /*<(DirectionsResult, DirectionsStatus) → dynamic>*/ ( + (f) => (p_p1, p_p2) { + p_p1 = __codec77.decode(p_p1); + p_p2 = __codec80.decode(p_p2); + return f(p_p1, p_p2); +}, (JsFunction f) => (p_p1, p_p2) { + p_p1 = __codec77.encode(p_p1); + p_p2 = __codec80.encode(p_p2); + return f.apply([p_p1, p_p2]); +}); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -3678,7 +3427,7 @@ class DirectionsRequest extends JsInterface implements _DirectionsRequest { } bool get avoidTolls => asJsObject(this)['avoidTolls']; void set _destination(dynamic __destination) { - asJsObject(this)['destination'] = toJs(__destination); + asJsObject(this)['destination'] = __destination; } dynamic get _destination => asJsObject(this)['destination']; dynamic /*LatLng|String*/ get destination => (new ChainedCodec() @@ -3700,7 +3449,7 @@ class DirectionsRequest extends JsInterface implements _DirectionsRequest { } bool get optimizeWaypoints => asJsObject(this)['optimizeWaypoints']; void set _origin(dynamic __origin) { - asJsObject(this)['origin'] = toJs(__origin); + asJsObject(this)['origin'] = __origin; } dynamic get _origin => asJsObject(this)['origin']; dynamic /*LatLng|String*/ get origin => (new ChainedCodec() @@ -3723,60 +3472,48 @@ class DirectionsRequest extends JsInterface implements _DirectionsRequest { } String get region => asJsObject(this)['region']; void set transitOptions(TransitOptions _transitOptions) { - asJsObject(this)['transitOptions'] = - ((e) => e == null ? null : asJsObject(e))(_transitOptions); + asJsObject(this)['transitOptions'] = __codec82.encode(_transitOptions); } - TransitOptions get transitOptions => ((e) => e == null - ? null - : new TransitOptions.created(e))(asJsObject(this)['transitOptions']); + TransitOptions get transitOptions => + __codec82.decode(asJsObject(this)['transitOptions']); void set travelMode(TravelMode _travelMode) { - asJsObject(this)['travelMode'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.TravelMode'); - if (e == TravelMode.BICYCLING) return path['BICYCLING']; - if (e == TravelMode.DRIVING) return path['DRIVING']; - if (e == TravelMode.TRANSIT) return path['TRANSIT']; - if (e == TravelMode.WALKING) return path['WALKING']; - })(_travelMode); - } - TravelMode get travelMode => ((e) { - if (e == null) return null; - final path = getPath('google.maps.TravelMode'); - if (e == path['BICYCLING']) return TravelMode.BICYCLING; - if (e == path['DRIVING']) return TravelMode.DRIVING; - if (e == path['TRANSIT']) return TravelMode.TRANSIT; - if (e == path['WALKING']) return TravelMode.WALKING; - })(asJsObject(this)['travelMode']); + asJsObject(this)['travelMode'] = __codec83.encode(_travelMode); + } + TravelMode get travelMode => __codec83.decode(asJsObject(this)['travelMode']); void set unitSystem(UnitSystem _unitSystem) { - asJsObject(this)['unitSystem'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.UnitSystem'); - if (e == UnitSystem.IMPERIAL) return path['IMPERIAL']; - if (e == UnitSystem.METRIC) return path['METRIC']; - })(_unitSystem); - } - UnitSystem get unitSystem => ((e) { - if (e == null) return null; - final path = getPath('google.maps.UnitSystem'); - if (e == path['IMPERIAL']) return UnitSystem.IMPERIAL; - if (e == path['METRIC']) return UnitSystem.METRIC; - })(asJsObject(this)['unitSystem']); + asJsObject(this)['unitSystem'] = __codec84.encode(_unitSystem); + } + UnitSystem get unitSystem => __codec84.decode(asJsObject(this)['unitSystem']); void set waypoints(List _waypoints) { - asJsObject(this)['waypoints'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map(new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new DirectionsWaypoint.created(e))( - o)).encode)); - })(_waypoints); - } - List get waypoints => ((e) { - if (e == null) return null; - return new JsList.created(e, - new JsInterfaceCodec((o) => - ((e) => e == null ? null : new DirectionsWaypoint.created(e))(o))); - })(asJsObject(this)['waypoints']); + asJsObject(this)['waypoints'] = __codec86.encode(_waypoints); + } + List get waypoints => + __codec86.decode(asJsObject(this)['waypoints']); } +/// codec for TransitOptions +final __codec82 = + new JsInterfaceCodec((o) => new TransitOptions.created(o)); + +/// codec for TravelMode +final __codec83 = new BiMapCodec({ + TravelMode.BICYCLING: getPath('google.maps.TravelMode')['BICYCLING'], + TravelMode.DRIVING: getPath('google.maps.TravelMode')['DRIVING'], + TravelMode.TRANSIT: getPath('google.maps.TravelMode')['TRANSIT'], + TravelMode.WALKING: getPath('google.maps.TravelMode')['WALKING'] +}); + +/// codec for UnitSystem +final __codec84 = new BiMapCodec({ + UnitSystem.IMPERIAL: getPath('google.maps.UnitSystem')['IMPERIAL'], + UnitSystem.METRIC: getPath('google.maps.UnitSystem')['METRIC'] +}); + +/// codec for DirectionsWaypoint +final __codec85 = new JsInterfaceCodec( + (o) => new DirectionsWaypoint.created(o)); + +/// codec for List +final __codec86 = new JsListCodec(__codec85); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -3797,46 +3534,35 @@ class TransitOptions extends JsInterface implements _TransitOptions { } DateTime get departureTime => asJsObject(this)['departureTime']; void set modes(List _modes) { - asJsObject(this)['modes'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map(new BiMapCodec({ - TransitMode.BUS: getPath('google.maps.TransitMode')['BUS'], - TransitMode.RAIL: getPath('google.maps.TransitMode')['RAIL'], - TransitMode.SUBWAY: getPath('google.maps.TransitMode')['SUBWAY'], - TransitMode.TRAIN: getPath('google.maps.TransitMode')['TRAIN'], - TransitMode.TRAM: getPath('google.maps.TransitMode')['TRAM'] - }).encode)); - })(_modes); - } - List get modes => ((e) { - if (e == null) return null; - return new JsList.created(e, - new BiMapCodec({ - TransitMode.BUS: getPath('google.maps.TransitMode')['BUS'], - TransitMode.RAIL: getPath('google.maps.TransitMode')['RAIL'], - TransitMode.SUBWAY: getPath('google.maps.TransitMode')['SUBWAY'], - TransitMode.TRAIN: getPath('google.maps.TransitMode')['TRAIN'], - TransitMode.TRAM: getPath('google.maps.TransitMode')['TRAM'] - })); - })(asJsObject(this)['modes']); + asJsObject(this)['modes'] = __codec88.encode(_modes); + } + List get modes => __codec88.decode(asJsObject(this)['modes']); void set routingPreference(TransitRoutePreference _routingPreference) { - asJsObject(this)['routingPreference'] = ((e) { - if (e == null) return null; - final path = getPath('google.maps.TransitRoutePreference'); - if (e == TransitRoutePreference.FEWER_TRANSFERS) return path[ - 'FEWER_TRANSFERS']; - if (e == TransitRoutePreference.LESS_WALKING) return path['LESS_WALKING']; - })(_routingPreference); - } - TransitRoutePreference get routingPreference => ((e) { - if (e == null) return null; - final path = getPath('google.maps.TransitRoutePreference'); - if (e == - path['FEWER_TRANSFERS']) return TransitRoutePreference.FEWER_TRANSFERS; - if (e == path['LESS_WALKING']) return TransitRoutePreference.LESS_WALKING; - })(asJsObject(this)['routingPreference']); + asJsObject(this)['routingPreference'] = + __codec89.encode(_routingPreference); + } + TransitRoutePreference get routingPreference => + __codec89.decode(asJsObject(this)['routingPreference']); } +/// codec for TransitMode +final __codec87 = new BiMapCodec({ + TransitMode.BUS: getPath('google.maps.TransitMode')['BUS'], + TransitMode.RAIL: getPath('google.maps.TransitMode')['RAIL'], + TransitMode.SUBWAY: getPath('google.maps.TransitMode')['SUBWAY'], + TransitMode.TRAIN: getPath('google.maps.TransitMode')['TRAIN'], + TransitMode.TRAM: getPath('google.maps.TransitMode')['TRAM'] +}); + +/// codec for List +final __codec88 = new JsListCodec(__codec87); + +/// codec for TransitRoutePreference +final __codec89 = new BiMapCodec({ + TransitRoutePreference.FEWER_TRANSFERS: + getPath('google.maps.TransitRoutePreference')['FEWER_TRANSFERS'], + TransitRoutePreference.LESS_WALKING: + getPath('google.maps.TransitRoutePreference')['LESS_WALKING'] +}); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -3860,7 +3586,7 @@ class DirectionsWaypoint extends JsInterface implements _DirectionsWaypoint { DirectionsWaypoint() : this.created(new JsObject(context['Object'])); void set _location(dynamic __location) { - asJsObject(this)['location'] = toJs(__location); + asJsObject(this)['location'] = __location; } dynamic get _location => asJsObject(this)['location']; dynamic /*LatLng|String*/ get location => (new ChainedCodec() @@ -3890,21 +3616,17 @@ class DirectionsResult extends JsInterface implements _DirectionsResult { DirectionsResult() : this.created(new JsObject(context['Object'])); void set routes(List _routes) { - asJsObject(this)['routes'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map(new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new DirectionsRoute.created(e))( - o)).encode)); - })(_routes); - } - List get routes => ((e) { - if (e == null) return null; - return new JsList.created(e, - new JsInterfaceCodec((o) => - ((e) => e == null ? null : new DirectionsRoute.created(e))(o))); - })(asJsObject(this)['routes']); + asJsObject(this)['routes'] = __codec91.encode(_routes); + } + List get routes => + __codec91.decode(asJsObject(this)['routes']); } +/// codec for DirectionsRoute +final __codec90 = new JsInterfaceCodec( + (o) => new DirectionsRoute.created(o)); + +/// codec for List +final __codec91 = new JsListCodec(__codec90); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -3917,48 +3639,26 @@ class DirectionsRoute extends JsInterface implements _DirectionsRoute { DirectionsRoute() : this.created(new JsObject(context['Object'])); void set bounds(LatLngBounds _bounds) { - asJsObject(this)['bounds'] = - ((e) => e == null ? null : asJsObject(e))(_bounds); + asJsObject(this)['bounds'] = __codec5.encode(_bounds); } - LatLngBounds get bounds => ((e) => e == null - ? null - : new LatLngBounds.created(e))(asJsObject(this)['bounds']); + LatLngBounds get bounds => __codec5.decode(asJsObject(this)['bounds']); void set copyrights(String _copyrights) { asJsObject(this)['copyrights'] = _copyrights; } String get copyrights => asJsObject(this)['copyrights']; void set fare(TransitFare _fare) { - asJsObject(this)['fare'] = ((e) => e == null ? null : asJsObject(e))(_fare); + asJsObject(this)['fare'] = __codec92.encode(_fare); } - TransitFare get fare => ((e) => - e == null ? null : new TransitFare.created(e))(asJsObject(this)['fare']); + TransitFare get fare => __codec92.decode(asJsObject(this)['fare']); void set legs(List _legs) { - asJsObject(this)['legs'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map(new JsInterfaceCodec((o) => - ((e) => e == null ? null : new DirectionsLeg.created(e))(o)).encode)); - })(_legs); - } - List get legs => ((e) { - if (e == null) return null; - return new JsList.created(e, - new JsInterfaceCodec((o) => - ((e) => e == null ? null : new DirectionsLeg.created(e))(o))); - })(asJsObject(this)['legs']); + asJsObject(this)['legs'] = __codec94.encode(_legs); + } + List get legs => __codec94.decode(asJsObject(this)['legs']); void set _overview_path(List __overview_path) { - asJsObject(this)['overview_path'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map(new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new LatLng.created(e))(o)).encode)); - })(__overview_path); - } - List get _overview_path => ((e) { - if (e == null) return null; - return new JsList.created(e, new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new LatLng.created(e))(o))); - })(asJsObject(this)['overview_path']); + asJsObject(this)['overview_path'] = __codec36.encode(__overview_path); + } + List get _overview_path => + __codec36.decode(asJsObject(this)['overview_path']); List get overviewPath => _overview_path; void set overviewPath(List overviewPath) { _overview_path = overviewPath; @@ -3972,27 +3672,29 @@ class DirectionsRoute extends JsInterface implements _DirectionsRoute { _overview_polyline = overviewPolyline; } void set warnings(List _warnings) { - asJsObject(this)['warnings'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e); - })(_warnings); + asJsObject(this)['warnings'] = __codec74.encode(_warnings); } - List get warnings => asJsObject(this)['warnings'] as JsArray; + List get warnings => __codec74.decode(asJsObject(this)['warnings']); void set _waypoint_order(List __waypoint_order) { - asJsObject(this)['waypoint_order'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e); - })(__waypoint_order); + asJsObject(this)['waypoint_order'] = __codec51.encode(__waypoint_order); } List get _waypoint_order => - asJsObject(this)['waypoint_order'] as JsArray; + __codec51.decode(asJsObject(this)['waypoint_order']); List get waypointOrder => _waypoint_order; void set waypointOrder(List waypointOrder) { _waypoint_order = waypointOrder; } } +/// codec for TransitFare +final __codec92 = + new JsInterfaceCodec((o) => new TransitFare.created(o)); + +/// codec for DirectionsLeg +final __codec93 = + new JsInterfaceCodec((o) => new DirectionsLeg.created(o)); + +/// codec for List +final __codec94 = new JsListCodec(__codec93); // ************************************************************************** // Generator: JsInterfaceGenerator @@ -4005,45 +3707,36 @@ class DirectionsLeg extends JsInterface implements _DirectionsLeg { DirectionsLeg() : this.created(new JsObject(context['Object'])); void set _arrival_time(Time __arrival_time) { - asJsObject(this)['arrival_time'] = - ((e) => e == null ? null : asJsObject(e))(__arrival_time); + asJsObject(this)['arrival_time'] = __codec95.encode(__arrival_time); } - Time get _arrival_time => ((e) => e == null ? null : new Time.created(e))( - asJsObject(this)['arrival_time']); + Time get _arrival_time => __codec95.decode(asJsObject(this)['arrival_time']); Time get arrivalTime => _arrival_time; void set arrivalTime(Time arrivalTime) { _arrival_time = arrivalTime; } void set _departure_time(Time __departure_time) { - asJsObject(this)['departure_time'] = - ((e) => e == null ? null : asJsObject(e))(__departure_time); + asJsObject(this)['departure_time'] = __codec95.encode(__departure_time); } - Time get _departure_time => ((e) => e == null ? null : new Time.created(e))( - asJsObject(this)['departure_time']); + Time get _departure_time => + __codec95.decode(asJsObject(this)['departure_time']); Time get departureTime => _departure_time; void set departureTime(Time departureTime) { _departure_time = departureTime; } void set distance(Distance _distance) { - asJsObject(this)['distance'] = - ((e) => e == null ? null : asJsObject(e))(_distance); + asJsObject(this)['distance'] = __codec96.encode(_distance); } - Distance get distance => ((e) => e == null ? null : new Distance.created(e))( - asJsObject(this)['distance']); + Distance get distance => __codec96.decode(asJsObject(this)['distance']); void set duration(GDuration _duration) { - asJsObject(this)['duration'] = - ((e) => e == null ? null : asJsObject(e))(_duration); + asJsObject(this)['duration'] = __codec97.encode(_duration); } - GDuration get duration => ((e) => e == null - ? null - : new GDuration.created(e))(asJsObject(this)['duration']); + GDuration get duration => __codec97.decode(asJsObject(this)['duration']); void set _duration_in_traffic(GDuration __duration_in_traffic) { asJsObject(this)['duration_in_traffic'] = - ((e) => e == null ? null : asJsObject(e))(__duration_in_traffic); + __codec97.encode(__duration_in_traffic); } - GDuration get _duration_in_traffic => ((e) => e == null - ? null - : new GDuration.created(e))(asJsObject(this)['duration_in_traffic']); + GDuration get _duration_in_traffic => + __codec97.decode(asJsObject(this)['duration_in_traffic']); GDuration get durationInTraffic => _duration_in_traffic; void set durationInTraffic(GDuration durationInTraffic) { _duration_in_traffic = durationInTraffic; @@ -4057,11 +3750,9 @@ class DirectionsLeg extends JsInterface implements _DirectionsLeg { _end_address = endAddress; } void set _end_location(LatLng __end_location) { - asJsObject(this)['end_location'] = - ((e) => e == null ? null : asJsObject(e))(__end_location); + asJsObject(this)['end_location'] = __codec6.encode(__end_location); } - LatLng get _end_location => ((e) => e == null ? null : new LatLng.created(e))( - asJsObject(this)['end_location']); + LatLng get _end_location => __codec6.decode(asJsObject(this)['end_location']); LatLng get endLocation => _end_location; void set endLocation(LatLng endLocation) { _end_location = endLocation; @@ -4075,49 +3766,45 @@ class DirectionsLeg extends JsInterface implements _DirectionsLeg { _start_address = startAddress; } void set _start_location(LatLng __start_location) { - asJsObject(this)['start_location'] = - ((e) => e == null ? null : asJsObject(e))(__start_location); + asJsObject(this)['start_location'] = __codec6.encode(__start_location); } - LatLng get _start_location => ((e) => e == null - ? null - : new LatLng.created(e))(asJsObject(this)['start_location']); + LatLng get _start_location => + __codec6.decode(asJsObject(this)['start_location']); LatLng get startLocation => _start_location; void set startLocation(LatLng startLocation) { _start_location = startLocation; } void set steps(List _steps) { - asJsObject(this)['steps'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map(new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new DirectionsStep.created(e))( - o)).encode)); - })(_steps); - } - List get steps => ((e) { - if (e == null) return null; - return new JsList.created(e, - new JsInterfaceCodec((o) => - ((e) => e == null ? null : new DirectionsStep.created(e))(o))); - })(asJsObject(this)['steps']); + asJsObject(this)['steps'] = __codec99.encode(_steps); + } + List get steps => __codec99.decode(asJsObject(this)['steps']); void set _via_waypoints(List __via_waypoints) { - asJsObject(this)['via_waypoints'] = ((e) { - if (e == null) return null; - if (e is JsInterface) return asJsObject(e); - return new JsArray.from(e.map(new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new LatLng.created(e))(o)).encode)); - })(__via_waypoints); - } - List get _via_waypoints => ((e) { - if (e == null) return null; - return new JsList.created(e, new JsInterfaceCodec( - (o) => ((e) => e == null ? null : new LatLng.created(e))(o))); - })(asJsObject(this)['via_waypoints']); + asJsObject(this)['via_waypoints'] = __codec36.encode(__via_waypoints); + } + List get _via_waypoints => + __codec36.decode(asJsObject(this)['via_waypoints']); List get viaWaypoints => _via_waypoints; void set viaWaypoints(List viaWaypoints) { _via_waypoints = viaWaypoints; } } +/// codec for Time +final __codec95 = new JsInterfaceCodec