Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
073fca5
Merge pull request #1 from flutter/master
otopba Jul 26, 2019
bb12418
Merge pull request #2 from flutter/master
otopba Aug 6, 2019
a03ee88
Merge pull request #3 from flutter/master
otopba Aug 31, 2019
e2613e0
Merge pull request #4 from flutter/master
otopba Sep 11, 2019
1c98d10
Merge pull request #5 from flutter/master
otopba Sep 16, 2019
b50c88e
Merge pull request #6 from flutter/master
otopba Sep 20, 2019
25f8b29
Add TileOverlay support for Android.
otopba Sep 21, 2019
99d6c94
Merge branch 'master' into tile_overlays
otopba Sep 21, 2019
684c2b4
Avoid unnecessary redraws
otopba Sep 21, 2019
bd8143a
fix format
otopba Sep 21, 2019
ce695b1
Merge pull request #7 from flutter/master
otopba Sep 25, 2019
afa565d
Merge branch 'master' into tile_overlays
otopba Sep 25, 2019
58192f4
Merge pull request #8 from flutter/master
otopba Oct 6, 2019
900264c
Merge branch 'master' into tile_overlays
otopba Oct 6, 2019
485a419
Merge pull request #9 from flutter/master
otopba Nov 2, 2019
f0df60a
Merge branch 'master' into tile_overlays
otopba Nov 2, 2019
dde8df7
Merge pull request #10 from flutter/master
otopba Nov 12, 2019
33ed689
Merge pull request #11 from flutter/master
otopba Nov 29, 2019
7ec3707
Merge remote-tracking branch 'upstream/master'
otopba Dec 8, 2019
f056c49
Merge remote-tracking branch 'upstream/master'
otopba Dec 11, 2019
ab1d5bc
Merge remote-tracking branch 'upstream/master'
otopba Dec 19, 2019
e4a6011
Merge remote-tracking branch 'upstream/master'
otopba Jan 7, 2020
62bf14c
Merge branch 'master' into tile_overlays
otopba Jan 14, 2020
fb15656
Merge remote-tracking branch 'upstream/master'
otopba Jan 19, 2020
596184c
Merge remote-tracking branch 'upstream/master'
otopba Jan 21, 2020
e038a3e
Add dummy map initialization
otopba Jan 21, 2020
4345ed5
Revert "Add dummy map initialization"
otopba Jan 21, 2020
ee302c1
Merge remote-tracking branch 'upstream/master'
otopba Jan 23, 2020
4bd7ee4
Merge branch 'master' into tile_overlays
otopba Jan 24, 2020
c9ee500
Merge remote-tracking branch 'origin/tile_overlays' into tile_overlays
otopba Jan 24, 2020
5850b81
fix changelog
otopba Jan 24, 2020
aa9a533
Add iOS implementation of TileOverlays
neokree Jan 27, 2020
5a5482c
Fix typo
neokree Jan 29, 2020
3b8b6b5
Add tileSize option in flutter TileOverlay class
neokree Jan 29, 2020
246636a
Unify zIndex property type to other overlays
neokree Jan 29, 2020
97598ab
Merge remote-tracking branch 'upstream/master'
otopba Jan 29, 2020
4bbcecf
Merge branch 'master' into tile_overlays
otopba Jan 29, 2020
4c8d45a
Merge remote-tracking branch 'upstream/master'
otopba Feb 1, 2020
976281f
Merge branch 'master' into tile_overlays
otopba Feb 1, 2020
a92d75d
merge
otopba Feb 1, 2020
cfbcb2c
fix analyze
otopba Feb 1, 2020
4ec2520
fix analyze
otopba Feb 1, 2020
f22aebd
fix analyze
otopba Feb 1, 2020
e9c4ea4
Merge branch 'master' into tile_overlays
neokree Feb 9, 2020
c267dca
Merge remote-tracking branch 'upstream/master'
otopba Feb 24, 2020
49dae7e
Merge branch 'master' into tile_overlays
otopba Feb 24, 2020
29de40b
move file
otopba Feb 24, 2020
b173a9c
move files
otopba Feb 24, 2020
fba1dd4
move files
otopba Feb 24, 2020
1936b10
fix path
otopba Feb 24, 2020
4816227
Merge remote-tracking branch 'upstream/master'
otopba Mar 19, 2020
bb4e5be
Merge remote-tracking branch 'upstream/master'
otopba Mar 22, 2020
cb85a8a
Merge branch 'master' into tile_overlays
otopba Mar 22, 2020
f46e1ba
merge
otopba Mar 22, 2020
7245d7f
Do not check for `tileOverlayId` nullability in native code
neokree Apr 13, 2020
0a86ebc
Merge remote-tracking branch 'upstream/master'
otopba Apr 30, 2020
6cd64da
Merge remote-tracking branch 'upstream/master'
otopba May 15, 2020
9c0090e
Merge remote-tracking branch 'upstream/master'
otopba Aug 20, 2020
b79938a
Merge remote-tracking branch 'upstream/master'
otopba Sep 14, 2020
46c9bc9
Merge remote-tracking branch 'plugins/master'
neokree Oct 12, 2020
f621d70
Merge pull request #13 from flutter/master
otopba Oct 26, 2020
8e0d4a6
Merge remote-tracking branch 'upstream/master'
otopba Nov 1, 2020
c4ab426
Merge remote-tracking branch 'origin/master'
otopba Nov 1, 2020
a17b8c0
Merge remote-tracking branch 'origin/tile_overlays' into tile_overlays
otopba Nov 1, 2020
eec0d88
Merge branch 'master' into tile_overlays
otopba Nov 1, 2020
0a90447
update versions
otopba Nov 1, 2020
80dd323
Merge branch 'master' into tile_overlays
neokree Nov 25, 2020
e1b39bd
Move types into google_maps_flutter_platform_interface package
neokree Nov 25, 2020
f40930b
Restore `updateTileOverlays` and `clearTileCache` methods
neokree Nov 25, 2020
510e7b5
Fix example app compilation error
neokree Nov 28, 2020
d6347d0
Fix getTile method
neokree Nov 28, 2020
4825de1
Use new pub google_maps_flutter_platform_interface package
neokree Nov 28, 2020
b8fb61e
Revert "Use new pub google_maps_flutter_platform_interface package"
neokree Nov 28, 2020
139bf05
Fix tile overlays not showed up before `onMapCreated` is called on iOS
neokree Nov 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restore updateTileOverlays and clearTileCache methods
  • Loading branch information
neokree committed Nov 25, 2020
commit f40930b60e5de2f9cca3757805a4c76d52601b74
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,29 @@ class GoogleMapController {
mapId: mapId);
}

/// Updates tile overlays configuration.
///
/// Change listeners are notified once the update has been made on the
/// platform side.
///
/// The returned [Future] completes after listeners have been notified.
Future<void> _updateTileOverlays(TileOverlayUpdates tileOverlayUpdates) {
assert(tileOverlayUpdates != null);
return _googleMapsFlutterPlatform.updateTileOverlays(tileOverlayUpdates,
mapId: mapId);
}

/// Clears the tile cache so that all tiles will be requested again from the
/// [TileProvider]. The current tiles from this tile overlay will also be
/// cleared from the map after calling this method. The API maintains a small
/// in-memory cache of tiles. If you want to cache tiles for longer, you
/// should implement an on-disk cache.
Future<void> clearTileCache(TileOverlayId tileOverlayId) async {
assert(tileOverlayId != null);
return _googleMapsFlutterPlatform.clearTileCache(tileOverlayId,
mapId: mapId);
}

/// Starts an animated change of the map camera position.
///
/// The returned [Future] completes after the change has been started on the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class GoogleMap extends StatefulWidget {
this.polygons,
this.polylines,
this.circles,
this.tileOverlays,
this.onCameraMoveStarted,
this.onCameraMove,
this.onCameraIdle,
Expand Down Expand Up @@ -120,6 +121,9 @@ class GoogleMap extends StatefulWidget {
/// Circles to be placed on the map.
final Set<Circle> circles;

/// Tile overlays to be placed on the map.
final Set<TileOverlay> tileOverlays;

/// Called when the camera starts moving.
///
/// This can be initiated by the following:
Expand Down Expand Up @@ -220,6 +224,8 @@ class _GoogleMapState extends State<GoogleMap> {
Map<PolygonId, Polygon> _polygons = <PolygonId, Polygon>{};
Map<PolylineId, Polyline> _polylines = <PolylineId, Polyline>{};
Map<CircleId, Circle> _circles = <CircleId, Circle>{};
Map<TileOverlayId, TileOverlay> _tileOverlays =
<TileOverlayId, TileOverlay>{};
_GoogleMapOptions _googleMapOptions;

@override
Expand All @@ -231,6 +237,7 @@ class _GoogleMapState extends State<GoogleMap> {
'polygonsToAdd': serializePolygonSet(widget.polygons),
'polylinesToAdd': serializePolylineSet(widget.polylines),
'circlesToAdd': serializeCircleSet(widget.circles),
'tileOverlaysToAdd': serializeTileOverlaySet(widget.tileOverlays),
'_webOnlyMapCreationId': _webOnlyMapCreationId,
};

Expand All @@ -249,6 +256,7 @@ class _GoogleMapState extends State<GoogleMap> {
_polygons = keyByPolygonId(widget.polygons);
_polylines = keyByPolylineId(widget.polylines);
_circles = keyByCircleId(widget.circles);
_tileOverlays = keyTileOverlayId(widget.tileOverlays);
}

@override
Expand All @@ -266,6 +274,7 @@ class _GoogleMapState extends State<GoogleMap> {
_updatePolygons();
_updatePolylines();
_updateCircles();
_updateTileOverlays();
}

void _updateOptions() async {
Expand Down Expand Up @@ -313,6 +322,14 @@ class _GoogleMapState extends State<GoogleMap> {
_circles = keyByCircleId(widget.circles);
}

void _updateTileOverlays() async {
final GoogleMapController controller = await _controller.future;
// ignore: unawaited_futures
controller._updateTileOverlays(TileOverlayUpdates.from(
_tileOverlays.values.toSet(), widget.tileOverlays));
_tileOverlays = keyTileOverlayId(widget.tileOverlays);
}

Future<void> onPlatformViewCreated(int id) async {
final GoogleMapController controller = await GoogleMapController.init(
id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,40 @@ class MethodChannelGoogleMapsFlutter extends GoogleMapsFlutterPlatform {
);
}

/// Updates tile overlay configuration.
///
/// Change listeners are notified once the update has been made on the
/// platform side.
///
/// The returned [Future] completes after listeners have been notified.
@override
Future<void> updateTileOverlays(
TileOverlayUpdates tileOverlayUpdates, {
@required int mapId,
}) {
assert(tileOverlayUpdates != null);
return channel(mapId).invokeMethod<void>(
'tileOverlays#update',
tileOverlayUpdates.toJson(),
);
}

/// Clears the tile cache so that all tiles will be requested again from the
/// [TileProvider]. The current tiles from this tile overlay will also be
/// cleared from the map after calling this method. The API maintains a small
/// in-memory cache of tiles. If you want to cache tiles for longer, you
/// should implement an on-disk cache.
@override
Future<void> clearTileCache(
TileOverlayId tileOverlayId, {
@required int mapId,
}) {
return channel(mapId)
.invokeMethod<void>('tileOverlays#clearTileCache', <String, dynamic>{
'tileOverlayId': tileOverlayId.value,
});
}

/// Starts an animated change of the map camera position.
///
/// The returned [Future] completes after the change has been started on the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,31 @@ abstract class GoogleMapsFlutterPlatform extends PlatformInterface {
throw UnimplementedError('updateCircles() has not been implemented.');
}

/// Updates tile overlay configuration.
///
/// Change listeners are notified once the update has been made on the
/// platform side.
///
/// The returned [Future] completes after listeners have been notified.
Future<void> updateTileOverlays(
TileOverlayUpdates tileOverlayUpdates, {
@required int mapId,
}) {
throw UnimplementedError('updateTileOverlays() has not been implemented.');
}

/// Clears the tile cache so that all tiles will be requested again from the
/// [TileProvider]. The current tiles from this tile overlay will also be
/// cleared from the map after calling this method. The API maintains a small
/// in-memory cache of tiles. If you want to cache tiles for longer, you
/// should implement an on-disk cache.
Future<void> clearTileCache(
TileOverlayId tileOverlayId, {
@required int mapId,
}) {
throw UnimplementedError('clearTileCache() has not been implemented.');
}

/// Starts an animated change of the map camera position.
///
/// The returned [Future] completes after the change has been started on the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export 'polyline.dart';
export 'screen_coordinate.dart';
export 'tile.dart';
export 'tile_overlay.dart';
export 'tile_overlay_updates.dart';
export 'tile_provider.dart';
export 'ui.dart';

Expand Down