@@ -120,10 +120,11 @@ class GoogleMap extends StatefulWidget {
120120 this .indoorViewEnabled = false ,
121121 this .trafficEnabled = false ,
122122 this .buildingsEnabled = true ,
123- this .markers = const < Marker > {},
124- this .polygons = const < Polygon > {},
125- this .polylines = const < Polyline > {},
126- this .circles = const < Circle > {},
123+ // MOD imperative map updates (commented the lines below)
124+ // this.markers = const <Marker>{},
125+ // this.polygons = const <Polygon>{},
126+ // this.polylines = const <Polyline>{},
127+ // this.circles = const <Circle>{},
127128 this .clusterManagers = const < ClusterManager > {},
128129 this .heatmaps = const < Heatmap > {},
129130 this .onCameraMoveStarted,
@@ -134,7 +135,15 @@ class GoogleMap extends StatefulWidget {
134135 this .onTap,
135136 this .onLongPress,
136137 this .cloudMapId,
138+ // MOD imperative map updates - replaced this:
139+ /*
137140 });
141+ *//* with that: */
142+ }) : this .markers = const < Marker > {},
143+ this .polygons = const < Polygon > {},
144+ this .polylines = const < Polyline > {},
145+ this .circles = const < Circle > {};
146+ // End of replacement
138147
139148 /// Callback method for when the map is ready to be used.
140149 ///
@@ -460,11 +469,10 @@ class _GoogleMapState extends State<GoogleMap> {
460469
461470 _updateOptions (controller);
462471 _updateClusterManagers (controller);
463- // MOD imperative map updates (commented the lines below)
464- //_updateMarkers(controller);
465- //_updatePolygons(controller);
466- //_updatePolylines(controller);
467- //_updateCircles(controller);
472+ _updateMarkers (controller);
473+ _updatePolygons (controller);
474+ _updatePolylines (controller);
475+ _updateCircles (controller);
468476 _updateHeatmaps (controller);
469477 _updateTileOverlays (controller);
470478 _updateGroundOverlays (controller);
0 commit comments